Module: Card::Set::Rule::Editor::HtmlFormat
- Extended by:
- AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb
Instance Attribute Summary collapse
-
#rule_context ⇒ Object
Returns the value of attribute rule_context.
Instance Method Summary collapse
-
#category_classes ⇒ Object
-
#current_rule ⇒ Object
-
#current_set_key ⇒ Object
-
#edit_link_view ⇒ Object
-
#edit_rule_title ⇒ Object
-
#pill_rule_link(target_view) ⇒ Object
-
#pill_rule_link_opts ⇒ Object
-
#quick_editor ⇒ Object
-
#rule_content_formgroup ⇒ Object
-
#rule_set_description ⇒ Object
-
#rules_type_formgroup ⇒ Object
-
#setting_title ⇒ Object
-
#short_help_text ⇒ Object
-
#view: rule_board_link ⇒ Object
-
#view: rule_edit ⇒ Object
-
#view: rule_help ⇒ Object
-
#view: rule_nest_editor_link ⇒ Object
Instance Attribute Details
#rule_context ⇒ Object
Returns the value of attribute rule_context.
22 23 24 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 22 def rule_context @rule_context end |
Instance Method Details
#category_classes ⇒ Object
61 62 63 64 65 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 61 def category_classes card.rule_set.categories(card.rule_setting.codename) .map { |cat| "_category-#{cat}" } .join(" ") end |
#current_rule ⇒ Object
78 79 80 81 82 83 84 85 86 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 78 def current_rule if params[:assign] card elsif (existing = card.find_existing_rule_card) existing else card end end |
#current_set_key ⇒ Object
121 122 123 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 121 def current_set_key card.new_card? ? Card.quick_fetch(:all).name.key : card.rule_set_key end |
#edit_link_view ⇒ Object
67 68 69 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 67 def edit_link_view :rule_edit end |
#edit_rule_title ⇒ Object
71 72 73 74 75 76 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 71 def edit_rule_title output [ wrap_with(:h5, setting_title, class: "title fw-bold") # render_overlay_rule_help ] end |
#pill_rule_link(target_view) ⇒ Object
45 46 47 48 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 45 def pill_rule_link target_view link_to_view target_view, (setting_title + short_help_text), pill_rule_link_opts end |
#pill_rule_link_opts ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 50 def pill_rule_link_opts opts = board_link_opts( class: "edit-rule-link nav-link _rule-item #{category_classes}", "data-bs-toggle": "pill", "data-category": card.rule_set.categories(card.rule_setting.codename).join(" "), "data-cy": "#{setting_title.to_name.key}-pill" ) opts[:path].delete(:layout) opts end |
#quick_editor ⇒ Object
88 89 90 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 88 def quick_editor rule_content_formgroup end |
#rule_content_formgroup ⇒ Object
117 118 119 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 117 def rule_content_formgroup _render_content_formgroup hide: :conflict_tracker end |
#rule_set_description ⇒ Object
100 101 102 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 100 def rule_set_description card.rule_set.follow_label end |
#rules_type_formgroup ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 104 def rules_type_formgroup return unless card.right.rule_type_editable success = @edit_rule_success wrap_type_formgroup do type_field( href: path(mark: success[:id], view: :rule_form_card_editor, assign: true), class: "type-field rule-type-field _live-type-field", "data-remote" => true ) end end |
#setting_title ⇒ Object
92 93 94 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 92 def setting_title card.name.tag.tr "*", "" end |
#short_help_text ⇒ Object
96 97 98 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 96 def short_help_text "<div class=\"help-text\">#{card.short_help_text}</div>" end |
#view: rule_board_link ⇒ Object
41 42 43 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 41 view :rule_board_link, unknown: true do pill_rule_link :overlay_rule end |
#view: rule_edit ⇒ Object
24 25 26 27 28 29 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 24 view :rule_edit, cache: :never, unknown: true, wrap: { modal: { size: :large, title: :edit_rule_title, footer: "" } } do current_rule_form form_type: :modal end |
#view: rule_help ⇒ Object
31 32 33 34 35 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 31 view :rule_help, unknown: true, perms: :none, cache: :never do wrap_with :div, class: "alert alert-info rule-instruction" do rule_based_help end end |
#view: rule_nest_editor_link ⇒ Object
37 38 39 |
# File 'platypus/tmp/set/gem-defaults/mod010-rules/rule/editor.rb', line 37 view :rule_nest_editor_link, unknown: true do pill_rule_link :modal_rule end |