Merge branch 'master' into sf-log
This commit is contained in:
commit
4dba587673
|
@ -6,7 +6,10 @@ Ember.Router.reopen
|
|||
|
||||
handleURL: (url) ->
|
||||
url = url.replace(/#.*?$/, '')
|
||||
@_super(url)
|
||||
try
|
||||
@_super(url)
|
||||
catch error
|
||||
@_super('/not-found')
|
||||
|
||||
# TODO: don't reopen Ember.Route to add events, there should be
|
||||
# a better way (like "parent" resource for everything inside map)
|
||||
|
@ -58,6 +61,7 @@ Travis.Router.map ->
|
|||
|
||||
@route 'stats', path: '/stats'
|
||||
@route 'auth', path: '/auth'
|
||||
@route 'notFound', path: '/not-found'
|
||||
|
||||
@resource 'profile', path: '/profile', ->
|
||||
@route 'index', path: '/'
|
||||
|
@ -193,6 +197,16 @@ Travis.StatsRoute = Ember.Route.extend
|
|||
setupController: ->
|
||||
@container.lookup('controller:application').connectLayout('simple')
|
||||
|
||||
Travis.NotFoundRoute = Ember.Route.extend
|
||||
renderTemplate: ->
|
||||
$('body').attr('id', 'not-found')
|
||||
|
||||
@render 'top', outlet: 'top'
|
||||
@render 'not_found'
|
||||
|
||||
setupController: ->
|
||||
@container.lookup('controller:application').connectLayout('simple')
|
||||
|
||||
Travis.ProfileRoute = Ember.Route.extend
|
||||
needsAuth: true
|
||||
|
||||
|
|
1
assets/scripts/app/templates/not_found.hbs
Normal file
1
assets/scripts/app/templates/not_found.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
The requested page was not found.
|
|
@ -1,12 +1,12 @@
|
|||
<ul class="tabs">
|
||||
<li id="tab_recent" {{bindAttr class="view.classRecent"}}>
|
||||
<h5><a name="recent" {{action activate target="view"}}>{{t layouts.application.recent}}</a></h5>
|
||||
<h5><a {{action activate "recent" target="view"}}>{{t layouts.application.recent}}</a></h5>
|
||||
</li>
|
||||
<li id="tab_owned" {{bindAttr class="view.classOwned"}}>
|
||||
<h5><a name="owned" {{action activate target="view"}}>{{t layouts.application.my_repositories}}</a></h5>
|
||||
<h5><a {{action activate "owned" target="view"}}>{{t layouts.application.my_repositories}}</a></h5>
|
||||
</li>
|
||||
<li id="tab_search" {{bindAttr class="view.classSearch"}}>
|
||||
<h5><a name="search" {{action activate target="view"}}>{{t layouts.application.search}}</a></h5>
|
||||
<h5><a {{action activate "search" target="view"}}>{{t layouts.application.search}}</a></h5>
|
||||
</li>
|
||||
|
||||
<a {{action toggleInfo target="view"}} class="toggle-info"></a>
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
ReposListTabsView: Travis.View.extend
|
||||
templateName: 'repos/list/tabs'
|
||||
tabBinding: 'controller.tab'
|
||||
currentUserBinding: 'controller.currentUser'
|
||||
currentUserBinding: 'controller.currentUser.id'
|
||||
|
||||
activate: ->
|
||||
@get('controller').activate(event.target.name)
|
||||
activate: (name) ->
|
||||
@get('controller').activate(name)
|
||||
|
||||
classRecent: (->
|
||||
'active' if @get('tab') == 'recent'
|
||||
|
|
Loading…
Reference in New Issue
Block a user