Skip to content

Commit

Permalink
Color model
Browse files Browse the repository at this point in the history
  • Loading branch information
Bramjetten committed Apr 30, 2015
1 parent 2cd4f0c commit 0dc4734
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
spina (0.6.19)
spina (0.6.20)
ancestry (~> 2.1, >= 2.1.0)
bcrypt-ruby (~> 3.1)
bourbon (~> 3.2, >= 3.2.1)
Expand Down Expand Up @@ -118,7 +118,7 @@ GEM
friendly_id (5.1.0)
activerecord (>= 4.0.0)
gem-release (0.7.3)
globalid (0.3.3)
globalid (0.3.5)
activesupport (>= 4.1.0)
haml (4.0.6)
tilt
Expand Down
7 changes: 7 additions & 0 deletions app/models/spina/color.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Spina
class Color < ActiveRecord::Base
has_many :page_parts, as: :page_partable
has_many :layout_parts, as: :layout_partable
has_many :structure_parts, as: :structure_partable
end
end
4 changes: 4 additions & 0 deletions app/views/spina/admin/layout_partables/_color_form.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
= color_form.fields_for :layout_partable, color_form.object.layout_partable do |form|
.colorpicker
= form.text_field :content, placeholder: color_form.object.title
.colorpicker-container
4 changes: 1 addition & 3 deletions app/views/spina/admin/layout_partables/_line_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
= line_form.fields_for :layout_partable, line_form.object.layout_partable do |form|
.colorpicker
= form.text_field :content, placeholder: line_form.object.title
.colorpicker-container
= form.text_field :content, placeholder: line_form.object.title
8 changes: 8 additions & 0 deletions db/migrate/20150430085527_create_spina_colors.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class CreateSpinaColors < ActiveRecord::Migration
def change
create_table :spina_colors do |t|
t.text :content
t.timestamps
end
end
end
7 changes: 0 additions & 7 deletions lib/spina/configurable.rb

This file was deleted.

20 changes: 10 additions & 10 deletions test/dummy/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ development:
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
# test:
# adapter: sqlite3
# database: db/test.sqlite3
# pool: 5
# timeout: 5000

production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
# production:
# adapter: sqlite3
# database: db/production.sqlite3
# pool: 5
# timeout: 5000
4 changes: 3 additions & 1 deletion test/dummy/config/initializers/spina.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

module Spina
module DefaultTheme
include Spina::Configurable
include ::ActiveSupport::Configurable

config_accessor :title, :page_parts, :view_templates, :layout_parts, :custom_pages, :plugins, :structures

self.title = "Default theme"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This migration comes from spina (originally 20140711154425)
class AddRobotsAllowedToSpinaAccounts < ActiveRecord::Migration
def change
add_column :spina_accounts, :robots_allowed, :boolean, default: false
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This migration comes from spina (originally 20140718095419)
class AddPositionToSpinaPhotoCollectionsPhotos < ActiveRecord::Migration
def change
add_column :spina_photo_collections_photos, :position, :integer
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This migration comes from spina (originally 20150430085527)
class CreateSpinaColors < ActiveRecord::Migration
def change
create_table :spina_colors do |t|
t.text :content
t.timestamps
end
end
end
8 changes: 7 additions & 1 deletion test/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150402144912) do
ActiveRecord::Schema.define(version: 20150430085616) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -48,6 +48,12 @@
t.datetime "updated_at", null: false
end

create_table "spina_colors", force: :cascade do |t|
t.text "content"
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "spina_inquiries", force: :cascade do |t|
t.string "name"
t.string "email"
Expand Down

0 comments on commit 0dc4734

Please sign in to comment.