spree_core 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +7 -0
  2. data/app/assets/images/credit_cards/icons/diners_club.png +0 -0
  3. data/app/assets/javascripts/admin/address_states.js +1 -1
  4. data/app/assets/javascripts/admin/admin.js.erb +18 -13
  5. data/app/assets/javascripts/admin/calculator.js +2 -2
  6. data/app/assets/javascripts/admin/checkouts/edit.js +3 -1
  7. data/app/assets/javascripts/admin/image_settings.js.erb +5 -5
  8. data/app/assets/javascripts/admin/orders/edit.js +1 -1
  9. data/app/assets/javascripts/admin/payments/new.js +9 -2
  10. data/app/assets/javascripts/admin/spree_core.js +13 -1
  11. data/app/assets/javascripts/admin/taxon_autocomplete.js.erb +2 -1
  12. data/app/assets/javascripts/admin/variant_autocomplete.js.erb +23 -19
  13. data/app/assets/javascripts/spree.js.coffee +37 -0
  14. data/app/assets/javascripts/store/checkout.js.coffee +8 -0
  15. data/app/assets/javascripts/store/product.js.coffee +1 -1
  16. data/app/assets/javascripts/store/spree_core.js +1 -0
  17. data/app/assets/stylesheets/admin/components/_sidebar.scss +7 -6
  18. data/app/assets/stylesheets/admin/components/_states.scss +16 -12
  19. data/app/assets/stylesheets/admin/globals/_variables.scss +102 -96
  20. data/app/assets/stylesheets/admin/shared/_forms.scss +2 -1
  21. data/app/assets/stylesheets/admin/shared/_icons.scss +2 -1
  22. data/app/assets/stylesheets/admin/shared/_layout.scss +4 -1
  23. data/app/assets/stylesheets/admin/shared/_tables.scss +8 -0
  24. data/app/assets/stylesheets/store/screen.css.scss +28 -16
  25. data/app/assets/stylesheets/store/variables.css.scss +4 -2
  26. data/app/controllers/spree/admin/adjustments_controller.rb +7 -3
  27. data/app/controllers/spree/admin/base_controller.rb +10 -5
  28. data/app/controllers/spree/admin/line_items_controller.rb +3 -2
  29. data/app/controllers/spree/admin/orders/customer_details_controller.rb +3 -2
  30. data/app/controllers/spree/admin/orders_controller.rb +2 -2
  31. data/app/controllers/spree/admin/payments_controller.rb +1 -1
  32. data/app/controllers/spree/admin/resource_controller.rb +5 -5
  33. data/app/controllers/spree/admin/shipments_controller.rb +1 -1
  34. data/app/controllers/spree/admin/taxons_controller.rb +1 -1
  35. data/app/controllers/spree/admin/users_controller.rb +96 -0
  36. data/app/controllers/spree/checkout_controller.rb +18 -7
  37. data/app/controllers/spree/locale_controller.rb +1 -1
  38. data/app/controllers/spree/orders_controller.rb +20 -2
  39. data/app/controllers/spree/taxons_controller.rb +8 -2
  40. data/app/helpers/spree/admin/images_helper.rb +6 -2
  41. data/app/helpers/spree/admin/navigation_helper.rb +23 -3
  42. data/app/helpers/spree/base_helper.rb +9 -5
  43. data/app/helpers/spree/orders_helper.rb +13 -0
  44. data/app/helpers/spree/products_helper.rb +9 -4
  45. data/app/mailers/spree/base_mailer.rb +16 -0
  46. data/app/mailers/spree/order_mailer.rb +12 -11
  47. data/app/mailers/spree/shipment_mailer.rb +4 -7
  48. data/app/mailers/spree/test_mailer.rb +2 -3
  49. data/app/models/spree/adjustment.rb +1 -1
  50. data/app/models/spree/app_configuration.rb +9 -3
  51. data/app/models/spree/calculator/default_tax.rb +5 -1
  52. data/app/models/spree/calculator/per_item.rb +1 -1
  53. data/app/models/spree/classification.rb +7 -0
  54. data/app/models/spree/credit_card.rb +1 -5
  55. data/app/models/spree/gateway.rb +10 -2
  56. data/app/models/spree/gateway/bogus.rb +5 -5
  57. data/app/models/spree/inventory_unit.rb +4 -4
  58. data/app/models/spree/line_item.rb +1 -1
  59. data/app/models/spree/order.rb +15 -35
  60. data/app/models/spree/order/checkout.rb +52 -0
  61. data/app/models/spree/order_populator.rb +11 -3
  62. data/app/models/spree/order_updater.rb +3 -4
  63. data/app/models/spree/payment.rb +23 -1
  64. data/app/models/spree/payment/processing.rb +18 -5
  65. data/app/models/spree/payment_method.rb +4 -0
  66. data/app/models/spree/price.rb +2 -3
  67. data/app/models/spree/product.rb +12 -4
  68. data/app/models/spree/product/scopes.rb +29 -16
  69. data/app/models/spree/return_authorization.rb +1 -1
  70. data/app/models/spree/shipment.rb +1 -1
  71. data/app/models/spree/taxon.rb +21 -6
  72. data/app/models/spree/variant.rb +7 -2
  73. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +2 -2
  74. data/app/views/spree/admin/countries/index.html.erb +1 -0
  75. data/app/views/spree/admin/general_settings/edit.html.erb +10 -2
  76. data/app/views/spree/admin/images/index.html.erb +7 -3
  77. data/app/views/spree/admin/mail_methods/index.html.erb +2 -2
  78. data/app/views/spree/admin/orders/_form.html.erb +3 -3
  79. data/app/views/spree/admin/orders/_line_item.html.erb +1 -1
  80. data/app/views/spree/admin/orders/customer_details/_form.html.erb +4 -4
  81. data/app/views/spree/admin/orders/index.html.erb +60 -52
  82. data/app/views/spree/admin/payment_methods/_form.html.erb +2 -2
  83. data/app/views/spree/admin/payment_methods/index.html.erb +39 -35
  84. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  85. data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +10 -10
  86. data/app/views/spree/admin/products/_form.html.erb +7 -12
  87. data/app/views/spree/admin/products/index.html.erb +13 -15
  88. data/app/views/spree/admin/products/new.html.erb +3 -1
  89. data/app/views/spree/admin/return_authorizations/_form.html.erb +7 -7
  90. data/app/views/spree/admin/return_authorizations/edit.html.erb +17 -11
  91. data/app/views/spree/admin/return_authorizations/index.html.erb +4 -4
  92. data/app/views/spree/admin/return_authorizations/new.html.erb +13 -6
  93. data/app/views/spree/admin/shared/_alert.html.erb +1 -1
  94. data/app/views/spree/admin/shared/_configuration_menu.html.erb +6 -2
  95. data/app/views/spree/admin/shared/_order_details.html.erb +6 -6
  96. data/app/views/spree/admin/shared/_order_tabs.html.erb +20 -37
  97. data/app/views/spree/admin/shared/_routes.html.erb +1 -1
  98. data/app/views/spree/admin/shared/_tabs.html.erb +1 -2
  99. data/app/views/spree/admin/shared/_update_order_state.js +1 -1
  100. data/app/views/spree/admin/shipments/_form.html.erb +24 -24
  101. data/app/views/spree/admin/shipments/edit.html.erb +13 -13
  102. data/app/views/spree/admin/shipments/index.html.erb +35 -31
  103. data/app/views/spree/admin/shipping_methods/index.html.erb +35 -32
  104. data/app/views/spree/admin/tax_rates/_form.html.erb +2 -1
  105. data/app/views/spree/admin/taxons/_form.html.erb +17 -0
  106. data/app/views/spree/admin/taxons/edit.html.erb +3 -1
  107. data/app/views/spree/admin/trackers/_form.html.erb +2 -2
  108. data/app/views/spree/admin/trackers/index.html.erb +2 -2
  109. data/app/views/spree/admin/users/_form.html.erb +37 -0
  110. data/app/views/spree/admin/users/edit.html.erb +28 -0
  111. data/app/views/spree/admin/users/index.html.erb +53 -0
  112. data/app/views/spree/admin/users/new.html.erb +23 -0
  113. data/app/views/spree/admin/users/show.html.erb +21 -0
  114. data/app/views/spree/admin/variants/edit.html.erb +6 -4
  115. data/app/views/spree/admin/variants/index.html.erb +1 -1
  116. data/app/views/spree/admin/zones/_form.html.erb +4 -4
  117. data/app/views/spree/admin/zones/index.html.erb +3 -1
  118. data/app/views/spree/checkout/_delivery.html.erb +1 -1
  119. data/app/views/spree/checkout/_payment.html.erb +1 -1
  120. data/app/views/spree/checkout/_summary.html.erb +2 -2
  121. data/app/views/spree/checkout/payment/_gateway.html.erb +6 -6
  122. data/app/views/spree/layouts/spree_application.html.erb +0 -1
  123. data/app/views/spree/order_mailer/cancel_email.text.erb +1 -1
  124. data/app/views/spree/order_mailer/confirm_email.text.erb +1 -1
  125. data/app/views/spree/orders/_adjustments.html.erb +1 -1
  126. data/app/views/spree/orders/_line_item.html.erb +2 -2
  127. data/app/views/spree/orders/edit.html.erb +1 -1
  128. data/app/views/spree/payments/_payment.html.erb +16 -0
  129. data/app/views/spree/products/_cart_form.html.erb +2 -2
  130. data/app/views/spree/products/_thumbnails.html.erb +3 -3
  131. data/app/views/spree/products/index.html.erb +1 -1
  132. data/app/views/spree/shared/_google_analytics.html.erb +1 -1
  133. data/app/views/spree/shared/_main_nav_bar.html.erb +1 -1
  134. data/app/views/spree/shared/_order_details.html.erb +10 -24
  135. data/app/views/spree/shared/_products.html.erb +1 -1
  136. data/app/views/spree/shared/_search.html.erb +1 -1
  137. data/app/views/spree/taxons/show.html.erb +1 -1
  138. data/config/initializers/check_for_orphaned_preferences.rb +5 -2
  139. data/config/locales/en.yml +24 -5
  140. data/config/routes.rb +4 -3
  141. data/db/default/spree/countries.rb +229 -0
  142. data/db/default/spree/roles.rb +2 -0
  143. data/db/default/spree/states.rb +57 -0
  144. data/db/default/spree/zones.rb +17 -0
  145. data/db/migrate/20130207155350_add_order_id_index_to_payments.rb +9 -0
  146. data/db/migrate/20130208032954_add_primary_to_spree_products_taxons.rb +5 -0
  147. data/db/migrate/20130222032153_add_order_id_index_to_shipments.rb +5 -0
  148. data/db/migrate/20130226032817_change_meta_description_on_spree_products_to_text.rb +5 -0
  149. data/db/migrate/20130226054936_add_variant_id_index_to_spree_prices.rb +5 -0
  150. data/db/migrate/20130319062004_change_orders_total_precision.rb +8 -0
  151. data/db/migrate/20130319063911_change_spree_payments_amount_precision.rb +7 -0
  152. data/db/migrate/20130319064308_change_spree_return_authorization_amount_precision.rb +7 -0
  153. data/db/migrate/20130319082943_change_adjustments_amount_precision.rb +7 -0
  154. data/db/migrate/20130328195253_add_seo_metas_to_taxons.rb +9 -0
  155. data/lib/generators/spree/dummy/templates/rails/database.yml +9 -6
  156. data/lib/spree/core/calculated_adjustments.rb +1 -1
  157. data/lib/spree/core/controller_helpers/auth.rb +3 -3
  158. data/lib/spree/core/controller_helpers/common.rb +1 -11
  159. data/lib/spree/core/controller_helpers/order.rb +15 -12
  160. data/lib/spree/core/engine.rb +5 -1
  161. data/lib/spree/core/mail_interceptor.rb +4 -6
  162. data/lib/spree/core/mail_settings.rb +52 -23
  163. data/lib/spree/core/permalinks.rb +1 -3
  164. data/lib/spree/core/testing_support/authorization_helpers.rb +1 -1
  165. data/lib/spree/core/testing_support/capybara_ext.rb +30 -0
  166. data/lib/spree/core/testing_support/common_rake.rb +8 -0
  167. data/lib/spree/core/testing_support/factories/payment_factory.rb +1 -1
  168. data/lib/spree/core/testing_support/factories/product_factory.rb +7 -2
  169. data/lib/spree/core/testing_support/factories/variant_factory.rb +4 -2
  170. data/lib/spree/core/validators/email.rb +1 -1
  171. data/lib/spree/core/version.rb +1 -1
  172. data/lib/spree/money.rb +14 -3
  173. data/lib/spree/product_filters.rb +1 -1
  174. data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +3 -2
  175. data/vendor/assets/javascripts/jsuri.js +2 -0
  176. data/vendor/assets/javascripts/modernizr.js +3 -3
  177. metadata +78 -69
  178. data/db/default/spree/countries.yml +0 -1589
  179. data/db/default/spree/roles.yml +0 -5
  180. data/db/default/spree/states.yml +0 -256
  181. data/db/default/spree/zone_members.yml +0 -169
  182. data/db/default/spree/zones.yml +0 -13
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7dcd25bc09eef1fdc85269018277aa954848fb6f
4
+ data.tar.gz: 6c09d32829e4e87e894c38ce1b14b6b307a97f53
5
+ SHA512:
6
+ metadata.gz: 4c3732fd647f46c1089fb737409226e8abc5bc0c255523f33815a8d1908fdd6f188d4cadb2bb8914db22b3bac65ea60aa8714aec919cbed2a8f475318cd9b536
7
+ data.tar.gz: d09f9087d47758599d36bed4852863a7dd8aadbe6dfa11ce5c279cfd654da291a976c535d0f0b159c0325c9279d6fcca7e44db755c1f70b8a195004d125a7873
@@ -2,7 +2,7 @@ var update_state = function(region) {
2
2
  var country = $('span#' + region + 'country .select2').select2('val');
3
3
  var states = state_mapper[country];
4
4
 
5
- var state_select = $('span#' + region + 'state .select2');
5
+ var state_select = $('span#' + region + 'state select.select2');
6
6
  var state_input = $('span#' + region + 'state input');
7
7
 
8
8
  if(states) {
@@ -1,4 +1,5 @@
1
1
  //= require_self
2
+ //= require spree
2
3
  //= require admin/handlebar_extensions
3
4
  //= require admin/variant_autocomplete
4
5
  //= require admin/taxon_autocomplete
@@ -23,10 +24,12 @@ jQuery(function($) {
23
24
  <% # Re-adjusting admin menu during test causes tests to fail,
24
25
  # like states_spec and shipping_methods_spec. Let's not do this. %>
25
26
  <% unless Rails.env.test? %>
26
- $('.main-menu-wrapper ul').AdaptiveMenu({
27
- text: "<a href='#'><i class='icon-chevron-down'></i> " + Spree.translations.more + "</a>",
28
- klass: "dropdown"
29
- });
27
+ if (Spree.translations) {
28
+ $('.main-menu-wrapper ul').AdaptiveMenu({
29
+ text: "<a href='#'><i class='icon-chevron-down'></i> " + Spree.translations.more + "</a>",
30
+ klass: "dropdown"
31
+ });
32
+ }
30
33
  <% end %>
31
34
 
32
35
  // Add some tips
@@ -111,15 +114,17 @@ $.fn.radioControlsVisibilityOfElement = function(dependentElementSelector){
111
114
  }
112
115
 
113
116
  handle_date_picker_fields = function(){
114
- $('.datepicker').datepicker({
115
- dateFormat: Spree.translations.date_picker,
116
- dayNames: Spree.translations.abbr_day_names,
117
- dayNamesMin: Spree.translations.abbr_day_names,
118
- monthNames: Spree.translations.month_names,
119
- prevText: Spree.translations.previous,
120
- nextText: Spree.translations.next,
121
- showOn: "focus"
122
- });
117
+ if (Spree.translations) {
118
+ $('.datepicker').datepicker({
119
+ dateFormat: Spree.translations.date_picker,
120
+ dayNames: Spree.translations.abbr_day_names,
121
+ dayNamesMin: Spree.translations.abbr_day_names,
122
+ monthNames: Spree.translations.month_names,
123
+ prevText: Spree.translations.previous,
124
+ nextText: Spree.translations.next,
125
+ showOn: "focus"
126
+ });
127
+ }
123
128
 
124
129
  // Correctly display range dates
125
130
  $('.date-range-filter .datepicker-from').datepicker('option', 'onSelect', function(selectedDate) {
@@ -6,11 +6,11 @@ $(function() {
6
6
  if (calculator_select.attr('value') == original_calc_type) {
7
7
  $('div.calculator-settings').show();
8
8
  $('div#calculator-settings-warning').hide();
9
- $('.calculator-settings input').prop("disabled", false);
9
+ $('.calculator-settings').find('input,textarea').prop("disabled", false);
10
10
  } else {
11
11
  $('div.calculator-settings').hide();
12
12
  $('div#calculator-settings-warning').show();
13
- $('.calculator-settings input').prop("disabled", true);
13
+ $('.calculator-settings').find('input,textarea').prop("disabled", true);
14
14
  }
15
15
  });
16
16
  })
@@ -1,5 +1,7 @@
1
1
  $(document).ready(function() {
2
- window.customerTemplate = Handlebars.compile($('#customer_autocomplete_template').text());
2
+ if ($('#customer_autocomplete_template').length > 0) {
3
+ window.customerTemplate = Handlebars.compile($('#customer_autocomplete_template').text());
4
+ }
3
5
 
4
6
  formatCustomerResult = function(customer) {
5
7
  return customerTemplate({
@@ -9,31 +9,31 @@ $(document).ready(function() {
9
9
  $('#s3_settings, #s3_headers').toggle();
10
10
  });
11
11
 
12
- $('.destroy_style').live("click", function(e) {
12
+ $(document).on('click', '.destroy_style', function(e) {
13
13
  e.preventDefault();
14
14
  $(this).parent().remove();
15
15
  });
16
16
 
17
- $('.destroy_new_attachment_styles').live("click", function(e) {
17
+ $(document).on('click', '.destroy_new_attachment_styles', function(e) {
18
18
  e.preventDefault();
19
19
  $(this).closest('.new_attachment_styles').remove();
20
20
  });
21
21
 
22
- $('.destroy_new_s3_headers').live("click", function(e) {
22
+ $(document).on('click', '.destroy_new_s3_headers', function(e) {
23
23
  e.preventDefault();
24
24
  $(this).closest('.new_s3_headers').remove();
25
25
  });
26
26
 
27
27
  // Handle adding new styles
28
28
  var styles_hash_index = 1;
29
- $('.add_new_style').live("click", function(e) {
29
+ $(document).on('click', '.add_new_style', function(e) {
30
30
  e.preventDefault();
31
31
  $('#new-styles').append(generate_html_for_hash("new_attachment_styles", styles_hash_index));
32
32
  });
33
33
 
34
34
  // Handle adding new headers
35
35
  var headers_hash_index = 1;
36
- $('.add_header').live("click", function(e) {
36
+ $(document).on('click', '.add_header', function(e) {
37
37
  e.preventDefault();
38
38
  $('#headers_list').append(generate_html_for_hash("new_s3_headers", headers_hash_index));
39
39
  });
@@ -10,6 +10,6 @@ $(document).ready(function(){
10
10
  return false;
11
11
  });
12
12
 
13
- $(".variant_autocomplete").variantAutocomplete();
13
+ $('[data-hook="add_product_name"]').find(".variant_autocomplete").variantAutocomplete();
14
14
 
15
15
  });
@@ -1,9 +1,16 @@
1
1
  $(document).ready(function(){
2
-
2
+
3
3
  $("#card_new").radioControlsVisibilityOfElement('#card_form');
4
-
4
+
5
5
  $('select.jump_menu').change(function(){
6
6
  window.location = this.options[this.selectedIndex].value;
7
7
  });
8
8
 
9
+ $('#cvv_link').click(function(event){
10
+ window_name = 'cvv_info';
11
+ window_options = 'left=20,top=20,width=500,height=500,toolbar=0,resizable=0,scrollbars=1';
12
+ window.open($(this).attr('href'), window_name, window_options);
13
+ event.preventDefault();
14
+ });
15
+
9
16
  });
@@ -14,6 +14,18 @@
14
14
  //= require equalize
15
15
  //= require responsive-tables
16
16
  //= require jquery.horizontalNav
17
+ //= require jsuri
17
18
  //= require_tree .
18
19
 
19
- var Spree = {};
20
+ var Spree = {
21
+ // Helper function to take a URL and add query parameters to it
22
+ // Uses the JSUri library from here: https://code.google.com/p/jsuri/
23
+ // Thanks to Jake Moffat for the suggestion: https://twitter.com/jakeonrails/statuses/321776992221544449
24
+ url: function(uri, query) {
25
+ var uri = new Uri(uri);
26
+ $.each(query, function (key, value) {
27
+ uri.addQueryParam(key, value);
28
+ });
29
+ return uri;
30
+ }
31
+ };
@@ -11,7 +11,8 @@ $(document).ready(function() {
11
11
  placeholder: Spree.translations.taxon_placeholder,
12
12
  multiple: true,
13
13
  initSelection: function(element, callback) {
14
- return $.getJSON(Spree.routes.taxon_search + "?ids=" + (element.val()), null, function(data) {
14
+ url = Spree.url(Spree.routes.taxon_search, { ids: element.val() })
15
+ return $.getJSON(url, null, function(data) {
15
16
  return callback(self.cleanTaxons(data));
16
17
  })
17
18
  },
@@ -2,7 +2,9 @@
2
2
  // variant autocompletion
3
3
 
4
4
  $(document).ready(function() {
5
- window.variantTemplate = Handlebars.compile($('#variant_autocomplete_template').text());
5
+ if ($('#variant_autocomplete_template').length > 0) {
6
+ window.variantTemplate = Handlebars.compile($('#variant_autocomplete_template').text());
7
+ }
6
8
  })
7
9
 
8
10
  formatVariantResult = function(variant) {
@@ -13,24 +15,26 @@ formatVariantResult = function(variant) {
13
15
  }
14
16
 
15
17
  $.fn.variantAutocomplete = function() {
16
- this.parent().children(".options_placeholder").attr('id', this.parent().data('index'))
17
- this.select2({
18
- placeholder: "Select a variant",
19
- minimumInputLength: 4,
20
- ajax: {
21
- url: Spree.routes.variants_search,
22
- datatype: 'json',
23
- data: function(term, page) {
24
- return { q: term }
18
+ if (Spree.routes) {
19
+ this.parent().children(".options_placeholder").attr('id', this.parent().data('index'))
20
+ this.select2({
21
+ placeholder: "Select a variant",
22
+ minimumInputLength: 3,
23
+ ajax: {
24
+ url: Spree.routes.variants_search,
25
+ datatype: 'json',
26
+ data: function(term, page) {
27
+ return { q: term }
28
+ },
29
+ results: function (data, page) {
30
+ return { results: data }
31
+ }
25
32
  },
26
- results: function (data, page) {
27
- return { results: data }
33
+ formatResult: formatVariantResult,
34
+ formatSelection: function (variant) {
35
+ $(this.element).parent().children('.options_placeholder').html(variant.options_text)
36
+ return variant.name;
28
37
  }
29
- },
30
- formatResult: formatVariantResult,
31
- formatSelection: function (variant) {
32
- $(this.element).parent().children('.options_placeholder').html(variant.options_text)
33
- return variant.name;
34
- }
35
- })
38
+ })
39
+ }
36
40
  }
@@ -0,0 +1,37 @@
1
+ #= require jsuri
2
+ class window.Spree
3
+ # Helper function to take a URL and add query parameters to it
4
+ # Uses the JSUri library from here: https://code.google.com/p/jsuri/
5
+ # Thanks to Jake Moffat for the suggestion: https://twitter.com/jakeonrails/statuses/321776992221544449
6
+ @url: (uri, query) ->
7
+ if uri.path == undefined
8
+ uri = new Uri(uri)
9
+ if query
10
+ $.each query, (key, value) ->
11
+ uri.addQueryParam(key, value)
12
+ if Spree.api_key
13
+ uri.addQueryParam('token', Spree.api_key)
14
+ return uri
15
+
16
+ # Helper method in case people want to call uri rather than url
17
+ @uri: (uri, query) ->
18
+ url(uri, query)
19
+
20
+ # This function automatically appends the API token
21
+ # for the user to the end of any URL.
22
+ # Immediately after, this string is then passed to jQuery.ajax.
23
+ #
24
+ # ajax works in two ways in jQuery:
25
+ #
26
+ # $.ajax("url", {settings: 'go here'})
27
+ # or:
28
+ # $.ajax({url: "url", settings: 'go here'})
29
+ #
30
+ # This function will support both of these calls.
31
+ @ajax: (url_or_settings, settings) ->
32
+ if (typeof(url_or_settings) == "string")
33
+ $.ajax(Spree.url(url_or_settings).toString(), settings)
34
+ else
35
+ url = url_or_settings['url']
36
+ delete url_or_settings['url']
37
+ $.ajax(Spree.url(url).toString(), url_or_settings)
@@ -34,6 +34,7 @@ $ ->
34
34
 
35
35
  state_select.prop('disabled', false).show()
36
36
  state_input.hide().prop 'disabled', true
37
+ state_para.show()
37
38
  state_span_required.show()
38
39
  else
39
40
  state_select.hide().prop 'disabled', true
@@ -74,6 +75,13 @@ $ ->
74
75
  ($ '#payment_method_' + @value).show() if @checked
75
76
  )
76
77
 
78
+ ($ document).on('click', '#cvv_link', (event) ->
79
+ window_name = 'cvv_info'
80
+ window_options = 'left=20,top=20,width=500,height=500,toolbar=0,resizable=0,scrollbars=1'
81
+ window.open(($ this).attr('href'), window_name, window_options)
82
+ event.preventDefault()
83
+ )
84
+
77
85
  # Activate already checked payment method if form is re-rendered
78
86
  # i.e. if user enters invalid data
79
87
  ($ 'input[type="radio"]:checked').click()
@@ -18,7 +18,7 @@ add_image_handlers = ->
18
18
 
19
19
  show_variant_images = (variant_id) ->
20
20
  ($ 'li.vtmb').hide()
21
- ($ 'li.vtmb-' + variant_id).show()
21
+ ($ 'li.tmb-' + variant_id).show()
22
22
  currentThumb = ($ '#' + ($ '#main-image').data('selectedThumbId'))
23
23
  if not currentThumb.hasClass('vtmb-' + variant_id)
24
24
  thumb = ($ ($ 'ul.thumbnails li:visible.vtmb').eq(0))
@@ -1,4 +1,5 @@
1
1
  //= require jquery.validate/jquery.validate.min
2
+ //= require spree
2
3
  //= require store/checkout
3
4
  //= require store/product
4
5
  //= require store/cart
@@ -2,22 +2,23 @@
2
2
  //---------------------------------------------------
3
3
  #sidebar {
4
4
  overflow: visible;
5
- border-top: 1px solid $color-border;
5
+ border-top: 1px solid $color-border;
6
6
  margin-top: 17px;
7
7
 
8
8
  .sidebar-title {
9
9
  color: $color-2;
10
10
  text-transform: uppercase;
11
- text-align: center;
11
+ text-align: center;
12
12
  font-size: 14px;
13
13
  font-weight: 600;
14
-
14
+
15
15
  > span {
16
16
  display: inline;
17
- background: #fff;
18
- padding: 5px 10px;
19
- position: relative;
17
+ background: #fff;
18
+ padding: 5px 10px;
19
+ position: relative;
20
20
  top: -14px;
21
+ -webkit-font-smoothing: antialiased;
21
22
  }
22
23
  }
23
24
  }
@@ -1,21 +1,25 @@
1
1
  .state {
2
- @include border-radius($border-radius);
3
2
  text-transform: uppercase;
4
3
  font-size: 80%;
5
4
  font-weight: 600;
6
- border: 1px solid transparent;
7
- padding: 2px 5px;
8
- width: 100%;
9
- display: inline-block;
10
- text-align: center;
5
+
6
+ &:before {
7
+ content: '';
8
+ position: relative;
9
+ display: inline-block;
10
+ margin-right: 3px;
11
+ border-radius: $body-font-size/2;
12
+ width: $body-font-size - 4px;
13
+ height: $body-font-size - 4px;
14
+ }
11
15
 
12
16
  @each $state in $states {
13
- &.#{$state} {
17
+ &.#{$state}:before {
14
18
  background-color: get-value($states, $states-bg-colors, $state);
15
19
 
16
- &, a {
17
- color: get-value($states, $states-text-colors, $state);
18
- }
20
+ // &, a {
21
+ // color: get-value($states, $states-text-colors, $state);
22
+ // }
19
23
  }
20
24
  }
21
25
  }
@@ -24,7 +28,7 @@ table tbody tr {
24
28
  &[class*="state"] td:first-child {
25
29
  border-left-width: 3px;
26
30
  }
27
- &.state-complete td:first-child { border-left-color: $color-success }
31
+ &.state-complete td:first-child { border-left-color: $color-success }
28
32
  &.state-cart td:first-child { border-left-color: very-light($color-notice, 6) }
29
33
  &.state-canceled td:first-child { border-left-color: $color-error }
30
- }
34
+ }
@@ -10,125 +10,131 @@ $base-font-family: "Open Sans", "Helvetica Neue", "Helvetica", Helvetica, Arial,
10
10
  //--------------------------------------------------------------
11
11
 
12
12
  // Basic color palette for admin
13
- $color-1: #FFFFFF !default; // White
14
- $color-2: #9FC820 !default; // Green
15
- $color-3: #5498DA !default; // Light Blue
16
- $color-4: #6788A2 !default; // Dark Blue
17
- $color-5: #C60F13 !default; // Red
18
- $color-6: #FF9300 !default; // Yellow
13
+ $color-1: #FFFFFF !default; // White
14
+ $color-2: #9FC820 !default; // Green
15
+ $color-3: #5498DA !default; // Light Blue
16
+ $color-4: #6788A2 !default; // Dark Blue
17
+ $color-5: #C60F13 !default; // Red
18
+ $color-6: #FF9300 !default; // Yellow
19
19
 
20
20
  // Body base colors
21
- $color-body-bg: $color-1 !default;
22
- $color-body-text: $color-4 !default;
23
- $color-headers: $color-4 !default;
24
- $color-link: $color-3 !default;
25
- $color-link-hover: $color-2 !default;
26
- $color-link-active: $color-2 !default;
27
- $color-link-focus: $color-2 !default;
28
- $color-link-visited: $color-3 !default;
29
- $color-border: very-light($color-3, 12) !default;
21
+ $color-body-bg: $color-1 !default;
22
+ $color-body-text: $color-4 !default;
23
+ $color-headers: $color-4 !default;
24
+ $color-link: $color-3 !default;
25
+ $color-link-hover: $color-2 !default;
26
+ $color-link-active: $color-2 !default;
27
+ $color-link-focus: $color-2 !default;
28
+ $color-link-visited: $color-3 !default;
29
+ $color-border: very-light($color-3, 12) !default;
30
30
 
31
31
  // Basic flash colors
32
- $color-success: $color-2 !default;
33
- $color-notice: $color-6 !default;
34
- $color-error: $color-5 !default;
32
+ $color-success: $color-2 !default;
33
+ $color-notice: $color-6 !default;
34
+ $color-error: $color-5 !default;
35
35
 
36
36
  // Table colors
37
- $color-tbl-odd: $color-1 !default;
38
- $color-tbl-even: very-light($color-3, 4) !default;
39
- $color-tbl-thead: very-light($color-3, 4) !default;
37
+ $color-tbl-odd: $color-1 !default;
38
+ $color-tbl-even: very-light($color-3, 4) !default;
39
+ $color-tbl-thead: very-light($color-3, 4) !default;
40
40
 
41
41
  // Button colors
42
- $color-btn-bg: $color-3 !default;
43
- $color-btn-text: $color-1 !default;
44
- $color-btn-hover-bg: $color-2 !default;
45
- $color-btn-hover-text: $color-1 !default;
42
+ $color-btn-bg: $color-3 !default;
43
+ $color-btn-text: $color-1 !default;
44
+ $color-btn-hover-bg: $color-2 !default;
45
+ $color-btn-hover-text: $color-1 !default;
46
46
 
47
47
  // Actions colors
48
- $color-action-edit-bg: very-light($color-success, 5 ) !default;
49
- $color-action-edit-brd: very-light($color-success, 20 ) !default;
50
- $color-action-clone-bg: very-light($color-notice, 5 ) !default;
51
- $color-action-clone-brd: very-light($color-notice, 15 ) !default;
52
- $color-action-remove-bg: very-light($color-error, 5 ) !default;
53
- $color-action-remove-brd: very-light($color-error, 10 ) !default;
54
- $color-action-void-bg: very-light($color-error, 10 ) !default;
55
- $color-action-void-brd: very-light($color-error, 20 ) !default;
56
- $color-action-capture-bg: very-light($color-success, 5 ) !default;
57
- $color-action-capture-brd: very-light($color-success, 20 ) !default;
58
- $color-action-mail-bg: very-light($color-success, 5 ) !default;
59
- $color-action-mail-brd: very-light($color-success, 20 ) !default;
48
+ $color-action-edit-bg: very-light($color-success, 5 ) !default;
49
+ $color-action-edit-brd: very-light($color-success, 20 ) !default;
50
+ $color-action-clone-bg: very-light($color-notice, 5 ) !default;
51
+ $color-action-clone-brd: very-light($color-notice, 15 ) !default;
52
+ $color-action-remove-bg: very-light($color-error, 5 ) !default;
53
+ $color-action-remove-brd: very-light($color-error, 10 ) !default;
54
+ $color-action-void-bg: very-light($color-error, 10 ) !default;
55
+ $color-action-void-brd: very-light($color-error, 20 ) !default;
56
+ $color-action-capture-bg: very-light($color-success, 5 ) !default;
57
+ $color-action-capture-brd: very-light($color-success, 20 ) !default;
58
+ $color-action-mail-bg: very-light($color-success, 5 ) !default;
59
+ $color-action-mail-brd: very-light($color-success, 20 ) !default;
60
60
 
61
61
  // Select2 select field colors
62
- $color-sel-bg: $color-3 !default;
63
- $color-sel-text: $color-1 !default;
64
- $color-sel-hover-bg: $color-2 !default;
65
- $color-sel-hover-text: $color-1 !default;
62
+ $color-sel-bg: $color-3 !default;
63
+ $color-sel-text: $color-1 !default;
64
+ $color-sel-hover-bg: $color-2 !default;
65
+ $color-sel-hover-text: $color-1 !default;
66
66
 
67
67
  // Text inputs colors
68
- $color-txt-brd: $color-border !default;
69
- $color-txt-text: $color-3 !default;
70
- $color-txt-hover-brd: $color-2 !default;
68
+ $color-txt-brd: $color-border !default;
69
+ $color-txt-text: $color-3 !default;
70
+ $color-txt-hover-brd: $color-2 !default;
71
71
 
72
72
  // States label colors
73
- $color-ste-complete-bg: $color-success !default;
74
- $color-ste-complete-text: $color-1 !default;
75
- $color-ste-completed-bg: $color-success !default;
76
- $color-ste-completed-text: $color-1 !default;
77
- $color-ste-sold-bg: $color-success !default;
78
- $color-ste-sold-text: $color-1 !default;
79
- $color-ste-pending-bg: $color-notice !default;
80
- $color-ste-pending-text: $color-1 !default;
81
- $color-ste-paid-bg: $color-success !default;
82
- $color-ste-paid-text: $color-1 !default;
83
- $color-ste-shipped-bg: $color-success !default;
84
- $color-ste-shipped-text: $color-1 !default;
85
- $color-ste-balance_due-bg: $color-notice !default;
86
- $color-ste-balance_due-text: $color-1 !default;
87
- $color-ste-backorder-bg: $color-notice !default;
88
- $color-ste-backorder-text: $color-1 !default;
89
- $color-ste-none-bg: $color-error !default;
90
- $color-ste-none-text: $color-1 !default;
91
- $color-ste-ready-bg: $color-success !default;
92
- $color-ste-ready-text: $color-1 !default;
93
- $color-ste-void-bg: $color-error !default;
94
- $color-ste-void-text: $color-1 !default;
95
- $color-ste-canceled-bg: $color-error !default;
96
- $color-ste-canceled-text: $color-1 !default;
97
- $color-ste-address-bg: $color-error !default;
98
- $color-ste-address-text: $color-1 !default;
99
- $color-ste-checkout-bg: $color-notice !default;
100
- $color-ste-checkout-text: $color-1 !default;
101
- $color-ste-cart-bg: $color-notice !default;
102
- $color-ste-cart-text: $color-1 !default;
103
- $color-ste-payment-bg: $color-error !default;
104
- $color-ste-payment-text: $color-1 !default;
105
- $color-ste-delivery-bg: $color-success !default;
106
- $color-ste-delivery-text: $color-1 !default;
107
- $color-ste-confirm-bg: $color-error !default;
108
- $color-ste-confirm-text: $color-1 !default;
73
+ $color-ste-complete-bg: $color-success !default;
74
+ $color-ste-complete-text: $color-1 !default;
75
+ $color-ste-completed-bg: $color-success !default;
76
+ $color-ste-completed-text: $color-1 !default;
77
+ $color-ste-sold-bg: $color-success !default;
78
+ $color-ste-sold-text: $color-1 !default;
79
+ $color-ste-pending-bg: $color-notice !default;
80
+ $color-ste-pending-text: $color-1 !default;
81
+ $color-ste-paid-bg: $color-success !default;
82
+ $color-ste-paid-text: $color-1 !default;
83
+ $color-ste-shipped-bg: $color-success !default;
84
+ $color-ste-shipped-text: $color-1 !default;
85
+ $color-ste-balance_due-bg: $color-notice !default;
86
+ $color-ste-balance_due-text: $color-1 !default;
87
+ $color-ste-backorder-bg: $color-notice !default;
88
+ $color-ste-backorder-text: $color-1 !default;
89
+ $color-ste-none-bg: $color-error !default;
90
+ $color-ste-none-text: $color-1 !default;
91
+ $color-ste-ready-bg: $color-success !default;
92
+ $color-ste-ready-text: $color-1 !default;
93
+ $color-ste-void-bg: $color-error !default;
94
+ $color-ste-void-text: $color-1 !default;
95
+ $color-ste-canceled-bg: $color-error !default;
96
+ $color-ste-canceled-text: $color-1 !default;
97
+ $color-ste-address-bg: $color-error !default;
98
+ $color-ste-address-text: $color-1 !default;
99
+ $color-ste-checkout-bg: $color-notice !default;
100
+ $color-ste-checkout-text: $color-1 !default;
101
+ $color-ste-cart-bg: $color-notice !default;
102
+ $color-ste-cart-text: $color-1 !default;
103
+ $color-ste-payment-bg: $color-error !default;
104
+ $color-ste-payment-text: $color-1 !default;
105
+ $color-ste-delivery-bg: $color-success !default;
106
+ $color-ste-delivery-text: $color-1 !default;
107
+ $color-ste-confirm-bg: $color-error !default;
108
+ $color-ste-confirm-text: $color-1 !default;
109
+ $color-ste-backordered-bg: $color-notice !default;
110
+ $color-ste-backordered-text: $color-1 !default;
111
+ $color-ste-credit_owed-bg: $color-success !default;
112
+ $color-ste-credit_owed-text: $color-1 !default;
113
+ $color-ste-awaiting_return-bg: $color-notice !default;;
114
+ $color-ste-awaiting_return-text: $color-1 !default;;
109
115
 
110
116
  // Avaliable states
111
- $states: completed, complete, sold, pending, paid, shipped, balance_due, backorder, checkout, cart, address, delivery, payment, confirm, canceled, ready, void !default;
112
- $states-bg-colors: $color-ste-completed-bg, $color-ste-complete-bg, $color-ste-sold-bg, $color-ste-pending-bg, $color-ste-paid-bg, $color-ste-shipped-bg, $color-ste-balance_due-bg, $color-ste-backorder-bg, $color-ste-checkout-bg, $color-ste-cart-bg, $color-ste-address-bg, $color-ste-delivery-bg, $color-ste-payment-bg, $color-ste-confirm-bg, $color-ste-canceled-bg, $color-ste-ready-bg, $color-ste-void-bg !default;
113
- $states-text-colors: $color-ste-completed-text, $color-ste-complete-text, $color-ste-sold-text, $color-ste-pending-text, $color-ste-paid-text, $color-ste-shipped-text, $color-ste-balance_due-text, $color-ste-backorder-text, $color-ste-checkout-text, $color-ste-cart-text, $color-ste-address-text, $color-ste-delivery-text, $color-ste-payment-text, $color-ste-confirm-text, $color-ste-canceled-text, $color-ste-ready-text, $color-ste-void-text !default;
117
+ $states: completed, complete, sold, pending, paid, shipped, balance_due, backorder, checkout, cart, address, delivery, payment, confirm, canceled, ready, void, backordered, credit_owed, awaiting_return !default;
118
+ $states-bg-colors: $color-ste-completed-bg, $color-ste-complete-bg, $color-ste-sold-bg, $color-ste-pending-bg, $color-ste-paid-bg, $color-ste-shipped-bg, $color-ste-balance_due-bg, $color-ste-backorder-bg, $color-ste-checkout-bg, $color-ste-cart-bg, $color-ste-address-bg, $color-ste-delivery-bg, $color-ste-payment-bg, $color-ste-confirm-bg, $color-ste-canceled-bg, $color-ste-ready-bg, $color-ste-void-bg, $color-ste-backordered-bg, $color-ste-credit_owed-bg, $color-ste-awaiting_return-bg !default;
119
+ $states-text-colors: $color-ste-completed-text, $color-ste-complete-text, $color-ste-sold-text, $color-ste-pending-text, $color-ste-paid-text, $color-ste-shipped-text, $color-ste-balance_due-text, $color-ste-backorder-text, $color-ste-checkout-text, $color-ste-cart-text, $color-ste-address-text, $color-ste-delivery-text, $color-ste-payment-text, $color-ste-confirm-text, $color-ste-canceled-text, $color-ste-ready-text, $color-ste-void-text, $color-ste-backordered-text, $color-ste-credit_owed-text, $color-ste-awaiting_return-text !default;
114
120
 
115
121
  // Avaliable actions
116
- $actions: edit, clone, remove, void, capture, mail !default;
117
- $actions-bg-colors: $color-action-edit-bg, $color-action-clone-bg, $color-action-remove-bg, $color-action-void-bg, $color-action-capture-bg, $color-action-mail-bg !default;
118
- $actions-brd-colors: $color-action-edit-brd, $color-action-clone-brd, $color-action-remove-brd, $color-action-void-brd, $color-action-capture-brd, $color-action-mail-brd !default;
122
+ $actions: edit, clone, remove, void, capture, mail !default;
123
+ $actions-bg-colors: $color-action-edit-bg, $color-action-clone-bg, $color-action-remove-bg, $color-action-void-bg, $color-action-capture-bg, $color-action-mail-bg !default;
124
+ $actions-brd-colors: $color-action-edit-brd, $color-action-clone-brd, $color-action-remove-brd, $color-action-void-brd, $color-action-capture-brd, $color-action-mail-brd !default;
119
125
 
120
126
  // Sizes
121
127
  //--------------------------------------------------------------
122
- $body-font-size: 13px !default;
128
+ $body-font-size: 13px !default;
123
129
 
124
- $h6-size: $body-font-size + 2 !default;
125
- $h5-size: $h6-size + 2 !default;
126
- $h4-size: $h5-size + 2 !default;
127
- $h3-size: $h4-size + 2 !default;
128
- $h2-size: $h3-size + 2 !default;
129
- $h1-size: $h2-size + 2 !default;
130
+ $h6-size: $body-font-size + 2 !default;
131
+ $h5-size: $h6-size + 2 !default;
132
+ $h4-size: $h5-size + 2 !default;
133
+ $h3-size: $h4-size + 2 !default;
134
+ $h2-size: $h3-size + 2 !default;
135
+ $h1-size: $h2-size + 2 !default;
130
136
 
131
- $border-radius: 3px !default;
137
+ $border-radius: 3px !default;
132
138
 
133
- $font-weight-bold: 600 !default;
134
- $font-weight-normal: 400 !default;
139
+ $font-weight-bold: 600 !default;
140
+ $font-weight-normal: 400 !default;