spree_home_page_features 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/stylesheets/admin/spree_home_page_features.css +1 -1
- data/app/assets/stylesheets/store/spree_home_page_features.css +9 -0
- data/app/models/spree/home_page_feature.rb +3 -1
- data/app/views/spree/admin/home_page_features/_form.erb +4 -0
- data/app/views/spree/home_page_features/_features.erb +4 -1
- data/db/migrate/20121029085328_add_product_id_to_home_page_features.rb +6 -0
- data/spree_home_page_features.gemspec +1 -1
- metadata +3 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
module Spree
|
2
2
|
class HomePageFeature < ActiveRecord::Base
|
3
3
|
self.table_name = 'home_page_features'
|
4
|
-
attr_accessible :title, :body, :publish, :style, :image,
|
4
|
+
attr_accessible :title, :body, :publish, :style, :image, :product_id,
|
5
5
|
:image_file_name, :image_file_size, :image_content_type, :image_updated_at
|
6
6
|
|
7
7
|
validates :title,
|
@@ -19,6 +19,8 @@ module Spree
|
|
19
19
|
:url => '/spree/home_page_features/:id/:style/:basename.:extension',
|
20
20
|
:path => ':rails_root/public/spree/home_page_features/:id/:style/:basename.:extension'
|
21
21
|
|
22
|
+
belongs_to :product
|
23
|
+
|
22
24
|
if Spree::Config[:use_s3]
|
23
25
|
s3_creds = { :access_key_id => Spree::Config[:s3_access_key], :secret_access_key => Spree::Config[:s3_secret], :bucket => Spree::Config[:s3_bucket] }
|
24
26
|
Spree::HomePageFeature.attachment_definitions[:image][:storage] = :s3
|
@@ -20,3 +20,7 @@
|
|
20
20
|
<%= f.label :publish, t(:published, :scope => scope) %><br />
|
21
21
|
<%= f.check_box :publish %>
|
22
22
|
<% end %>
|
23
|
+
<%= f.field_container :product_id do %>
|
24
|
+
<%= f.label :product_id, t(:product, :scope => scope) %><br />
|
25
|
+
<%= f.select :product_id, Spree::Product.active.order(:name).map {|p| [p.name, p.id]}, include_blank: 'None' %><br />
|
26
|
+
<% end %>
|
@@ -2,7 +2,10 @@
|
|
2
2
|
<ul class="slides">
|
3
3
|
<% Spree::HomePageFeature.published.each do |feature| %>
|
4
4
|
<li class="feature <%= feature.style? ? feature.style : "" %>">
|
5
|
-
<% if feature.
|
5
|
+
<% if feature.product %>
|
6
|
+
<%= link_to tag(:span), spree.product_path(feature.product) %>
|
7
|
+
<% end %>
|
8
|
+
<% if feature.image_file_name.present? %>
|
6
9
|
<div class="feture-image-container">
|
7
10
|
<%= image_tag feature.image.url %>
|
8
11
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_home_page_features'
|
5
|
-
s.version = '1.2.
|
5
|
+
s.version = '1.2.5'
|
6
6
|
s.summary = 'Adds feature articles to the spree home page'
|
7
7
|
s.description = 'Allows you to edit articles in the spree admin, which will be displayed on your homepage'
|
8
8
|
s.required_ruby_version = '>= 1.9.2'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_home_page_features
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree_core
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- config/routes.rb
|
142
142
|
- db/migrate/20120711073050_create_home_page_features.rb
|
143
143
|
- db/migrate/20121015104853_add_image_to_home_page_features.rb
|
144
|
+
- db/migrate/20121029085328_add_product_id_to_home_page_features.rb
|
144
145
|
- lib/assets/images/bg_direction_nav.png
|
145
146
|
- lib/assets/javascripts/jquery.flexslider-min.js
|
146
147
|
- lib/assets/stylesheets/flexslider.css
|