Module: Card::Set::All::Help::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod008-help/all/help.rb
Instance Method Summary collapse
-
#help_text ⇒ Object
-
#raw_help_text ⇒ Object
-
#rule_based_help ⇒ Object
-
#view: help ⇒ Object
-
#view: help_text ⇒ Object
-
#view: lead ⇒ Object
-
#wrap_help_text(text) ⇒ Object
Instance Method Details
#help_text ⇒ Object
39 40 41 |
# File 'platypus/tmp/set/gem-defaults/mod008-help/all/help.rb', line 39 def help_text voo.help || rule_based_help end |
#raw_help_text ⇒ Object
43 44 45 |
# File 'platypus/tmp/set/gem-defaults/mod008-help/all/help.rb', line 43 def raw_help_text card.try(:raw_help_text) || card.help_rule_card&.content end |
#rule_based_help ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'platypus/tmp/set/gem-defaults/mod008-help/all/help.rb', line 47 def rule_based_help return "" unless (help_text = raw_help_text) with_nest_mode :normal do process_content help_text, chunk_list: :references # render help card with current card's format # so current card's context is used in help card nests end end |
#view: help ⇒ Object
14 15 16 17 18 19 |
# File 'platypus/tmp/set/gem-defaults/mod008-help/all/help.rb', line 14 view :help, unknown: true, cache: :never, wrap: :slot do help = help_text return "" unless help.present? wrap_with :div, wrap_help_text(help), class: classy("help-text") end |
#view: help_text ⇒ Object
21 22 23 |
# File 'platypus/tmp/set/gem-defaults/mod008-help/all/help.rb', line 21 view :help_text, unknown: true, cache: :never do wrap_help_text help_text end |
#view: lead ⇒ Object
34 35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod008-help/all/help.rb', line 34 view :lead do class_up "card-slot", "lead" _view_content end |
#wrap_help_text(text) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'platypus/tmp/set/gem-defaults/mod008-help/all/help.rb', line 25 def wrap_help_text text help = text if (rule_card = card.help_rule_card) edit_link = with_nest_mode(:normal) { nest(rule_card, view: :edit_link) } help = "<span class='d-none'>#{edit_link}</span>#{text}" end help end |