spree_frontend 2.2.14 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45a47e06ecad7da2529ba2f5dbee81779980736c
4
- data.tar.gz: 4edd83021e93837988b9982c4bef8c2268702707
3
+ metadata.gz: 6a0e0eb8227ce2a40d9ebd174c8bbcfb5f9a30fd
4
+ data.tar.gz: eb1660bf01037e9c4b72bfa07dacfc0e28f827bb
5
5
  SHA512:
6
- metadata.gz: b9a35dd8fa96a88ce239ae9430eb6a3c7c30c6de34dfb1f7a93cafabb537eba96fb8ca6149291342d7cf9823dfdf8bf144f5c12f19a832910f21bcfaa860894d
7
- data.tar.gz: 98fe2639bfd81daf72c1c5415552fbabf67c1d284a7000947ac7259d6d286afdd5853b03af6cbee2f07841cf9f39cc9fb369f2b7a7f797de6cb427cdb9d7da42
6
+ metadata.gz: 35d1199abb1a692ce978b5c4d95bac60a688ca63f2ef318fefb72e59087d196917413e60cbe3db7989236b2962e3f54bc34752e1544fef155e4da021a0fed8cd
7
+ data.tar.gz: 87f5af64dd49d1e2e024dda96bbc24b3fa563db2134c33b935f31b5b4279cce3c9c62016b7fc8876b29a8ca3f9d44c85e60d9d11524de110a71f237cd6d90c12
@@ -10,6 +10,6 @@ Spree.ready ($) ->
10
10
 
11
11
  Spree.fetch_cart = ->
12
12
  $.ajax
13
- url: Spree.routes.cart_link,
13
+ url: Spree.pathFor("/cart_link"),
14
14
  success: (data) ->
15
15
  $('#link-to-cart').html data
@@ -1,3 +1,9 @@
1
+ //= depend_on_asset "fontawesome-webfont.eot"
2
+ //= depend_on_asset "fontawesome-webfont.woff"
3
+ //= depend_on_asset "fontawesome-webfont.ttf"
4
+ //= depend_on_asset "fontawesome-webfont.svg"
5
+ //= depend_on_asset "spree/frontend/cart.png"
6
+
1
7
  @import 'spree/frontend/variables';
2
8
  @import 'font-awesome';
3
9
 
@@ -6,9 +6,7 @@ module Spree
6
6
  class CheckoutController < Spree::StoreController
7
7
  ssl_required
8
8
 
9
- before_action :load_order_with_lock
10
- before_filter :ensure_valid_state_lock_version, only: [:update]
11
- before_filter :set_state_if_present
9
+ before_filter :load_order_with_lock
12
10
 
13
11
  before_filter :ensure_order_not_completed
14
12
  before_filter :ensure_checkout_allowed
@@ -27,7 +25,7 @@ module Spree
27
25
 
28
26
  # Updates the order and advances to the next state (when possible.)
29
27
  def update
30
- if @order.update_from_params(params, permitted_checkout_attributes)
28
+ if @order.update_from_params(params, permitted_checkout_attributes, request.headers.env)
31
29
  persist_user_address
32
30
  unless @order.next
33
31
  flash[:error] = @order.errors.full_messages.join("\n")
@@ -35,9 +33,9 @@ module Spree
35
33
  end
36
34
 
37
35
  if @order.completed?
38
- session[:order_id] = nil
36
+ @current_order = nil
39
37
  flash.notice = Spree.t(:order_processed_successfully)
40
- flash[:commerce_tracking] = "nothing special"
38
+ flash[:order_completed] = true
41
39
  redirect_to completion_route
42
40
  else
43
41
  redirect_to checkout_state_path(@order.state)
@@ -72,23 +70,9 @@ module Spree
72
70
  end
73
71
 
74
72
  def load_order_with_lock
75
- @order = current_order(lock: true)
73
+ @order = current_order(lock: true)
76
74
  redirect_to spree.cart_path and return unless @order
77
- end
78
-
79
- def ensure_valid_state_lock_version
80
- if params[:order] && params[:order][:state_lock_version]
81
- @order.with_lock do
82
- unless @order.state_lock_version == params[:order].delete(:state_lock_version).to_i
83
- flash[:error] = Spree.t(:order_already_updated)
84
- redirect_to checkout_state_path(@order.state) and return
85
- end
86
- @order.increment!(:state_lock_version)
87
- end
88
- end
89
- end
90
75
 
91
- def set_state_if_present
92
76
  if params[:state]
93
77
  redirect_to checkout_state_path(@order.state) if @order.can_go_to_state?(params[:state]) && !skip_state_validation?
94
78
  @order.state = params[:state]
@@ -160,7 +144,7 @@ module Spree
160
144
  end
161
145
 
162
146
  def check_authorization
163
- authorize!(:edit, current_order, session[:access_token])
147
+ authorize!(:edit, current_order, cookies.signed[:guest_token])
164
148
  end
165
149
 
166
150
  def persist_user_address
@@ -37,19 +37,23 @@ module Spree
37
37
  def edit
38
38
  @order = current_order || Order.new
39
39
  associate_user
40
+ if stale?(current_order)
41
+ respond_with(current_order)
42
+ end
40
43
  end
41
44
 
42
45
  # Adds a new item to the order (creating a new order if none already exists)
43
46
  def populate
44
47
  populator = Spree::OrderPopulator.new(current_order(create_order_if_necessary: true), current_currency)
45
-
46
48
  if populator.populate(params[:variant_id], params[:quantity])
49
+ current_order.ensure_updated_shipments
50
+
47
51
  respond_with(@order) do |format|
48
52
  format.html { redirect_to cart_path }
49
53
  end
50
54
  else
51
55
  flash[:error] = populator.errors.full_messages.join(" ")
52
- redirect_back_or_default(spree.root_path)
56
+ redirect_to :back
53
57
  end
54
58
  end
55
59
 
@@ -70,11 +74,11 @@ module Spree
70
74
  end
71
75
 
72
76
  def check_authorization
73
- session[:access_token] = params[:token] if params[:token]
77
+ cookies.permanent.signed[:guest_token] = params[:token] if params[:token]
74
78
  order = Spree::Order.find_by_number(params[:id]) || current_order
75
79
 
76
80
  if order
77
- authorize! :edit, order, session[:access_token]
81
+ authorize! :edit, order, cookies.signed[:guest_token]
78
82
  else
79
83
  authorize! :create, Spree::Order
80
84
  end
@@ -15,8 +15,6 @@ module Spree
15
15
  end
16
16
 
17
17
  def show
18
- return unless @product
19
-
20
18
  @variants = @product.variants_including_master.active(current_currency).includes([:option_values, :images])
21
19
  @product_properties = @product.product_properties.includes(:property)
22
20
  @taxon = Spree::Taxon.find(params[:taxon_id]) if params[:taxon_id]
@@ -5,14 +5,10 @@
5
5
  <% if @payment_sources.present? %>
6
6
  <div class="card_options">
7
7
  <%= radio_button_tag 'use_existing_card', 'yes', true %>
8
- <label for="use_existing_card_yes">
9
- <%= Spree.t(:use_existing_cc) %>
10
- </label>
8
+ <label for="use_existing_card_yes">Use an existing card on file</label>
11
9
  <br/>
12
10
  <%= radio_button_tag 'use_existing_card', 'no' %>
13
- <label for="use_existing_card_no">
14
- <%= Spree.t(:use_new_cc_or_payment_method) %>
15
- </label>
11
+ <label for="use_existing_card_no">Use a new card / payment method</label>
16
12
  </div>
17
13
 
18
14
  <div id="existing_cards">
@@ -29,7 +29,7 @@
29
29
 
30
30
  <% if order.checkout_steps.include?("delivery") && order.shipments.any? %>
31
31
  <tr data-hook="shipping_total">
32
- <td><%= Spree.t(:shipping_total) %>:</td>
32
+ <td><%= Spree.t(:shipping_total) %></td>
33
33
  <td><%= Spree::Money.new(order.shipments.to_a.sum(&:cost), currency: order.currency).to_html %></td>
34
34
  </tr>
35
35
 
@@ -37,7 +37,7 @@
37
37
  <tbody data-hook="order_details_shipment_promotion_adjustments">
38
38
  <% order.shipment_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
39
39
  <tr class="total">
40
- <td><%= label %>:</td>
40
+ <td><%= label %></td>
41
41
  <td><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %></td>
42
42
  </tr>
43
43
  <% end %>
@@ -50,7 +50,7 @@
50
50
  <% order.adjustments.eligible.each do |adjustment| %>
51
51
  <% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
52
52
  <tr class="total">
53
- <td><%= adjustment.label %>:</td>
53
+ <td><%= adjustment.label %>: </td>
54
54
  <td><%= adjustment.display_amount.to_html %></td>
55
55
  </tr>
56
56
  <% end %>
@@ -1,11 +1,11 @@
1
- <div id="checkout" data-hook>
1
+ <div id="checkout" data-hook>
2
2
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } %>
3
-
3
+
4
4
  <div class="row" data-hook="checkout_header">
5
5
  <h1 class="columns three alpha" data-hook="checkout_title"><%= Spree.t(:checkout) %></h1>
6
6
  <div class="columns thirteen omega" data-hook="checkout_progress"><%= checkout_progress %></div>
7
7
  </div>
8
-
8
+
9
9
  <div class="row" data-hook="checkout_content">
10
10
  <div class="columns <%= if @order.state != 'confirm' then 'alpha twelve' else 'alpha omega sixteen' end %>" data-hook="checkout_form_wrapper">
11
11
  <%= form_for @order, :url => update_checkout_path(@order.state), :html => { :id => "checkout_form_#{@order.state}" } do |form| %>
@@ -15,10 +15,9 @@
15
15
  <%= form.text_field :email %>
16
16
  </p>
17
17
  <% end %>
18
- <%= form.hidden_field :state_lock_version %>
19
18
  <%= render @order.state, :form => form %>
20
19
  <% end %>
21
- </div>
20
+ </div>
22
21
  <% if @order.state != 'confirm' %>
23
22
  <div id="checkout-summary" data-hook="checkout_summary_box" class="columns omega four">
24
23
  <%= render :partial => 'summary', :locals => { :order => @order } %>
@@ -29,7 +28,7 @@
29
28
 
30
29
  <script>
31
30
  Spree.current_order_id = "<%= @order.number %>"
32
- Spree.current_order_token = "<%= @order.token %>"
31
+ Spree.current_order_token = "<%= @order.guest_token %>"
33
32
  </script>
34
33
 
35
34
  <% if I18n.locale != :en %>
@@ -33,8 +33,5 @@
33
33
  </div>
34
34
 
35
35
  <%= render :partial => 'spree/shared/google_analytics' %>
36
- <script>
37
- Spree.api_key = <%= raw(try_spree_current_user.try(:spree_api_key).to_s.inspect) %>;
38
- </script>
39
36
  </body>
40
37
  </html>
@@ -3,7 +3,7 @@
3
3
  <h1><%= accurate_title %></h1>
4
4
 
5
5
  <div id="order" data-hook>
6
- <% if params.has_key? :checkout_complete %>
6
+ <% if order_just_completed?(@order) %>
7
7
  <h1><%= Spree.t(:thank_you_for_your_order) %></h1>
8
8
  <% end %>
9
9
  <%= render :partial => 'spree/shared/order_details', :locals => { :order => @order } %>
@@ -12,7 +12,7 @@
12
12
 
13
13
  <p data-hook="links">
14
14
  <%= link_to Spree.t(:back_to_store), spree.root_path, :class => "button" %>
15
- <% unless params.has_key? :checkout_complete %>
15
+ <% unless order_just_completed?(@order) %>
16
16
  <% if try_spree_current_user && respond_to?(:spree_account_path) %>
17
17
  <%= link_to Spree.t(:my_account), spree_account_path, :class => "button" %>
18
18
  <% end %>
@@ -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 "variant_id", variant.id, index == 0, 'data-price' => variant.price_in(current_currency).money %>
10
+ <%= radio_button_tag "variant_id", variant.id, index == 0, 'data-price' => Spree::Money.new(variant.price, currency: current_currency, with_currency: true).to_s %>
11
11
  <%= label_tag "variant_id_#{ variant.id }" do %>
12
12
  <span class="variant-description">
13
13
  <%= variant_options variant %>
@@ -22,8 +22,6 @@
22
22
  <% else %>
23
23
 
24
24
  <div data-hook="homepage_products">
25
- <% cache(cache_key_for_products) do %>
26
- <%= render :partial => 'spree/shared/products', :locals => { :products => @products, :taxon => @taxon } %>
27
- <% end %>
25
+ <%= render :partial => 'spree/shared/products', :locals => { :products => @products, :taxon => @taxon } %>
28
26
  </div>
29
27
  <% end %>
@@ -5,19 +5,18 @@
5
5
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6
6
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
7
7
 
8
- ga('create', '<%= tracker.analytics_id %>','<%= Spree::Config[:site_url].sub!(/(^www.)?/,'') %>');
9
- ga('require', 'displayfeatures');
8
+ ga('create', '<%= tracker.analytics_id %>','<%= current_store.url.sub(/(^www.)?/,'') %>');
10
9
  ga('send', 'pageview');
11
10
 
12
- <% if flash[:commerce_tracking] && @order.present? %>
11
+ <% if order_just_completed?(@order) %>
13
12
  <%# more info: https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce %>
14
13
  ga('require', 'ecommerce', 'ecommerce.js');
15
14
  ga('ecommerce:addTransaction', {
16
15
  'id': '<%= j @order.number %>', // Transaction ID. Required.
17
- 'affiliation': '<%= Spree::Config[:site_name] %>', // Affiliation or store name.
16
+ 'affiliation': '<%= current_store.name %>', // Affiliation or store name.
18
17
  'revenue': '<%= @order.total %>', // Grand Total.
19
18
  'shipping': '<%= @order.ship_total %>', // Shipping.
20
- 'tax': '<%= @order.additional_tax_total + @order.included_tax_total %>', // Tax.
19
+ 'tax': '<%= @order.tax_total %>', // Tax.
21
20
  'currency': '<%= current_currency %>' // local currency code.
22
21
  });
23
22
  <% @order.line_items.each do |line_item| %>
@@ -3,7 +3,7 @@
3
3
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
4
4
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1" name="viewport">
5
5
  <%== meta_data_tags %>
6
- <%= canonical_tag(Spree::Config.site_url) %>
6
+ <%= canonical_tag(current_store.url) %>
7
7
  <%= favicon_link_tag image_path('favicon.ico') %>
8
8
  <%= stylesheet_link_tag 'spree/frontend/all', :media => 'screen' %>
9
9
  <%= csrf_meta_tags %>
@@ -11,6 +11,4 @@
11
11
  <!--[if lt IE 9]>
12
12
  <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6/html5shiv.min.js"></script>
13
13
  <![endif]-->
14
- <%= render "spree/shared/routes" %>
15
- <%= render "spree/shared/frontend_routes" %>
16
14
  <%= yield :head %>
@@ -1,4 +1,4 @@
1
1
  <div class="taxon" data-hook="taxon">
2
- <h5 class="subtaxon-title"><%= link_to taxon.name, seo_url(taxon), :class => 'breadcrumbs' %></h5>
3
- <%= render :partial => 'spree/shared/products', :locals => { :products => taxon_preview(taxon), :taxon => taxon } %>
2
+ <h5 class="subtaxon-title"><%= link_to taxon.name, seo_url(taxon), class: 'breadcrumbs' %></h5>
3
+ <%= render partial: 'spree/shared/products', locals: { products: taxon_preview(taxon), taxon: taxon } %>
4
4
  </div>
@@ -2,19 +2,19 @@
2
2
 
3
3
  <% content_for :sidebar do %>
4
4
  <div data-hook="taxon_sidebar_navigation">
5
- <%= render :partial => 'spree/shared/taxonomies' %>
6
- <%= render :partial => 'spree/shared/filters' if @taxon.children.empty? %>
5
+ <%= render partial: 'spree/shared/taxonomies' %>
6
+ <%= render partial: 'spree/shared/filters' if @taxon.children.empty? %>
7
7
  </div>
8
8
  <% end %>
9
9
 
10
10
  <div data-hook="taxon_products">
11
- <%= render :partial => 'spree/shared/products', :locals => { :products => @products, :taxon => @taxon } %>
11
+ <%= render partial: 'spree/shared/products', locals: { products: @products, taxon: @taxon } %>
12
12
  </div>
13
13
 
14
- <% unless params[:keywords].present? %>
15
- <div data-hook="taxon_children">
14
+ <% unless params[:keywords].present? %>
15
+ <div data-hook="taxon_children">
16
16
  <% cache [I18n.locale, @taxon] do %>
17
- <%= render :partial => 'taxon', :collection => @taxon.children %>
17
+ <%= render partial: 'taxon', collection: @taxon.children %>
18
18
  <% end %>
19
- </div>
19
+ </div>
20
20
  <% end %>
@@ -19,7 +19,7 @@ Spree::Core::Engine.add_routes do
19
19
  get '/orders/populate', :to => populate_redirect
20
20
  get '/orders/:id/token/:token' => 'orders#show', :as => :token_order
21
21
 
22
- resources :orders, :except => [:new, :create, :destroy] do
22
+ resources :orders, :except => [:index, :new, :create, :destroy] do
23
23
  post :populate, :on => :collection
24
24
  end
25
25
 
@@ -1,15 +1,10 @@
1
1
  require 'rails/all'
2
- require 'rails/generators'
3
2
  require 'jquery-rails'
4
3
  require 'canonical-rails'
5
4
  require 'deface'
6
5
 
7
6
  require 'spree/core'
8
7
 
9
- require 'spree/core/mail_settings'
10
- require 'spree/core/mail_interceptor'
11
-
12
8
  require 'spree/responder'
13
9
  require 'spree/frontend/middleware/seo_assist'
14
-
15
10
  require 'spree/frontend/engine'
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Translated default messages for the jQuery validation plugin.
3
+ * Locale: KO (Korean; 한국어)
4
+ */
5
+ (function ($) {
6
+ $.extend($.validator.messages, {
7
+ required: "필수 항목입니다.",
8
+ remote: "항목을 수정하세요.",
9
+ email: "유효하지 않은 E-Mail주소입니다.",
10
+ url: "유효하지 않은 URL입니다.",
11
+ date: "올바른 날짜를 입력하세요.",
12
+ dateISO: "올바른 날짜(ISO)를 입력하세요.",
13
+ number: "유효한 숫자가 아닙니다.",
14
+ digits: "숫자만 입력 가능합니다.",
15
+ creditcard: "신용카드 번호가 바르지 않습니다.",
16
+ equalTo: "같은 값을 다시 입력하세요.",
17
+ extension: "올바른 확장자가 아닙니다.",
18
+ maxlength: $.validator.format("{0}자를 넘을 수 없습니다. "),
19
+ minlength: $.validator.format("{0}자 이상 입력하세요."),
20
+ rangelength: $.validator.format("문자 길이가 {0} 에서 {1} 사이의 값을 입력하세요."),
21
+ range: $.validator.format("{0} 에서 {1} 사이의 값을 입력하세요."),
22
+ max: $.validator.format("{0} 이하의 값을 입력하세요."),
23
+ min: $.validator.format("{0} 이상의 값을 입력하세요.")
24
+ });
25
+ }(jQuery));
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.2.14
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-19 00:00:00.000000000 Z
11
+ date: 2014-06-30 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.2.14
19
+ version: 2.3.0
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.2.14
26
+ version: 2.3.0
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.2.14
33
+ version: 2.3.0
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.2.14
40
+ version: 2.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.1.2
61
+ version: 3.1.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.1.2
68
+ version: 3.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: stringex
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -195,7 +195,6 @@ files:
195
195
  - app/views/spree/shared/_address.html.erb
196
196
  - app/views/spree/shared/_filters.html.erb
197
197
  - app/views/spree/shared/_footer.html.erb
198
- - app/views/spree/shared/_frontend_routes.html.erb
199
198
  - app/views/spree/shared/_google_analytics.html.erb
200
199
  - app/views/spree/shared/_head.html.erb
201
200
  - app/views/spree/shared/_header.html.erb
@@ -496,6 +495,7 @@ files:
496
495
  - vendor/assets/javascripts/jquery.validate/localization/messages_it.js
497
496
  - vendor/assets/javascripts/jquery.validate/localization/messages_ja.js
498
497
  - vendor/assets/javascripts/jquery.validate/localization/messages_kk.js
498
+ - vendor/assets/javascripts/jquery.validate/localization/messages_ko.js
499
499
  - vendor/assets/javascripts/jquery.validate/localization/messages_lt.js
500
500
  - vendor/assets/javascripts/jquery.validate/localization/messages_lv.js
501
501
  - vendor/assets/javascripts/jquery.validate/localization/messages_nl.js
@@ -538,7 +538,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
538
538
  requirements:
539
539
  - none
540
540
  rubyforge_project: spree_frontend
541
- rubygems_version: 2.4.5
541
+ rubygems_version: 2.2.2
542
542
  signing_key:
543
543
  specification_version: 4
544
544
  summary: Frontend e-commerce functionality for the Spree project.
@@ -1,3 +0,0 @@
1
- <script>
2
- Spree.routes.cart_link = "<%= spree.cart_link_url %>"
3
- </script>