Sha256: ee591df86bd7ffb4ead5a0c3aaccff158c1cb3817d55b0ed9e0955f46d2aa902

Contents?: true

Size: 893 Bytes

Versions: 4

Compression:

Stored size: 893 Bytes

Contents

format :html do
  view :thumbnail, template: :haml do
    voo.hide :customize_button, :thumbnail_image
  end

  view :customize_button, cache: :never do
    customize_button
  end

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

  view :thumbnail_image do
    field_nest(:image, view: :full_width)
  end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
card-1.95.3 mod/machines/set/abstract/skin_thumbnail.rb
card-1.95.2 mod/machines/set/abstract/skin_thumbnail.rb
card-1.95.1 mod/machines/set/abstract/skin_thumbnail.rb
card-1.95.0 mod/machines/set/abstract/skin_thumbnail.rb