Sha256: a378a7861d6b9950d0f61c522368aa919a60ecb1b59e29b0cb7264b642f1bb9e

Contents?: true

Size: 1.57 KB

Versions: 16

Compression:

Stored size: 1.57 KB

Contents

# -*- encoding : utf-8 -*-

class BootstrapThemes < Card::CoreMigration
  def up
    Card.create! :name=>'themeless bootstrap skin', :type_code=>:skin, :content=> "[[style: bootstrap]]\n[[style: jquery-ui-smoothness]]\n[[style: cards]]\n[[style: right sidebar]]\n[[style: bootstrap cards]]"
    %w{cerulean cosmo cyborg darkly flatly journal lumen paper readable sandstone simplex slate spacelab superhero united yeti }.each do |theme|
      Card.create! :name=>"theme: #{theme}", :type_code=>:css, :codename=>"theme_#{theme}"
      Card.create! :name=>"#{theme} skin", :type_code=>:skin, :codename=>"#{theme}_skin", :content=>"[[themeless bootstrap skin]]\n[[theme: #{theme}]]"
    end
    
    if credit_card = Card['*credit']
      credit_card.codename = 'credit'
      credit_card.save!
    end
    
    style_right = Card[:style].fetch :trait=>:right, :new=>{}
    
    style_right_options = style_right.fetch :trait=>:options, :new=>{}
    style_right_options.content = %[{"type":"Skin","sort":"name"}]
    style_right_options.save!
    
    style_right_input = style_right.fetch :trait=>:input, :new=>{}
    style_right_input.content = 'radio'
    style_right_input.save!
    
    style_right_option_label = style_right.fetch :trait=>:options_label, :new=>{}
    style_right_option_label.content = 'Image'
    style_right_option_label.save!
    
    import_json 'skin_images.json'
    
    if sidebar_card = Card['*sidebar']
      new_content = sidebar_card.content.gsub( /(\*(logo|credit))\|content/, '\1|content_panel' )
      sidebar_card.update_attributes! :content => new_content
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
card-1.16.6 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.16.5 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.16.4 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.16.3 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.16.2 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.16.1 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.16.0 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.15.7 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.15.6 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.15.5 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.15.4 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.15.3 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.15.2 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.15.1 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.15.0 db/migrate_core_cards/20150317162412_bootstrap_themes.rb
card-1.15.pre2 db/migrate_core_cards/20150317162412_bootstrap_themes.rb