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.
@@ -1,3 +1,3 @@
1
1
  /*
2
2
  *= require admin/spree_core
3
- */
3
+ */
@@ -3,6 +3,15 @@
3
3
  *= require store/spree_core
4
4
  */
5
5
 
6
+ .feature a span {
7
+ height: 100%;
8
+ width: 100%;
9
+ left: 0;
10
+ top: 0;
11
+ position: absolute;
12
+ z-index: 1;
13
+ }
14
+
6
15
  .flexslider .hero, .section-header .hero {
7
16
  max-height: 200px;
8
17
  overflow: hidden;
@@ -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.image %>
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>
@@ -0,0 +1,6 @@
1
+ class AddProductIdToHomePageFeatures < ActiveRecord::Migration
2
+ def change
3
+ add_column :home_page_features, :product_id, :integer
4
+ add_index :home_page_features, :product_id
5
+ end
6
+ end
@@ -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.4'
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
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-19 00:00:00.000000000 Z
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