
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.
25 lines
685 B
CoffeeScript
25 lines
685 B
CoffeeScript
`import MainTabRoute from 'travis/routes/main-tab'`
|
|
|
|
Route = MainTabRoute.extend
|
|
renderTemplate: ->
|
|
@render 'repo'
|
|
@render 'build', into: 'repo'
|
|
|
|
setupController: (controller, searchPhrase) ->
|
|
# TODO: this method is almost the same as _super, refactor this
|
|
@controllerFor('repo').activate('index')
|
|
@controllerFor('repos').activate('search', searchPhrase)
|
|
|
|
@currentRepoDidChange()
|
|
@controllerFor('repos').addObserver('firstObject', this, 'currentRepoDidChange')
|
|
|
|
model: (params) ->
|
|
params.phrase.replace(/%2F/g, '/')
|
|
|
|
deactivate: ->
|
|
@_super.apply(this, arguments)
|
|
|
|
@controllerFor('repos').set('search', undefined)
|
|
|
|
`export default Route`
|