Module: Card::Set::All::Editor::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb
Instance Method Summary collapse
-
#default_input_type ⇒ Object
-
#hidden_input ⇒ Object
-
#input_defined_by_card ⇒ Object
core view of card is input.
-
#input_method(input_type) ⇒ Object
-
#input_type ⇒ Object
-
#input_type_from_rule ⇒ Object
-
#placeholder_text ⇒ Object
for override (placeholder for placeholders).
-
#rich_text_input ⇒ Object
-
#text_area_input ⇒ Object
-
#text_field_input ⇒ Object
-
#view: input ⇒ Object
-
#with_card(mark) ⇒ Object
move somewhere more accessible?.
Instance Method Details
#default_input_type ⇒ Object
45 46 47 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 45 def default_input_type :rich_text end |
#hidden_input ⇒ Object
62 63 64 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 62 def hidden_input hidden_field :content, class: classy("d0-card-content") end |
#input_defined_by_card ⇒ Object
core view of card is input
25 26 27 28 29 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 25 def input_defined_by_card with_card input_type do |input_card| nest input_card, view: :core end end |
#input_method(input_type) ⇒ Object
20 21 22 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 20 def input_method input_type "#{input_type}_input" end |
#input_type ⇒ Object
12 13 14 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 12 def input_type voo.input_type.present? ? voo.input_type : input_type_from_rule end |
#input_type_from_rule ⇒ Object
16 17 18 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 16 def input_type_from_rule card.rule(:input_type)&.gsub(/[\[\]]/, "")&.tr(" ", "_") end |
#placeholder_text ⇒ Object
for override (placeholder for placeholders)
67 68 69 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 67 def placeholder_text "" end |
#rich_text_input ⇒ Object
49 50 51 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 49 def rich_text_input send "#{Cardio.config.rich_text_editor || :text_area}_editor_input" end |
#text_area_input ⇒ Object
53 54 55 56 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 53 def text_area_input text_area :content, rows: 5, class: "d0-card-content", "data-card-type-code": card.type_code end |
#text_field_input ⇒ Object
58 59 60 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 58 def text_field_input text_field :content, class: classy("d0-card-content"), placeholder: placeholder_text end |
#view: input ⇒ Object
39 40 41 42 43 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 39 view :input, unknown: true, cache: :never do try(input_method(input_type)) || input_defined_by_card || send(input_method(default_input_type)) end |
#with_card(mark) ⇒ Object
move somewhere more accessible?
32 33 34 35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/editor.rb', line 32 def with_card mark card = Card[mark] yield card if card rescue Card::Error::CodenameNotFound nil end |