add mustache helper tp support layout elements
[shapado:shapado.git] / app / mustache / layouts / theme_layout_view.rb
1 module Layouts
2   class ThemeLayoutView < ThemeViewBase
3     def render_layout
4       render_buffer current_theme.layout_html.read
5     end
6
7     # returns the content that will displayed inside of the layout
8     # the content can be the list of question or a question and its answers
9     def content
10       view_context.content_for(:layout)
11     end
12
13     def default_include_stylesheets
14       view_context.render 'shared/layout/css'
15     end
16
17     def default_include_javascript
18       view_context.render 'shared/layout/javascript'
19     end
20
21     def default_meta
22       view_context.render 'shared/layout/meta'
23     end
24
25     def default_analytics
26       view_context.render 'shared/analytics'
27     end
28
29     def page_title
30       view_context.page_title
31     end
32
33     def page_class
34       view_context.bodys_class(view_context.params).join(" ")
35     end
36
37     def default_stylesheets
38       view_context.stylesheet_link_tag css_group_path(current_group, params[:test_theme] || current_theme.id, current_theme.version)
39     end
40   end
41 end