travis-web/app/routes/main/search.coffee
Piotr Sarnacki f7f274f5d5 Fix search
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.
2015-02-17 10:38:04 +01:00

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`