Module: Card::Set::Rule::RuleForm::FormElements::HtmlFormat
- Extended by:
- AbstractFormat
- Defined in:
- tmpsets/set/mod022-rules/rule/rule_form/form_elements.rb
Instance Method Summary collapse
- #option_list(title) ⇒ Object
- #related_rule_radios(related_sets, tag) ⇒ Object
- #related_set_formgroup ⇒ Object
- #related_sets_in_context ⇒ Object
- #rule_set_formgroup ⇒ Object
-
#rule_set_selection ⇒ Object
DEPRECATED.
Instance Method Details
#option_list(title) ⇒ Object
42 43 44 45 46 47 48 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/form_elements.rb', line 42 def option_list title formgroup title, editor: "set", class: "col-xs-6", help: false do wrap_with :ul do wrap_each_with(:li, class: "radio") { yield } end end end |
#related_rule_radios(related_sets, tag) ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/form_elements.rb', line 50 def , tag .map do |set_name, _label| rule_name = "#{set_name}+#{tag}" state = Card.exists?(rule_name) ? :exists : nil rule_radio set_name, state do :name, rule_name end end end |
#related_set_formgroup ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/form_elements.rb', line 27 def = return "" unless && !.empty? tag = @rule_context.rule_user_setting_name option_list "related set" do , tag end end |
#related_sets_in_context ⇒ Object
37 38 39 40 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/form_elements.rb', line 37 def set_context = @rule_context.rule_set_name set_context && Card.fetch(set_context).prototype. end |
#rule_set_formgroup ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/form_elements.rb', line 17 def rule_set_formgroup tag = @rule_context.rule_user_setting_name narrower = [] option_list "set" do .map do |set_name, state| set_name, tag, state, narrower end end end |
#rule_set_selection ⇒ Object
DEPRECATED
11 12 13 14 15 |
# File 'tmpsets/set/mod022-rules/rule/rule_form/form_elements.rb', line 11 def rule_set_selection wrap_with :div, class: "set-list" do [rule_set_formgroup, ] end end |