travis-web/app/views/repos-list-tabs.coffee
Piotr Sarnacki f7f274f5d5 Fix search
In search there was a check on 'auth' in the view and we no longer
inject auth into views. That's why the check needs to be done on the
controller.

The other thing is that slash breaks the URL currently, so this commit
also changes slash in the search phrase into %2F character.
2015-02-17 10:38:04 +01:00

31 lines
746 B
CoffeeScript

`import Ember from 'ember'`
View = Ember.View.extend
templateName: 'repos/list/tabs'
tabBinding: 'controller.tab'
currentUserBinding: 'controller.currentUser.id'
classRecent: (->
if @get('tab') == 'recent'
'active'
else if @get('tab') == 'search' && @get('controller').auth.get('signedIn')
'hidden'
).property('tab')
classOwned: (->
classes = []
classes.push('active') if @get('tab') == 'owned'
classes.push('display-inline') if @get('currentUser')
classes.join(' ')
).property('tab', 'currentUser')
classSearch: (->
'active' if @get('tab') == 'search'
).property('tab')
classNew: (->
'display-inline' if @get('currentUser')
).property('currentUser')
`export default View`