From 8e610a61912ef0a85323553a9084a4d5b39c5d26 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 2 Feb 2016 11:08:48 +0100 Subject: [PATCH] Show branches content even if there's no defaultBranch --- app/controllers/branches.js | 6 ++++++ app/templates/branches.hbs | 16 +++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/controllers/branches.js b/app/controllers/branches.js index 8d71816d..d53f2a91 100644 --- a/app/controllers/branches.js +++ b/app/controllers/branches.js @@ -13,6 +13,12 @@ export default Ember.Controller.extend({ } }.property('model'), + branchesExist: function() { + var branches = this.get('model'); + + return branches.length; + }.property('model'), + activeBranches: function() { var repos; repos = this.get('model'); diff --git a/app/templates/branches.hbs b/app/templates/branches.hbs index 0f977b11..1d54dcea 100644 --- a/app/templates/branches.hbs +++ b/app/templates/branches.hbs @@ -1,11 +1,13 @@ -{{#if defaultBranch}} +{{#if branchesExist}}
-
-

Default Branch

-
    - {{branch-row build=defaultBranch}} -
-
+ {{#if defaultBranch}} +
+

Default Branch

+
    + {{branch-row build=defaultBranch}} +
+
+ {{/if}} {{#if activeBranches.length}}