1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Remove custom colour field and use gem

This commit is contained in:
Daniel Barber 2016-04-21 11:35:12 +01:00
parent 615e8cd4c8
commit 19c86a9493
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
7 changed files with 6 additions and 18 deletions

View File

@ -54,6 +54,7 @@ end
gem 'administrate'
gem 'administrate-field-image'
gem 'administrate-field-color'
gem 'dragonfly'
gem 'dragonfly-s3_data_store'
gem 'kaminari'

View File

@ -48,6 +48,9 @@ GEM
rails (~> 4.2)
sass-rails (~> 5.0)
selectize-rails (~> 0.6)
administrate-field-color (0.0.1)
administrate (>= 0.2.0.rc1, < 0.3.0)
rails (~> 4.2)
administrate-field-image (0.0.2)
administrate (>= 0.2.0.rc1, < 0.3.0)
rails (~> 4.2)
@ -319,6 +322,7 @@ PLATFORMS
DEPENDENCIES
administrate
administrate-field-color
administrate-field-image
aws-sdk
better_errors

View File

@ -15,7 +15,7 @@ class CategoryDashboard < Administrate::BaseDashboard
created_at: Field::DateTime,
updated_at: Field::DateTime,
photo_id: Field::Number,
base_colour: ColourField,
base_colour: Field::Color,
sort: Field::Number,
slug: Field::String,
}

View File

@ -1,7 +0,0 @@
require "administrate/field/base"
class ColourField < Administrate::Field::Base
def to_s
data
end
end

View File

@ -1,6 +0,0 @@
<div class="field-unit__label">
<%= f.label field.attribute %>
</div>
<div class="field-unit__field">
<%= f.color_field field.attribute, style: 'height: 2.35em; width: 5em;' %>
</div>

View File

@ -1,2 +0,0 @@
<%= content_tag :div, nil,
style: "height: 1.5em; width: 1.5em; background-color: #{field.data}" %>

View File

@ -1,2 +0,0 @@
<%= content_tag :span, field.data,
style: "color: white; padding: 0.2em 0.5em; background-color: #{field.data}" %>