spree_frontend 2.2.0 → 2.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29db93da707c1bbb9a6ef087863995df92f50c94
4
- data.tar.gz: aba8daaa326750b739f5166436c7dc176612b931
3
+ metadata.gz: 324c220d9617fdc461f82e3cede3bac0b15752e2
4
+ data.tar.gz: bfb16a3f7d738f19c479c7cc5b8ff2e9736a467c
5
5
  SHA512:
6
- metadata.gz: b58abca47b3506fe2dfee3c2d96e79c3adb1fd2e5d5b3d5dc3cfc974a0170f1ff6c5e0afaa5cea35175dd174adea1036f1ae5fb26a22e7993953a7d717d97fe8
7
- data.tar.gz: 447914326a17b8c14bfa48a7a6f276913e240f0c21516e4ff3d1fc37920c4bc60a87b9263c2f0eb9cdc221f6c6cbb3f51d99694b3a81e2da0efae6ea239c1ab4
6
+ metadata.gz: 830944c66cfb9b62eb549dd867672554c661249ec9f7397fdcf196e00fedde7a99ac5827f84834d762f79f163434ef2b72f054c3e8b2399628af713353e8e178
7
+ data.tar.gz: 6681b60cd36573cac6937b77fc0702c36a3b6dbee767993a65028d3b68b96c35e0c67f093323de73cb1ce59517a98998ec878a56d335a150a1725d8f368dbfd6
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007-2013, Spree Commerce, Inc. and other contributors
1
+ Copyright (c) 2007-2014, Spree Commerce, Inc. and other contributors
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -1,6 +1,21 @@
1
1
  Spree.onPayment = () ->
2
2
  if ($ '#checkout_form_payment').is('*')
3
3
 
4
+ if ($ '#existing_cards').is('*')
5
+ ($ '#payment-method-fields').hide()
6
+ ($ '#payment-methods').hide()
7
+
8
+ ($ '#use_existing_card_yes').click ->
9
+ ($ '#payment-method-fields').hide()
10
+ ($ '#payment-methods').hide()
11
+ ($ '.existing-cc-radio').prop("disabled", false)
12
+
13
+ ($ '#use_existing_card_no').click ->
14
+ ($ '#payment-method-fields').show()
15
+ ($ '#payment-methods').show()
16
+ ($ '.existing-cc-radio').prop("disabled", true)
17
+
18
+
4
19
  $(".cardNumber").payment('formatCardNumber')
5
20
  $(".cardExpiry").payment('formatCardExpiry')
6
21
  $(".cardCode").payment('formatCardCVC')
@@ -131,6 +131,10 @@ module Spree
131
131
  @order.contents.remove(variant, quantity)
132
132
  end
133
133
  end
134
+
135
+ if try_spree_current_user && try_spree_current_user.respond_to?(:payment_sources)
136
+ @payment_sources = try_spree_current_user.payment_sources
137
+ end
134
138
  end
135
139
 
136
140
  def rescue_from_spree_gateway_error(exception)
@@ -23,10 +23,11 @@
23
23
 
24
24
  <div class="form-buttons" data-hook="buttons">
25
25
  <%= submit_tag Spree.t(:save_and_continue), :class => 'continue button primary' %>
26
-
27
- <span data-hook="save_user_address">
28
- &nbsp; &nbsp;
29
- <%= check_box_tag 'save_user_address', '1', try_spree_current_user.respond_to?(:persist_order_address) %>
30
- <%= label_tag :save_user_address, Spree.t(:save_my_address) %>
31
- </span>
26
+ <% if try_spree_current_user %>
27
+ <span data-hook="save_user_address">
28
+ &nbsp; &nbsp;
29
+ <%= check_box_tag 'save_user_address', '1', try_spree_current_user.respond_to?(:persist_order_address) %>
30
+ <%= label_tag :save_user_address, Spree.t(:save_my_address) %>
31
+ </span>
32
+ <% end %>
32
33
  </div>
@@ -37,7 +37,7 @@
37
37
 
38
38
  <h5 class="stock-shipping-method-title"><%= Spree.t(:shipping_method) %></h5>
39
39
  <ul class="field radios shipping-methods">
40
- <% ship_form.object.shipping_rates.with_shipping_method.each do |rate| %>
40
+ <% ship_form.object.shipping_rates.each do |rate| %>
41
41
  <li class="shipping-method">
42
42
  <label>
43
43
  <%= ship_form.radio_button :selected_shipping_rate_id, rate.id %>
@@ -1,6 +1,37 @@
1
1
  <fieldset id="payment" data-hook>
2
2
  <legend align="center"><%= Spree.t(:payment_information) %></legend>
3
3
  <div data-hook="checkout_payment_step">
4
+
5
+ <% if @payment_sources.present? %>
6
+ <div class="card_options">
7
+ <%= radio_button_tag 'use_existing_card', 'yes', true %>
8
+ <label for="use_existing_card_yes">Use an existing card on file</label>
9
+ <br/>
10
+ <%= radio_button_tag 'use_existing_card', 'no' %>
11
+ <label for="use_existing_card_no">Use a new card / payment method</label>
12
+ </div>
13
+
14
+ <div id="existing_cards">
15
+ <p class="field" data-hook="existing_cards">
16
+ <table class="existing-credit-card-list">
17
+ <tbody>
18
+ <% @payment_sources.each do |card| %>
19
+ <tr id="<%= dom_id(card,'spree')%>" class="<%= cycle('even', 'odd') %>">
20
+ <td><%= card.name %></td>
21
+ <td><%= card.display_number %></td>
22
+ <td><%= card.month %></td>
23
+ <td><%= card.year %></td>
24
+ <td>
25
+ <%= radio_button_tag "existing_card", card.id, (card == @payment_sources.first), { class: "existing-cc-radio" } %>
26
+ </td>
27
+ </tr>
28
+ <% end %>
29
+ </tbody>
30
+ </table>
31
+ </p>
32
+ </div>
33
+ <% end %>
34
+
4
35
  <div id="payment-method-fields" data-hook>
5
36
  <% @order.available_payment_methods.each do |method| %>
6
37
  <p>
@@ -27,16 +27,22 @@
27
27
  <% end %>
28
28
  </tbody>
29
29
 
30
- <% if order.checkout_steps.include?("delivery") %>
30
+ <% if order.checkout_steps.include?("delivery") && order.shipments.any? %>
31
31
  <tr data-hook="shipping_total">
32
- <% if order.shipment_total > 0 %>
33
32
  <td><%= Spree.t(:shipping_total) %></td>
34
- <td><%= Spree::Money.new(order.shipment_total).to_html %></td>
35
- <% else %>
36
- <td><strong><%= Spree.t(:free_shipping) %></strong></td>
37
- <td><%= Spree.t(:free_shipping_amount) %></td>
38
- <% end %>
33
+ <td><%= Spree::Money.new(order.shipments.to_a.sum(&:cost)).to_html %></td>
39
34
  </tr>
35
+
36
+ <% if order.shipment_adjustments.exists? %>
37
+ <tbody data-hook="order_details_shipment_promotion_adjustments">
38
+ <% order.shipment_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
39
+ <tr class="total">
40
+ <td><%= label %></td>
41
+ <td><%= Spree::Money.new(adjustments.sum(&:amount)).to_html %></td>
42
+ </tr>
43
+ <% end %>
44
+ </tbody>
45
+ <% end %>
40
46
  <% end %>
41
47
 
42
48
  <% if order.adjustments.eligible.exists? %>
@@ -15,6 +15,10 @@
15
15
  <% if variant_price variant %>
16
16
  <span class="price diff"><%= variant_price variant %></span>
17
17
  <% end %>
18
+
19
+ <% unless variant.can_supply? %>
20
+ <span class="out-of-stock"><%= Spree.t(:out_of_stock) %></span>
21
+ <% end %>
18
22
  <% end %>
19
23
  </li>
20
24
  <% end%>
@@ -38,6 +42,9 @@
38
42
 
39
43
  <% if @product.master.can_supply? %>
40
44
  <link itemprop="availability" href="http://schema.org/InStock" />
45
+ <% else %>
46
+ <br />
47
+ <span class="out-of-stock"><%= Spree.t(:out_of_stock) %></span>
41
48
  <% end %>
42
49
  </div>
43
50
 
@@ -5,7 +5,7 @@
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 %>');
8
+ ga('create', '<%= tracker.analytics_id %>','<%= Spree::Config[:site_url].sub!(/^www./,'') %>');
9
9
  ga('send', 'pageview');
10
10
 
11
11
  <% if flash[:commerce_tracking] && @order.present? %>
@@ -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 %>
6
+ <%= canonical_tag(Spree::Config.site_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 %>
@@ -2,6 +2,11 @@
2
2
 
3
3
  <% if order.has_step?("address") %>
4
4
 
5
+ <div class="columns alpha four" data-hook="order-bill-address">
6
+ <h6><%= Spree.t(:billing_address) %> <%= link_to "(#{Spree.t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
7
+ <%= render :partial => 'spree/shared/address', :locals => { :address => order.bill_address } %>
8
+ </div>
9
+
5
10
  <% if order.has_step?("delivery") %>
6
11
  <div class="columns alpha four" data-hook="order-ship-address">
7
12
  <h6><%= Spree.t(:shipping_address) %> <%= link_to "(#{Spree.t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
@@ -9,11 +14,6 @@
9
14
  </div>
10
15
  <% end %>
11
16
 
12
- <div class="columns alpha four" data-hook="order-bill-address">
13
- <h6><%= Spree.t(:billing_address) %> <%= link_to "(#{Spree.t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
14
- <%= render :partial => 'spree/shared/address', :locals => { :address => order.bill_address } %>
15
- </div>
16
-
17
17
  <% if @order.has_step?("delivery") %>
18
18
  <div class="columns alpha four">
19
19
  <h6><%= Spree.t(:shipments) %> <%= link_to "(#{Spree.t(:edit)})", checkout_state_path(:delivery) unless @order.completed? %></h6>
@@ -1,8 +1,9 @@
1
+ <% max_level = Spree::Config[:max_level_in_taxons_menu] || 1 %>
1
2
  <nav id="taxonomies" class="sidebar-item" data-hook>
2
3
  <% @taxonomies.each do |taxonomy| %>
3
- <% cache taxonomy do %>
4
+ <% cache [taxonomy, max_level] do %>
4
5
  <h6 class='taxonomy-root'><%= Spree.t(:shop_by_taxonomy, :taxonomy => taxonomy.name) %></h6>
5
- <%= taxons_tree(taxonomy.root, @taxon, Spree::Config[:max_level_in_taxons_menu] || 1) %>
6
+ <%= taxons_tree(taxonomy.root, @taxon, max_level) %>
6
7
  <% end %>
7
8
  <% end %>
8
9
  </nav>
@@ -1,20 +1,15 @@
1
1
  CanonicalRails.setup do |config|
2
-
3
- # This is the main host, not just the TLD, omit slashes and protocol. If you have more than one, pick the one you want to rank in search results.
4
-
5
- config.host = Spree::Config[:site_url]
6
-
7
2
  # http://en.wikipedia.org/wiki/URL_normalization
8
3
  # Trailing slash represents semantics of a directory, ie a collection view - implying an :index get route;
9
4
  # otherwise we have to assume semantics of an instance of a resource type, a member view - implying a :show get route
10
5
  #
11
6
  # Acts as a whitelist for routes to have trailing slashes
12
-
7
+
13
8
  config.collection_actions# = [:index]
14
9
 
15
10
  # Parameter spamming can cause index dilution by creating seemingly different URLs with identical or near-identical content.
16
11
  # Unless whitelisted, these parameters will be omitted
17
-
18
- config.whitelisted_parameters# = []
19
-
12
+
13
+ config.whitelisted_parameters = [:keywords, :page, :search, :taxon]
14
+
20
15
  end
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.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-26 00:00:00.000000000 Z
11
+ date: 2014-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.0
19
+ version: 2.2.1
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.0
26
+ version: 2.2.1
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.0
33
+ version: 2.2.1
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.0
40
+ version: 2.2.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.0.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 0.0.4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: jquery-rails
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -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.2.0
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.