Sha256: 9962e378915870389d266848acad369be6c918178d46ac1273d74f70cd8e864a

Contents?: true

Size: 1.41 KB

Versions: 1

Compression:

Stored size: 1.41 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class Abstract
# Set: Abstract (SkinBox)
#
module SkinBox;
extend Card::Set
def self.source_location; "/Users/ezl5238/dev/decko/gem/mod/style/set/abstract/skin_box.rb"; end
module HtmlFormat; module_parent.send :register_set_format, Card::Format::HtmlFormat, self; extend Card::Set::AbstractFormat
  view :box do
    class_up "box-middle", "p-0"
    voo.hide :customize_button, :box_middle
    super()
  end

  view :box_bottom, template: :haml

  view :customize_button, cache: :never do
    customize_button
  end

  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

  view :box_middle do
    return unless card.field(:image)

    field_nest(:image, view: :full_width, size: :large)
  end

  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
end
end;end;end;end;
# ~~ generated from /Users/ezl5238/dev/decko/gem/mod/style/set/abstract/skin_box.rb ~~

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
card-1.102.0 tmpsets/set/mod020-style/abstract/skin_box.rb