Module: Card::Set::All::RichHtml::Header::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod021-standard/all/rich_html/header.rb
Constant Summary collapse
- TOGGLE_MAP =
LOCALIZE first item
{ close: %w[open open], open: %w[close closed] }
Instance Method Summary collapse
- #content_toggle(text = "") ⇒ Object
- #header_title_elements ⇒ Object
- #header_wrap(content = nil) ⇒ Object
- #main_header ⇒ Object
- #show_draft_link? ⇒ Boolean
- #structure_editable? ⇒ Boolean
- #toggle_verb_adjective ⇒ Object
- #toggle_view ⇒ Object
Instance Method Details
#content_toggle(text = "") ⇒ Object
46 47 48 49 50 51 52 |
# File 'tmpsets/set/mod021-standard/all/rich_html/header.rb', line 46 def content_toggle text="" return if text.nil? verb, adjective = toggle_verb_adjective link_to_view adjective, text, title: "#{verb} #{card.name}", # LOCALIZE class: "toggle-#{adjective} toggler nodblclick" end |
#header_title_elements ⇒ Object
25 26 27 28 29 |
# File 'tmpsets/set/mod021-standard/all/rich_html/header.rb', line 25 def header_title_elements voo.hide :title_toggle if show_view?(:icon_toggle, :hide) title_view = show_view?(:title_toggle, :hide) ? :title_toggle : :title [_render_icon_toggle(optional: :hide), _render(title_view)] end |
#header_wrap(content = nil) ⇒ Object
17 18 19 |
# File 'tmpsets/set/mod021-standard/all/rich_html/header.rb', line 17 def header_wrap content=nil haml :header_wrap, content: (block_given? ? yield : output(content)) end |
#main_header ⇒ Object
13 14 15 |
# File 'tmpsets/set/mod021-standard/all/rich_html/header.rb', line 13 def main_header header_wrap _render_header_title end |
#show_draft_link? ⇒ Boolean
31 32 33 |
# File 'tmpsets/set/mod021-standard/all/rich_html/header.rb', line 31 def show_draft_link? card.drafts.present? && @slot_view == :edit end |
#structure_editable? ⇒ Boolean
73 74 75 |
# File 'tmpsets/set/mod021-standard/all/rich_html/header.rb', line 73 def structure_editable? card.structure && card.template.ok?(:update) end |
#toggle_verb_adjective ⇒ Object
60 61 62 63 |
# File 'tmpsets/set/mod021-standard/all/rich_html/header.rb', line 60 def toggle_verb_adjective TOGGLE_MAP[@toggle_mode || :open] || raise(Card::Error, "invalid toggle mode: #{@toggle_mode}") end |
#toggle_view ⇒ Object
54 55 56 |
# File 'tmpsets/set/mod021-standard/all/rich_html/header.rb', line 54 def toggle_view toggle_verb_adjective.last end |