Module: Card::Set::All::ProcessLayout::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod030-card-mod-layout/all/process_layout.rb,
card/tmpsets/set/mod031-card-mod-layout/all/process_layout.rb

Instance Method Summary collapse

Instance Method Details

#explicit_modal_wrapper?(view) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
64
65
# File 'card/tmpsets/set/mod030-card-mod-layout/all/process_layout.rb', line 61

def explicit_modal_wrapper? view
  return unless view_setting(:wrap, view)

  wrapper_names(view_setting(:wrap, view)).any? { |n| n == :modal || n == :bridge }
end

#page_layoutObject



31
32
33
# File 'card/tmpsets/set/mod030-card-mod-layout/all/process_layout.rb', line 31

def page_layout
  params[:layout] || layout_name_from_rule || :default
end

#render_with_layout(view, layout, args = {}) ⇒ Object



35
36
37
38
39
40
41
# File 'card/tmpsets/set/mod030-card-mod-layout/all/process_layout.rb', line 35

def render_with_layout view, layout, args={}
  view_opts = Layout.main_nest_opts(layout, self)
  view ||= view_opts.delete(:view) || default_nest_view
  view_opts[:home_view] = view
  view_opts[:layout] = layout
  render! view, view_opts.reverse_merge(args)
end

#show_layout?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'card/tmpsets/set/mod030-card-mod-layout/all/process_layout.rb', line 57

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
# File 'card/tmpsets/set/mod030-card-mod-layout/all/process_layout.rb', line 14

def show_with_page_layout view, args
  main!
  args = main_render_args view, args
  if explicit_modal_wrapper?(view) && page_layout.to_sym != :modal
    render_outside_of_layout view, args
  else
    render_with_layout view, page_layout, args
  end
end