Sha256: 37a851370cdca85f452c85553bf630e68042a20ef571858d1ca2465529713d88

Contents?: true

Size: 1.62 KB

Versions: 9

Compression:

Stored size: 1.62 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class Right
# Set: All "+Style" cards
#
module Style;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/settings/set/right/style.rb"; end
require "sassc"
include_set Abstract::Machine

store_machine_output filetype: "css"

def ok_to_read
  true
end

module Format; parent.send :register_set_format, Card::Format, self; extend Card::Set::AbstractFormat
  # turn off autodetection of uri's
  def chunk_list
    :nest_only
  end
end

module HtmlFormat; parent.send :register_set_format, Card::Format::HtmlFormat, self; extend Card::Set::AbstractFormat
  HIDDEN_SKINS = %w[bootstrap_default_skin themeless_bootstrap_skin bootstrap_default_skin
                    classic_bootstrap_skin].freeze

  def default_item_view
    :bar
  end

  view :editor, template: :haml

  def themes
    card.rule_card(:options).item_cards
  end

  def selectable_themes
    themes.reject do |theme_card|
      theme_card.right&.codename == :stylesheets ||
        theme_card.key.in?(HIDDEN_SKINS)
    end
  end
end

event :customize_theme, :prepare_to_validate, on: :update, when: :customize_theme? do
  skin_name = free_skin_name
  add_subcard skin_name, type_id: CustomizedBootswatchSkinID
  self.content = "[[#{skin_name}]]"
end

def free_skin_name
  name = "#{@theme} skin customized"
  if Card.exist?(name)
    name = "#{name} 1"
    name.next! while Card.exist?(name)
  end
  name
end

def customize_theme?
  Env.params[:customize].present? && (@theme = Env.params[:theme]).present?
end
end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card/mod/settings/set/right/style.rb ~~

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
card-1.99.4 tmpsets/set/mod015-settings/right/style.rb
card-1.99.3 tmpsets/set/mod015-settings/right/style.rb
card-1.99.2 tmpsets/set/mod015-settings/right/style.rb
card-1.99.1 tmpsets/set/mod015-settings/right/style.rb
card-1.99.0 tmpsets/set/mod015-settings/right/style.rb
card-1.98.3 tmpsets/set/mod015-settings/right/style.rb
card-1.98.2 tmpsets/set/mod015-settings/right/style.rb
card-1.98.1 tmpsets/set/mod015-settings/right/style.rb
card-1.98.0 tmpsets/set/mod015-settings/right/style.rb