1 class Pettanr.Views.Layout.Blog.Header extends Backbone.View
\r
5 initialize: (options) ->
\r
6 @operators = options.operators
\r
7 @router = new Pettanr.Router()
\r
8 @listenTo(@router, 'fire', @fire)
\r
15 c = Pettanr[Pettanr.camelize(params['controller']) + 'Controller']
\r
16 controller = new c(@operators)
\r
17 controller.params = params
\r
18 @listenTo(controller, 'ready', @refresh)
\r
19 @listenTo(controller, 'retitle', @retitle)
\r
20 controller[params['action']]()
\r
22 retitle: (params, str = null) ->
\r
23 t = str || I18n.t(params['controller'] + '.' + params['action'] + '.title')
\r
24 site_caption = _.escape(Manifest.manifest().magic_numbers.profile.users.caption)
\r
25 $(document).attr('title', t + ' - ' + site_caption)
\r
28 @listenTo(view, 'navigate', @navigate)
\r
29 this.$el.html(view.el)
\r
36 @router.navigate(url, {trigger: true, replace: false})
\r
37 @trigger('navigate', url)
\r
39 class Pettanr.Views.Layout.Blog.Body extends Backbone.View
\r
43 initialize: (options) ->
\r
44 @operators = options.operators
\r
45 @router = new Pettanr.Router()
\r
46 @listenTo(@router, 'fire', @fire)
\r
53 c = Pettanr[Pettanr.camelize(params['controller']) + 'Controller']
\r
54 controller = new c(@operators)
\r
55 controller.params = params
\r
56 @listenTo(controller, 'ready', @refresh)
\r
57 @listenTo(controller, 'retitle', @retitle)
\r
58 controller[params['action']]()
\r
60 retitle: (params, str = null) ->
\r
61 t = str || I18n.t(params['controller'] + '.' + params['action'] + '.title')
\r
62 site_caption = _.escape(Manifest.manifest().magic_numbers.profile.users.caption)
\r
63 $(document).attr('title', t + ' - ' + site_caption)
\r
66 @listenTo(view, 'navigate', @navigate)
\r
67 this.$el.html(view.el)
\r
70 @router.navigate(url, {trigger: true, replace: false})
\r
71 @trigger('navigate', url)
\r
73 class Pettanr.Views.Layout.Blog.Footer extends Backbone.View
\r
77 initialize: (options) ->
\r