Module: Card::Set::Rule::RuleForm::Buttons::HtmlFormat
- Extended by:
- AbstractFormat
- Defined in:
- tmpsets/set/mod022-rules/rule/rule_form/buttons.rb
Instance Method Summary collapse
- #delete_confirm(fallback_set) ⇒ Object
- #edit_rule_buttons ⇒ Object
- #edit_rule_cancel_button ⇒ Object
- #edit_rule_delete_button(args = {}) ⇒ Object
- #edit_rule_submit_button ⇒ Object
Instance Method Details
#delete_confirm(fallback_set) ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/buttons.rb', line 38 def delete_confirm fallback_set setting = card.rule_setting_name if fallback_set && (fallback_set_card = Card.fetch(fallback_set)) "Deleting will revert to #{setting} rule for #{fallback_set_card.label}" else "Are you sure you want to delete the #{setting} rule for #{rule_set_description}?" end end |
#edit_rule_buttons ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/buttons.rb', line 9 def wrap_with(:div, class: "button-area") do [ (class: "_rule-submit-button"), (class: "_rule-submit-button", close: form_type), , ] end end |
#edit_rule_cancel_button ⇒ Object
20 21 22 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/buttons.rb', line 20 def send "#{form_type}_close_button", "Cancel", situation: "secondary", class: "btn-sm" end |
#edit_rule_delete_button(args = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/buttons.rb', line 24 def args={} return if card.new_card? delete_opts = { confirm: delete_confirm(args[:fallback_set]), success: @edit_rule_success, class: "_close-#{form_type}-on-success" } delete_opts["data-slot-selector"] = slot_selector if args[:slot_selector] wrap_with :span, class: "rule-delete-section" do delete_opts end end |
#edit_rule_submit_button ⇒ Object
48 49 50 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/buttons.rb', line 48 def class: "_rule-submit-button" end |