Module: Card::Set::All::ProcessLayout::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod031-layout/all/process_layout.rb
Instance Method Summary collapse
-
#default_page_view ⇒ Object
-
#explicit_modal_wrapper?(view) ⇒ Boolean
-
#layout_for_view(_view) ⇒ Object
for override.
-
#page_layout(view) ⇒ Object
-
#render_with_layout(view, layout, args = {}) ⇒ Object
-
#show_layout? ⇒ Boolean
-
#show_with_page_layout(view, args) ⇒ Object
TODO: use CodeFile cards for these builtin layouts allow for rescue / testing HTML_LAYOUTS = Mod::Loader.load_layouts(:html).merge “none” => “{_main}” HAML_LAYOUTS = Mod::Loader.load_layouts(:haml).
Instance Method Details
#default_page_view ⇒ Object
42 43 44 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/process_layout.rb', line 42 def default_page_view default_nest_view end |
#explicit_modal_wrapper?(view) ⇒ Boolean
50 51 52 53 54 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/process_layout.rb', line 50 def explicit_modal_wrapper? view return unless (wrap_view = view_setting :wrap, view) (wrapper_names(wrap_view) & %i[modal bridge]).any? end |
#layout_for_view(_view) ⇒ Object
for override
30 31 32 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/process_layout.rb', line 30 def layout_for_view _view nil end |
#page_layout(view) ⇒ Object
25 26 27 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/process_layout.rb', line 25 def page_layout view params[:layout] || layout_for_view(view) || layout_name_from_rule || :default end |
#render_with_layout(view, layout, args = {}) ⇒ Object
34 35 36 37 38 39 40 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/process_layout.rb', line 34 def render_with_layout view, layout, args={} view_opts = Layout.main_nest_opts(layout, self) view ||= view_opts.delete(:view) || default_page_view view_opts[:home_view] = view view_opts[:layout] = layout render! view, view_opts.reverse_merge(args) end |
#show_layout? ⇒ Boolean
46 47 48 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/process_layout.rb', line 46 def show_layout? !Env.ajax? || params[:layout] end |
#show_with_page_layout(view, args) ⇒ Object
TODO: use CodeFile cards for these builtin layouts allow for rescue / testing HTML_LAYOUTS = Mod::Loader.load_layouts(:html).merge “none” => “{_main}” HAML_LAYOUTS = Mod::Loader.load_layouts(:haml)
14 15 16 17 18 19 20 21 22 23 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/process_layout.rb', line 14 def show_with_page_layout view, args main! layout = page_layout view args = main_render_args view, args if explicit_modal_wrapper?(view) && layout.to_sym != :modal render_outside_of_layout view, args else render_with_layout view, layout, args end end |