devdocs/assets/javascripts/views/content/static_page.coffee
2013-10-24 20:49:33 +02:00

26 lines
443 B
CoffeeScript

class app.views.StaticPage extends app.View
@className: '_static'
@titles:
about: 'About'
news: 'News'
help: 'Help'
notFound: '404'
deactivate: ->
if super
@empty()
@page = null
return
render: (page) ->
@page = page
@html @tmpl("#{@page}Page")
return
getTitle: ->
@constructor.titles[@page]
onRoute: (context) ->
@render context.page or 'notFound'
return