Implement branches
This commit is contained in:
parent
cadc8c0e72
commit
9ed3598f95
|
@ -66,6 +66,8 @@ Travis.RepoController = Travis.Controller.extend
|
||||||
@connectTab('job')
|
@connectTab('job')
|
||||||
|
|
||||||
connectTab: (tab) ->
|
connectTab: (tab) ->
|
||||||
|
# TODO: such implementation seems weird now, because we render
|
||||||
|
# in the renderTemplate function in routes
|
||||||
name = if tab == 'current' then 'build' else tab
|
name = if tab == 'current' then 'build' else tab
|
||||||
viewClass = if name in ['builds', 'branches', 'pull_requests']
|
viewClass = if name in ['builds', 'branches', 'pull_requests']
|
||||||
Travis.BuildsView
|
Travis.BuildsView
|
||||||
|
@ -73,7 +75,6 @@ Travis.RepoController = Travis.Controller.extend
|
||||||
Travis["#{$.camelize(name)}View"]
|
Travis["#{$.camelize(name)}View"]
|
||||||
|
|
||||||
@set('tab', tab)
|
@set('tab', tab)
|
||||||
#@connectOutlet(outletName: 'pane', controller: this, viewClass: viewClass)
|
|
||||||
|
|
||||||
_bind: (to, from) ->
|
_bind: (to, from) ->
|
||||||
@bindings.push Ember.oneWay(this, to, from)
|
@bindings.push Ember.oneWay(this, to, from)
|
||||||
|
|
|
@ -385,6 +385,7 @@ Travis.Router.map ->
|
||||||
@resource 'job', path: '/jobs/:job_id'
|
@resource 'job', path: '/jobs/:job_id'
|
||||||
@resource 'builds', path: '/builds'
|
@resource 'builds', path: '/builds'
|
||||||
@resource 'pullRequests', path: '/pull_requests'
|
@resource 'pullRequests', path: '/pull_requests'
|
||||||
|
@resource 'branches', path: '/branches'
|
||||||
|
|
||||||
Travis.IndexCurrentRoute = Ember.Route.extend
|
Travis.IndexCurrentRoute = Ember.Route.extend
|
||||||
renderTemplate: ->
|
renderTemplate: ->
|
||||||
|
@ -393,19 +394,16 @@ Travis.IndexCurrentRoute = Ember.Route.extend
|
||||||
setupController: ->
|
setupController: ->
|
||||||
@container.lookup('controller:repo').activate('index')
|
@container.lookup('controller:repo').activate('index')
|
||||||
|
|
||||||
Travis.BuildsRoute = Ember.Route.extend
|
Travis.AbstractBuidsRoute = Ember.Route.extend
|
||||||
renderTemplate: ->
|
renderTemplate: ->
|
||||||
@render 'builds', outlet: 'pane', into: 'repo'
|
@render 'builds', outlet: 'pane', into: 'repo'
|
||||||
|
|
||||||
setupController: ->
|
setupController: ->
|
||||||
@container.lookup('controller:repo').activate('builds')
|
@container.lookup('controller:repo').activate(@get('contentType'))
|
||||||
|
|
||||||
Travis.PullRequestsRoute = Ember.Route.extend
|
Travis.BuildsRoute = Travis.AbstractBuidsRoute.extend(contentType: 'builds')
|
||||||
renderTemplate: ->
|
Travis.PullRequestsRoute = Travis.AbstractBuidsRoute.extend(contentType: 'pull_requests')
|
||||||
@render 'builds', outlet: 'pane', into: 'repo'
|
Travis.BranchesRoute = Travis.AbstractBuidsRoute.extend(contentType: 'branches')
|
||||||
|
|
||||||
setupController: ->
|
|
||||||
@container.lookup('controller:repo').activate('pull_requests')
|
|
||||||
|
|
||||||
Travis.BuildRoute = Ember.Route.extend
|
Travis.BuildRoute = Ember.Route.extend
|
||||||
renderTemplate: ->
|
renderTemplate: ->
|
||||||
|
|
|
@ -28,20 +28,20 @@
|
||||||
</li>
|
</li>
|
||||||
<li id="tab_branches" {{bindAttr class="view.classBranches"}}>
|
<li id="tab_branches" {{bindAttr class="view.classBranches"}}>
|
||||||
<h5>
|
<h5>
|
||||||
{{#if view.repo.slug}}
|
{{#if slug}}
|
||||||
<a {{action showBranches view.repo href=true}}>
|
{{#linkTo "branches" this}}
|
||||||
{{t repositories.tabs.branches}}
|
{{t repositories.tabs.branches}}
|
||||||
</a>
|
{{/linkTo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</h5>
|
</h5>
|
||||||
</li>
|
</li>
|
||||||
<li id="tab_build" {{bindAttr class="view.classBuild"}}>
|
<li id="tab_build" {{bindAttr class="view.classBuild"}}>
|
||||||
<h5>
|
<h5>
|
||||||
{{#with view.build}}
|
{{#with view.build}}
|
||||||
{{#if id}}
|
{{#if repo.slug}}
|
||||||
<a {{action showBuild repo this href=true}}>
|
{{#linkTo "build" repo this}}
|
||||||
{{t repositories.tabs.build}} #{{number}}
|
{{t repositories.tabs.build}} #{{number}}
|
||||||
</a>
|
{{/linkTo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/with}}
|
{{/with}}
|
||||||
</h5>
|
</h5>
|
||||||
|
@ -49,10 +49,10 @@
|
||||||
<li id="tab_job" {{bindAttr class="view.classJob"}}>
|
<li id="tab_job" {{bindAttr class="view.classJob"}}>
|
||||||
<h5>
|
<h5>
|
||||||
{{#with view.job}}
|
{{#with view.job}}
|
||||||
{{#if id}}
|
{{#if repo.slug}}
|
||||||
<a {{action showJob repo this href=true}}>
|
{{#linkTo "job" repo this}}
|
||||||
{{t repositories.tabs.job}} #{{number}}
|
{{t repositories.tabs.job}} #{{number}}
|
||||||
</a>
|
{{/linkTo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/with}}
|
{{/with}}
|
||||||
</h5>
|
</h5>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user