Module: Card::Set::Rule::RuleForm::SetSelection::HtmlFormat

Extended by:
AbstractFormat
Defined in:
card/tmpsets/set/mod036-card-mod-rules/rule/rule_form/set_selection.rb,
card/tmpsets/set/mod037-card-mod-rules/rule/rule_form/set_selection.rb

Instance Method Summary collapse

Instance Method Details

#bridge_option_list(title) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'card/tmpsets/set/mod036-card-mod-rules/rule/rule_form/set_selection.rb', line 26

def bridge_option_list title
  index = -1
  formgroup title, input: "set", class: "col-xs-6", help: false do
    yield.inject("") do |res, radio|
      index += 1
      # TODO
      if false # index.in? [2,3]
        wrap_with(:li, radio, class: "radio") + res
      else
        wrap_with :ul do
          wrap_with(:li, (radio + res), class: "radio")
        end
      end
    end
  end
end

#bridge_rule_set_formgroupObject



15
16
17
18
19
20
21
22
23
24
# File 'card/tmpsets/set/mod036-card-mod-rules/rule/rule_form/set_selection.rb', line 15

def bridge_rule_set_formgroup
  tag = @rule_context.rule_user_setting_name
  narrower = []

  bridge_option_list "Set" do
    rule_set_options.map do |set_name, state|
      RuleSetRadio.new(self, set_name, tag, state).html narrower
    end
  end
end

#bridge_rule_set_selectionObject



9
10
11
12
13
# File 'card/tmpsets/set/mod036-card-mod-rules/rule/rule_form/set_selection.rb', line 9

def bridge_rule_set_selection
  wrap_with :div, class: "set-list" do
    bridge_rule_set_formgroup
  end
end

#rule_set_optionsObject



43
44
45
# File 'card/tmpsets/set/mod036-card-mod-rules/rule/rule_form/set_selection.rb', line 43

def rule_set_options
  @rule_set_options ||= @rule_context.set_options
end