travis-web/app/components/repo-show-tabs.coffee
Lisa P 1ba9548ad0 first iteration build header styles
build header styles 2nd iteration

make job header use component too

cleanup templates and markup for repo page

styles for the repo header

rewrite styles for repo header, cleanup tabs
2015-12-02 16:11:14 +01:00

60 lines
1.3 KiB
CoffeeScript

`import Ember from 'ember'`
RepoShowTabsComponent = Ember.Component.extend
tagName: 'nav'
classNames: ['tabnav']
ariaRole: 'tablist'
# hrm. how to parametrize bind-attr?
classCurrent: (->
'active' if @get('tab') == 'current'
).property('tab')
classBuilds: (->
'active' if @get('tab') == 'builds'
).property('tab')
classPullRequests: (->
'active' if @get('tab') == 'pull_requests'
).property('tab')
classBranches: (->
'active' if @get('tab') == 'branches'
).property('tab')
classEvents: (->
'active' if @get('tab') == 'events'
).property('tab')
classBuild: (->
tab = @get('tab')
classes = []
classes.push('active') if tab == 'build'
classes.push('display-inline') if tab == 'build' || tab == 'job'
classes.join(' ')
).property('tab')
# TODO: refactor tabs, most of the things here are not really DRY
classJob: (->
'active' if @get('tab') == 'job'
).property('tab')
classRequests: (->
'active' if @get('tab') == 'requests'
).property('tab')
classCaches: (->
'active' if @get('tab') == 'caches'
).property('tab')
classSettings: (->
'active' if @get('tab') == 'settings'
).property('tab')
classRequest: (->
'active' if @get('tab') == 'request'
).property('tab')
`export default RepoShowTabsComponent`