Module: Card::Set::Type::Setting::HtmlFormat

Extended by:
AbstractFormat
Defined in:
card/tmpsets/set/mod036-card-mod-rules/type/setting.rb,
card/tmpsets/set/mod037-card-mod-rules/type/setting.rb

Instance Method Summary collapse

Instance Method Details



48
49
50
51
# File 'card/tmpsets/set/mod036-card-mod-rules/type/setting.rb', line 48

def rule_link rule, text
  link_to_card rule, text, path: { view: :modal_rule },
                           slotter: true, "data-modal-class": "modal-lg"
end

#view: coreObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'card/tmpsets/set/mod036-card-mod-rules/type/setting.rb', line 53

view :core do
  haml do
    <<-'HAML'.strip_heredoc
      = _render_rule_help
      %h3 All #{card.name.tr "*", ""} rules that apply to
      - card.set_classes_with_rules.each do |klass, rules|
        %p
          %h5
            = klass.generic_label.downcase
          - if klass.anchorless?
            = nest rules.first, view: :bar, show: :full_name
          - else
            - rules.each do |rule|
              = nest rule, view: :bar
    HAML
  end
end

#view: one_line_contentObject



77
78
79
# File 'card/tmpsets/set/mod036-card-mod-rules/type/setting.rb', line 77

view :one_line_content do
  render_rule_help
end

#view: rule_helpObject

Because +*help content renders in “template” mode when you render its content directly, we render the help text in the context of the *all+ card



73
74
75
# File 'card/tmpsets/set/mod036-card-mod-rules/type/setting.rb', line 73

view :rule_help do
  nest [:all, card.name], view: :rule_help
end