spree_frontend 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/store/screen.css.scss +2 -2
- data/app/controllers/spree/checkout_controller.rb +2 -1
- data/app/controllers/spree/products_controller.rb +1 -1
- data/app/views/spree/checkout/_address.html.erb +1 -1
- data/app/views/spree/checkout/edit.html.erb +4 -0
- data/app/views/spree/orders/_line_item.html.erb +2 -2
- data/app/views/spree/products/_cart_form.html.erb +2 -2
- data/app/views/spree/shared/_address.html.erb +38 -0
- data/app/views/spree/shared/_search.html.erb +1 -1
- data/config/routes.rb +3 -3
- metadata +21 -9
- data/app/views/spree/orders/new.html.erb +0 -9
- data/lib/spree/frontend/preference_rescue.rb +0 -25
- data/lib/spree/scopes/dynamic.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cc8304b9d613d8ac92155be33ef9f3656443781
|
4
|
+
data.tar.gz: 542d5ea4ecbf53168bc734acf2319d4ac5ed989f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aab462d12ddf9698f2ba2ff389f0a6c3adf7db7b6d6e763b102beb10fd39d2c94bd33a615f95ec4c4dfb70f636b5af70aea84f6df5f190b6a1cc913027fe335e
|
7
|
+
data.tar.gz: bbdc254c624afeced6c80ff56e92b9936d1b3c3ac0625918722af4374008f218a49f47da8e547e88c74e5dc810e528387f4428996d6d8ecc4b5f40751571bddf
|
@@ -118,7 +118,7 @@ input[type="week"] {
|
|
118
118
|
font-size: $input_box_font_size;
|
119
119
|
|
120
120
|
&:active, &:focus {
|
121
|
-
border-color: $link_text_color
|
121
|
+
border-color: $link_text_color;
|
122
122
|
outline: none;
|
123
123
|
-webkit-box-shadow: none;
|
124
124
|
-moz-box-shadow: none;
|
@@ -300,7 +300,7 @@ nav #main-nav-bar {
|
|
300
300
|
&#link-to-cart {
|
301
301
|
float: right;
|
302
302
|
padding-left: 24px;
|
303
|
-
background: url("cart.png") no-repeat left center;
|
303
|
+
background: asset-url("store/cart.png") no-repeat left center;
|
304
304
|
|
305
305
|
&:hover {
|
306
306
|
border-color: $link_text_color;
|
@@ -151,8 +151,9 @@ module Spree
|
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
|
-
def rescue_from_spree_gateway_error
|
154
|
+
def rescue_from_spree_gateway_error(exception)
|
155
155
|
flash[:error] = Spree.t(:spree_gateway_error_flash_for_checkout)
|
156
|
+
@order.errors.add(:base, exception.message)
|
156
157
|
render :edit
|
157
158
|
end
|
158
159
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<%= form.fields_for :ship_address do |ship_form| %>
|
13
13
|
<legend align="center"><%= Spree.t(:shipping_address) %></legend>
|
14
14
|
<p class="field checkbox" data-hook="use_billing">
|
15
|
-
<%= check_box_tag 'order[use_billing]', '1',
|
15
|
+
<%= check_box_tag 'order[use_billing]', '1', @order.shipping_eq_billing_address? %>
|
16
16
|
<%= label_tag :order_use_billing, Spree.t(:use_billing_address), :id => 'use_billing' %>
|
17
17
|
</p>
|
18
18
|
<%= render :partial => 'spree/address/form', :locals => { :form => ship_form, :address_type => 'shipping', :address => @order.ship_address } %>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<% end %>
|
10
10
|
</td>
|
11
11
|
<td class="cart-item-description" data-hook="cart_item_description">
|
12
|
-
<h4><%= link_to
|
12
|
+
<h4><%= link_to line_item.name, product_path(variant.product) %></h4>
|
13
13
|
<%= variant.options_text %>
|
14
14
|
<% if @order.insufficient_stock_lines.include? line_item %>
|
15
15
|
<span class="out-of-stock">
|
@@ -17,7 +17,7 @@
|
|
17
17
|
</span>
|
18
18
|
<% end %>
|
19
19
|
<span class="line-item-description" data-hook="line_item_description">
|
20
|
-
<%=
|
20
|
+
<%= line_item_description_text(line_item.description) %>
|
21
21
|
</span>
|
22
22
|
</td>
|
23
23
|
<td class="cart-item-price" data-hook="cart_item_price">
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<ul>
|
8
8
|
<% @product.variants_and_option_values(current_currency).each_with_index do |variant, index| %>
|
9
9
|
<li>
|
10
|
-
<%= radio_button_tag "products[#{@product.id}]", variant.id, index == 0, 'data-price' => variant
|
10
|
+
<%= radio_button_tag "products[#{@product.id}]", variant.id, index == 0, 'data-price' => display_price(variant) %>
|
11
11
|
<label for="<%= ['products', @product.id, variant.id].join('_') %>">
|
12
12
|
<span class="variant-description">
|
13
13
|
<%= variant_options variant %>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<h6 class="product-section-title"><%= Spree.t(:price) %></h6>
|
30
30
|
<div>
|
31
31
|
<span class="price selling" itemprop="price">
|
32
|
-
<%= display_price(@product
|
32
|
+
<%= display_price(@product) %>
|
33
33
|
</span>
|
34
34
|
<span itemprop="priceCurrency" content="<%= @product.currency %>"></span>
|
35
35
|
</div>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div class="address vcard">
|
2
|
+
<div class="fn"><%= address.full_name %></div>
|
3
|
+
<% unless address.company.blank? %>
|
4
|
+
<div class="org">
|
5
|
+
<%= address.company %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
8
|
+
<div class="adr">
|
9
|
+
<div class="street-address">
|
10
|
+
<div class="street-address-line">
|
11
|
+
<%= address.address1 %>
|
12
|
+
</div>
|
13
|
+
<% unless address.address2.blank? %>
|
14
|
+
<div class="street-address-line">
|
15
|
+
<%= address.address2 %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
<div class="local">
|
20
|
+
<span class="locality"><%= address.city %></span>
|
21
|
+
<span class="region"><%= address.state_text %></span>
|
22
|
+
<span class="postal-code"><%= address.zipcode %></span>
|
23
|
+
<div class="country-name"><%= address.country.try(:name) %></div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<% unless address.phone.blank? %>
|
27
|
+
<div class="tel">
|
28
|
+
<span class="type"><%= Spree.t(:phone) %></span>
|
29
|
+
<%= address.phone %>
|
30
|
+
</div>
|
31
|
+
<% end %>
|
32
|
+
<% unless address.alternative_phone.blank? %>
|
33
|
+
<div class="alternative-phone tel">
|
34
|
+
<span class="type"><%= Spree.t(:alternative_phone) %></span>
|
35
|
+
<%= address.alternative_phone %>
|
36
|
+
</div>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<%= select_tag :taxon,
|
4
4
|
options_for_select([[Spree.t(:all_departments), '']] +
|
5
5
|
@taxons.map {|t| [t.name, t.id]},
|
6
|
-
|
6
|
+
@taxon ? @taxon.id : params[:taxon]), 'aria-label' => 'Taxon' %>
|
7
7
|
<%= search_field_tag :keywords, params[:keywords], :placeholder => Spree.t(:search) %>
|
8
8
|
<%= submit_tag Spree.t(:search), :name => nil %>
|
9
9
|
<% end %>
|
data/config/routes.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Spree::Core::Engine.
|
1
|
+
Spree::Core::Engine.add_routes do
|
2
2
|
|
3
3
|
root :to => 'home#index'
|
4
4
|
|
@@ -16,10 +16,10 @@ Spree::Core::Engine.routes.draw do
|
|
16
16
|
request.referer || '/cart'
|
17
17
|
end
|
18
18
|
|
19
|
-
get '/orders/populate', :
|
19
|
+
get '/orders/populate', :to => populate_redirect
|
20
20
|
get '/orders/:id/token/:token' => 'orders#show', :as => :token_order
|
21
21
|
|
22
|
-
resources :orders do
|
22
|
+
resources :orders, :except => [:new, :create] do
|
23
23
|
post :populate, :on => :collection
|
24
24
|
end
|
25
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_frontend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.1.
|
19
|
+
version: 2.1.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.1.
|
26
|
+
version: 2.1.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.1.
|
33
|
+
version: 2.1.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.1.
|
40
|
+
version: 2.1.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: canonical-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.2.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: capybara-accessible
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Required dependency for Spree
|
98
112
|
email: sean@spreecommerce.com
|
99
113
|
executables: []
|
@@ -165,7 +179,6 @@ files:
|
|
165
179
|
- app/views/spree/orders/_form.html.erb
|
166
180
|
- app/views/spree/orders/_line_item.html.erb
|
167
181
|
- app/views/spree/orders/edit.html.erb
|
168
|
-
- app/views/spree/orders/new.html.erb
|
169
182
|
- app/views/spree/orders/show.html.erb
|
170
183
|
- app/views/spree/products/_cart_form.html.erb
|
171
184
|
- app/views/spree/products/_image.html.erb
|
@@ -175,6 +188,7 @@ files:
|
|
175
188
|
- app/views/spree/products/_thumbnails.html.erb
|
176
189
|
- app/views/spree/products/index.html.erb
|
177
190
|
- app/views/spree/products/show.html.erb
|
191
|
+
- app/views/spree/shared/_address.html.erb
|
178
192
|
- app/views/spree/shared/_filters.html.erb
|
179
193
|
- app/views/spree/shared/_footer.html.erb
|
180
194
|
- app/views/spree/shared/_google_analytics.html.erb
|
@@ -199,9 +213,7 @@ files:
|
|
199
213
|
- config/routes.rb
|
200
214
|
- lib/spree/frontend/engine.rb
|
201
215
|
- lib/spree/frontend/middleware/seo_assist.rb
|
202
|
-
- lib/spree/frontend/preference_rescue.rb
|
203
216
|
- lib/spree/frontend.rb
|
204
|
-
- lib/spree/scopes/dynamic.rb
|
205
217
|
- lib/spree_frontend.rb
|
206
218
|
- lib/tasks/rake_util.rb
|
207
219
|
- lib/tasks/taxon.rake
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<% @body_id = 'cart' %>
|
2
|
-
|
3
|
-
<h1><%= Spree.t(:shopping_cart) %></h1>
|
4
|
-
|
5
|
-
<%= form_for @order, :url =>'#', :method => :put do |order_form| %>
|
6
|
-
<%= render :partial => 'form', :locals => { :order_form => order_form } %>
|
7
|
-
<% end %>
|
8
|
-
|
9
|
-
<p><%= link_to Spree.t(:continue_shopping), products_path %></p>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class OldPrefs < ActiveRecord::Base
|
3
|
-
self.table_name = "spree_preferences"
|
4
|
-
belongs_to :owner, :polymorphic => true
|
5
|
-
attr_accessor :owner_klass
|
6
|
-
end
|
7
|
-
|
8
|
-
class PreferenceRescue
|
9
|
-
def self.try
|
10
|
-
OldPrefs.where(:key => nil).each do |old_pref|
|
11
|
-
next unless owner = (old_pref.owner rescue nil)
|
12
|
-
unless old_pref.owner_type == "Spree::Activator" || old_pref.owner_type == "Spree::Configuration"
|
13
|
-
begin
|
14
|
-
old_pref.key = [owner.class.name, old_pref.name, owner.id].join('::').underscore
|
15
|
-
old_pref.value_type = owner.preference_type(old_pref.name)
|
16
|
-
puts "Migrating Preference: #{old_pref.key}"
|
17
|
-
old_pref.save
|
18
|
-
rescue NoMethodError => ex
|
19
|
-
puts ex.message
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/lib/spree/scopes/dynamic.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
module Scopes
|
3
|
-
# This module is extended by ProductScope
|
4
|
-
module Dynamic
|
5
|
-
module_function
|
6
|
-
|
7
|
-
# Sample dynamic scope generating from set of products
|
8
|
-
# generates 0 or (2..scope_limit) scopes for prices, based
|
9
|
-
# on number of products (uses Math.log, to guess number of scopes)
|
10
|
-
def price_scopes_for(products, scope_limit=5)
|
11
|
-
scopes = []
|
12
|
-
|
13
|
-
# Price based scopes
|
14
|
-
all_prices = products.map(&:price).sort
|
15
|
-
|
16
|
-
ranges = [Math.log(products.length).floor, scope_limit].max
|
17
|
-
|
18
|
-
if ranges >= 2
|
19
|
-
l = all_prices.length / ranges
|
20
|
-
scopes << ProductScope.new({:name => "master_price_lte", :arguments => [all_prices[l]] })
|
21
|
-
|
22
|
-
(ranges - 2).times do |x|
|
23
|
-
scopes << ProductScope.new({:name => "price_between",
|
24
|
-
:arguments => [ all_prices[l*(x+1)+1], all_prices[l*(x+2)] ] })
|
25
|
-
end
|
26
|
-
scopes << ProductScope.new({:name => "master_price_gte", :arguments => [all_prices[l*(ranges-1)+1]] })
|
27
|
-
end
|
28
|
-
|
29
|
-
scopes
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|