From a78e226de16b9d962ef095503ecc637561b26e02 Mon Sep 17 00:00:00 2001 From: Lisa Passing Date: Tue, 14 Apr 2015 12:19:07 +0200 Subject: [PATCH] only show one (biggest) cache per branch --- app/routes/caches.coffee | 8 +++++--- app/styles/app/layouts/caches.sass | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/routes/caches.coffee b/app/routes/caches.coffee index 6d7c0ded..35a7f990 100644 --- a/app/routes/caches.coffee +++ b/app/routes/caches.coffee @@ -12,14 +12,16 @@ Route = TravisRoute.extend repo = @modelFor('repo') Ajax.get("/repos/#{repo.get('id')}/caches").then( (data) -> groups = {} + counter = 1 data["caches"].forEach (cacheData) -> branch = cacheData["branch"] group = groups[branch] unless group group = groups[branch] = Ember.Object.create(branch: branch, caches: []) - cache = Ember.Object.create(cacheData) - cache.set('parent', group) - group.get('caches').pushObject(cache) + + cache = Ember.Object.create(cacheData) + cache.set('parent', group) + group.get('caches').pushObject(cache) result = [] for branch, caches of groups diff --git a/app/styles/app/layouts/caches.sass b/app/styles/app/layouts/caches.sass index d46285ff..74843ff3 100644 --- a/app/styles/app/layouts/caches.sass +++ b/app/styles/app/layouts/caches.sass @@ -38,7 +38,7 @@ overflow: auto .build-title float: left - margin-top: 1.1em + margin: 1.1em 0 .5em a:hover text-decoration: underline .button--delete