From b0b0c76bc46c2821609956f4843285ebc56ad64d Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 10 Feb 2015 10:33:31 +0100 Subject: [PATCH] Display caches link only to logged in users --- app/templates/repos/show/tools.hbs | 2 +- app/views/repo-show-tools.coffee | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/templates/repos/show/tools.hbs b/app/templates/repos/show/tools.hbs index b6f1ac04..87f897f4 100644 --- a/app/templates/repos/show/tools.hbs +++ b/app/templates/repos/show/tools.hbs @@ -10,7 +10,7 @@
  • {{#link-to "requests" view.repo}}Requests{{/link-to}}
  • - {{#if config.endpoints.caches}} + {{#if view.displayCachesLink}}
  • {{#link-to "caches" view.repo}}Caches{{/link-to}}
  • diff --git a/app/views/repo-show-tools.coffee b/app/views/repo-show-tools.coffee index bd4d5770..57b153f2 100644 --- a/app/views/repo-show-tools.coffee +++ b/app/views/repo-show-tools.coffee @@ -1,5 +1,6 @@ `import Ember from 'ember'` `import BasicView from 'travis/views/basic'` +`import config from 'travis/config/environment'` View = BasicView.extend templateName: 'repos/show/tools' @@ -72,6 +73,10 @@ View = BasicView.extend @get('hasPushPermission') ).property('hasPushPermission') + displayCachesLink: (-> + @get('hasPushPermission') && config.endpoints.caches + ).property('hasPushPermission') + displayStatusImages: (-> @get('hasPermission') ).property('hasPermission')