add isBuildTab and isJobTab helpers
This commit is contained in:
parent
a6119caf3e
commit
68b9b31d7f
|
@ -11,20 +11,20 @@
|
||||||
<li id="tab_branches" {{bindAttr class="view.classBranches"}}>
|
<li id="tab_branches" {{bindAttr class="view.classBranches"}}>
|
||||||
<h5><a {{bindAttr href="view.urlBranches"}}>{{t repositories.tabs.branches}}</a></h5>
|
<h5><a {{bindAttr href="view.urlBranches"}}>{{t repositories.tabs.branches}}</a></h5>
|
||||||
</li>
|
</li>
|
||||||
{{#with controller.build}}
|
{{#if view.isBuildTab}}
|
||||||
{{#if isLoaded}}
|
{{#with controller.build}}
|
||||||
<li id="tab_build" {{bindAttr class="view.classBuild"}}>
|
<li id="tab_build" {{bindAttr class="view.classBuild"}}>
|
||||||
<h5><a {{bindAttr href="view.urlBuild"}}>{{t repositories.tabs.build}} #{{number}}</a></h5>
|
<h5><a {{bindAttr href="view.urlBuild"}}>{{t repositories.tabs.build}} #{{number}}</a></h5>
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/with}}
|
||||||
{{/with}}
|
{{/if}}
|
||||||
{{#with controller.job}}
|
{{#if view.isJobTab}}
|
||||||
{{#if isLoaded}}
|
{{#with controller.job}}
|
||||||
<li id="tab_job" {{bindAttr class="view.classJob"}}>
|
<li id="tab_job" {{bindAttr class="view.classJob"}}>
|
||||||
<h5><a {{bindAttr href="view.urlJob"}}>{{t repositories.tabs.job}} #{{number}}</a></h5>
|
<h5><a {{bindAttr href="view.urlJob"}}>{{t repositories.tabs.job}} #{{number}}</a></h5>
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/with}}
|
||||||
{{/with}}
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="tools">
|
<div id="tools">
|
||||||
|
|
|
@ -5,6 +5,15 @@
|
||||||
toggleTools: ->
|
toggleTools: ->
|
||||||
$('#tools .pane').toggle()
|
$('#tools .pane').toggle()
|
||||||
|
|
||||||
|
isBuildTab: (->
|
||||||
|
tab = @getPath('controller.tab')
|
||||||
|
(tab == 'build' || tab == 'job') && @getPath('controller.build.isLoaded')
|
||||||
|
).property('controller.tab', 'controller.build.isLoaded')
|
||||||
|
|
||||||
|
isJobTab: (->
|
||||||
|
@getPath('controller.tab') == 'job' && @getPath('controller.job.isLoaded')
|
||||||
|
).property('controller.tab', 'controller.job.isLoaded')
|
||||||
|
|
||||||
# hrm. how to parametrize bindAttr?
|
# hrm. how to parametrize bindAttr?
|
||||||
classCurrent: (->
|
classCurrent: (->
|
||||||
'active' if @getPath('controller.tab') == 'current'
|
'active' if @getPath('controller.tab') == 'current'
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user