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

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod019-card-mod-style/abstract/skin_box.rb,
card/tmpsets/set/mod020-card-mod-style/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 'card/tmpsets/set/mod019-card-mod-style/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 'card/tmpsets/set/mod019-card-mod-style/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

#view: boxObject



9
10
11
12
13
# File 'card/tmpsets/set/mod019-card-mod-style/abstract/skin_box.rb', line 9

view :box do
  class_up "box-middle", "p-0"
  voo.hide :customize_button, :box_middle
  super()
end

#view: box_bottomObject



15
# File 'card/tmpsets/set/mod019-card-mod-style/abstract/skin_box.rb', line 15

view :box_bottom, template: :haml

#view: box_middleObject



30
31
32
33
# File 'card/tmpsets/set/mod019-card-mod-style/abstract/skin_box.rb', line 30

view :box_middle do
  return unless card.field(:image)
  field_nest(:image, view: :full_width, size: :large)
end

#view: customize_buttonObject



17
18
19
# File 'card/tmpsets/set/mod019-card-mod-style/abstract/skin_box.rb', line 17

view :customize_button, cache: :never do
  customize_button
end