Module: Card::Set::Abstract::SkinBox::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod014-machines/abstract/skin_box.rb

Instance Method Summary collapse

Instance Method Details

#customize_button(target: parent&.card, text: "Apply and customize") ⇒ Object



21
22
23
24
25
26
27
28
# File 'tmpsets/set/mod014-machines/abstract/skin_box.rb', line 21

def customize_button target: parent&.card, text: "Apply and customize"
  return "" unless card.codename.present?
  theme = card.codename.match(/^(?<theme_name>.+)_skin$/).capture(:theme_name)
  link_to_card target, text,
               path: { action: :update, card: { content: "[[#{card.name}]]" },
                       customize: true, theme: theme },
               class: "btn btn-sm btn-outline-primary mr-2"
end

#select_button(target = parent.card) ⇒ Object



35
36
37
38
39
# File 'tmpsets/set/mod014-machines/abstract/skin_box.rb', line 35

def select_button target=parent.card
  link_to_card target, "Apply",
               path: { action: :update, card: { content: "[[#{card.name}]]" } },
               class: "btn btn-sm btn-primary"
end