spree_core 1.0.7 → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/admin/admin.js.erb +9 -18
- data/app/assets/javascripts/admin/calculator.js +7 -6
- data/app/assets/javascripts/admin/checkouts/edit.js +2 -2
- data/app/assets/javascripts/admin/image_settings.js +49 -0
- data/app/assets/javascripts/admin/orders/edit_form.js +14 -14
- data/app/assets/stylesheets/admin/admin.css.erb +36 -54
- data/app/assets/stylesheets/store/screen.css.scss +25 -12
- data/app/controllers/spree/admin/base_controller.rb +3 -3
- data/app/controllers/spree/admin/image_settings_controller.rb +71 -0
- data/app/controllers/spree/admin/images_controller.rb +22 -21
- data/app/controllers/spree/admin/mail_methods_controller.rb +1 -1
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
- data/app/controllers/spree/admin/orders_controller.rb +13 -13
- data/app/controllers/spree/admin/payment_methods_controller.rb +1 -1
- data/app/controllers/spree/admin/payments_controller.rb +1 -1
- data/app/controllers/spree/admin/product_properties_controller.rb +3 -4
- data/app/controllers/spree/admin/products_controller.rb +49 -47
- data/app/controllers/spree/admin/properties_controller.rb +1 -1
- data/app/controllers/spree/admin/prototypes_controller.rb +12 -6
- data/app/controllers/spree/admin/reports_controller.rb +15 -16
- data/app/controllers/spree/admin/resource_controller.rb +1 -1
- data/app/controllers/spree/admin/return_authorizations_controller.rb +1 -1
- data/app/controllers/spree/admin/shipments_controller.rb +0 -3
- data/app/controllers/spree/admin/states_controller.rb +9 -9
- data/app/controllers/spree/admin/users_controller.rb +18 -42
- data/app/controllers/spree/admin/variants_controller.rb +22 -21
- data/app/controllers/spree/admin/zones_controller.rb +11 -11
- data/app/controllers/spree/content_controller.rb +1 -1
- data/app/controllers/spree/locale_controller.rb +2 -2
- data/app/controllers/spree/orders_controller.rb +4 -6
- data/app/controllers/spree/products_controller.rb +1 -1
- data/app/controllers/spree/states_controller.rb +4 -7
- data/app/helpers/spree/admin/base_helper.rb +4 -0
- data/app/helpers/spree/admin/navigation_helper.rb +4 -16
- data/app/helpers/spree/base_helper.rb +22 -3
- data/app/models/spree/activator.rb +4 -1
- data/app/models/spree/address.rb +45 -45
- data/app/models/spree/adjustment.rb +4 -4
- data/app/models/spree/app_configuration.rb +12 -0
- data/app/models/spree/calculator/default_tax.rb +1 -3
- data/app/models/spree/calculator/flat_percent_item_total.rb +0 -2
- data/app/models/spree/calculator/flat_rate.rb +0 -3
- data/app/models/spree/calculator/flexi_rate.rb +1 -3
- data/app/models/spree/calculator/per_item.rb +1 -6
- data/app/models/spree/calculator/price_sack.rb +0 -2
- data/app/models/spree/country.rb +1 -1
- data/app/models/spree/creditcard.rb +9 -10
- data/app/models/spree/gateway.rb +0 -2
- data/app/models/spree/image.rb +18 -2
- data/app/models/spree/inventory_unit.rb +4 -2
- data/app/models/spree/mail_method.rb +1 -6
- data/app/models/spree/option_type.rb +3 -1
- data/app/models/spree/order.rb +68 -62
- data/app/models/spree/payment.rb +1 -1
- data/app/models/spree/payment_method.rb +0 -6
- data/app/models/spree/product/scopes.rb +44 -44
- data/app/models/spree/product.rb +44 -26
- data/app/models/spree/product_property.rb +0 -2
- data/app/models/spree/property.rb +0 -16
- data/app/models/spree/prototype.rb +0 -1
- data/app/models/spree/return_authorization.rb +0 -2
- data/app/models/spree/shipment.rb +2 -3
- data/app/models/spree/shipping_category.rb +0 -2
- data/app/models/spree/shipping_method.rb +1 -2
- data/app/models/spree/shipping_rate.rb +9 -0
- data/app/models/spree/state.rb +10 -2
- data/app/models/spree/{state_event.rb → state_change.rb} +1 -4
- data/app/models/spree/tax_rate.rb +3 -3
- data/app/models/spree/taxon.rb +1 -6
- data/app/models/spree/taxonomy.rb +3 -6
- data/app/models/spree/user.rb +1 -0
- data/app/models/spree/variant.rb +3 -4
- data/app/models/spree/zone.rb +0 -10
- data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +1 -1
- data/app/views/spree/admin/configurations/index.html.erb +4 -0
- data/app/views/spree/admin/image_settings/edit.html.erb +91 -0
- data/app/views/spree/admin/image_settings/show.html.erb +11 -0
- data/app/views/spree/admin/images/index.html.erb +3 -3
- data/app/views/spree/admin/mail_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/mail_methods/index.html.erb +1 -1
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
- data/app/views/spree/admin/option_types/index.html.erb +1 -1
- data/app/views/spree/admin/option_types/new.js.erb +1 -1
- data/app/views/spree/admin/orders/_form.html.erb +3 -5
- data/app/views/spree/admin/orders/_line_item.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
- data/app/views/spree/admin/orders/history.html.erb +2 -2
- data/app/views/spree/admin/orders/index.html.erb +19 -19
- data/app/views/spree/admin/payment_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/payment_methods/index.html.erb +1 -3
- data/app/views/spree/admin/payments/_list.html.erb +1 -1
- data/app/views/spree/admin/product_properties/index.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +30 -27
- data/app/views/spree/admin/products/index.html.erb +9 -9
- data/app/views/spree/admin/products/new.html.erb +28 -4
- data/app/views/spree/admin/products/new.js.erb +1 -1
- data/app/views/spree/admin/properties/index.html.erb +1 -1
- data/app/views/spree/admin/properties/new.js.erb +1 -1
- data/app/views/spree/admin/prototypes/index.html.erb +1 -1
- data/app/views/spree/admin/prototypes/new.js.erb +1 -1
- data/app/views/spree/admin/prototypes/show.html.erb +42 -0
- data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
- data/app/views/spree/admin/shared/_address_form.html.erb +1 -1
- data/app/views/spree/admin/shared/_calculator_fields.html.erb +2 -2
- data/app/views/spree/admin/shared/_head.html.erb +3 -3
- data/app/views/spree/admin/shared/_order_details.html.erb +1 -1
- data/app/views/spree/admin/shared/_order_tabs.html.erb +6 -6
- data/app/views/spree/admin/shared/_product_sub_menu.html.erb +0 -1
- data/app/views/spree/admin/shared/_report_criteria.html.erb +3 -3
- data/app/views/spree/admin/shared/_tabs.html.erb +1 -1
- data/app/views/spree/admin/shared/_update_order_state.js +5 -4
- data/app/views/spree/admin/shipments/index.html.erb +1 -1
- data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/index.html.erb +1 -1
- data/app/views/spree/admin/states/_state_list.html.erb +1 -1
- data/app/views/spree/admin/states/new.js.erb +1 -1
- data/app/views/spree/admin/tax_categories/index.html.erb +2 -2
- data/app/views/spree/admin/tax_rates/index.html.erb +2 -2
- data/app/views/spree/admin/taxonomies/_list.html.erb +1 -1
- data/app/views/spree/admin/trackers/_form.html.erb +1 -1
- data/app/views/spree/admin/trackers/index.html.erb +1 -1
- data/app/views/spree/admin/users/_form.html.erb +1 -16
- data/app/views/spree/admin/users/index.html.erb +3 -4
- data/app/views/spree/admin/variants/index.html.erb +2 -2
- data/app/views/spree/admin/variants/new.js.erb +1 -1
- data/app/views/spree/admin/zones/index.html.erb +1 -1
- data/app/views/spree/checkout/_address.html.erb +1 -1
- data/app/views/spree/checkout/edit.html.erb +1 -1
- data/app/views/spree/checkout/registration.html.erb +2 -2
- data/app/views/spree/order_mailer/confirm_email.text.erb +3 -3
- data/app/views/spree/orders/show.html.erb +2 -2
- data/app/views/spree/products/_cart_form.html.erb +1 -2
- data/app/views/spree/products/_image.html.erb +1 -1
- data/app/views/spree/products/show.html.erb +3 -3
- data/app/views/spree/shared/_filters.html.erb +26 -24
- data/app/views/spree/shared/_google_analytics.html.erb +26 -26
- data/app/views/spree/shared/_products.html.erb +2 -2
- data/app/views/spree/shared/_search.html.erb +1 -1
- data/app/views/spree/shared/_store_menu.html.erb +1 -1
- data/app/views/spree/states/index.js.erb +1 -1
- data/config/initializers/rails_3_1.rb +3 -3
- data/config/locales/en.yml +40 -35
- data/config/routes.rb +5 -13
- data/db/migrate/20101026184714_migrate_transactions_to_payment_state.rb +4 -4
- data/db/migrate/20111007143030_namespace_top_level_models.rb +0 -3
- data/db/migrate/20120203001428_rename_state_events_to_state_changes.rb +9 -0
- data/db/migrate/20120315064358_migrate_images_from_products_to_variants.rb +35 -0
- data/lib/generators/spree/dummy/templates/rails/database.yml +48 -20
- data/lib/generators/spree/install/install_generator.rb +17 -1
- data/lib/generators/spree/install/templates/app/assets/javascripts/admin/all.js +0 -1
- data/lib/generators/spree/install/templates/app/assets/javascripts/store/all.js +0 -1
- data/lib/generators/spree/install/templates/app/assets/stylesheets/admin/all.css +0 -1
- data/lib/generators/spree/install/templates/app/assets/stylesheets/store/all.css +0 -1
- data/lib/generators/spree/sandbox/sandbox_generator.rb +9 -2
- data/lib/spree/core/calculated_adjustments.rb +29 -34
- data/lib/spree/core/controller_helpers.rb +36 -34
- data/lib/spree/core/custom_fixtures.rb +1 -1
- data/lib/spree/core/delegate_belongs_to.rb +22 -24
- data/lib/spree/core/engine.rb +3 -3
- data/lib/spree/core/environment_extension.rb +12 -15
- data/lib/spree/core/mail_settings.rb +1 -1
- data/lib/spree/core/permalinks.rb +24 -16
- data/lib/spree/core/preference_rescue.rb +1 -1
- data/lib/spree/core/respond_with.rb +13 -8
- data/lib/spree/core/responder.rb +1 -2
- data/lib/spree/core/search/base.rb +36 -19
- data/lib/spree/core/ssl_requirement.rb +18 -10
- data/lib/spree/core/testing_support/common_rake.rb +1 -1
- data/lib/spree/core/testing_support/factories/product_factory.rb +9 -9
- data/lib/spree/core/testing_support/factories/role_factory.rb +1 -1
- data/lib/spree/core/testing_support/factories/shipping_category_factory.rb +1 -1
- data/lib/spree/core/testing_support/factories/shipping_method_factory.rb +3 -3
- data/lib/spree/core/testing_support/factories/user_factory.rb +1 -1
- data/lib/spree/core/testing_support/factories/zone_factory.rb +4 -2
- data/lib/spree/core/validators/email.rb +23 -0
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/core.rb +2 -2
- data/lib/spree/product_filters.rb +10 -19
- data/lib/tasks/core.rake +1 -1
- data/vendor/assets/javascripts/jquery.alerts/jquery.alerts.css.erb +5 -5
- data/vendor/assets/stylesheets/jquery-ui.datepicker.css.erb +1 -1
- metadata +68 -140
- data/app/assets/images/noimage/large.png +0 -0
- data/app/controllers/spree/admin/product_groups_controller.rb +0 -49
- data/app/controllers/spree/admin/product_scopes_controller.rb +0 -39
- data/app/helpers/spree/admin/product_groups_helper.rb +0 -14
- data/app/helpers/spree/admin/product_properties_helper.rb +0 -24
- data/app/models/spree/product_group.rb +0 -200
- data/app/models/spree/product_scope.rb +0 -79
- data/app/views/spree/admin/banners/_gateway.html.erb +0 -14
- data/app/views/spree/admin/product_groups/_preview.html.erb +0 -33
- data/app/views/spree/admin/product_groups/_product_scope.html.erb +0 -24
- data/app/views/spree/admin/product_groups/edit.html.erb +0 -59
- data/app/views/spree/admin/product_groups/index.html.erb +0 -37
- data/app/views/spree/admin/product_groups/new.html.erb +0 -12
- data/app/views/spree/admin/product_groups/show.html.erb +0 -32
- data/app/views/spree/admin/product_scopes/create.js.erb +0 -6
- data/app/views/spree/admin/product_scopes/destroy.js.erb +0 -3
- data/app/views/spree/admin/product_scopes/new.html.erb +0 -1
- data/app/views/spree/admin/shared/_group_from_products_form.html.erb +0 -12
- data/db/migrate/20091012120519_product_groups_and_scopes.rb +0 -18
- data/db/migrate/20100126103714_create_products_product_groups.rb +0 -8
- data/db/migrate/20100306153445_fix_by_popularity.rb +0 -9
- data/db/migrate/20120523061241_convert_sales_tax_to_default_tax.rb +0 -9
- data/lib/spree/core/testing_support/factories/product_group_factory.rb +0 -5
- data/lib/spree/core/testing_support/factories/product_scope_factory.rb +0 -7
- data/lib/spree/core/theme_support/hook_listener.rb +0 -145
- data/lib/spree/core/theme_support.rb +0 -1
- data/vendor/assets/javascripts/jquery.alerts/jquery.alerts.css +0 -57
@@ -1,4 +1,3 @@
|
|
1
|
-
<%# encoding: utf-8 %>
|
2
1
|
//= require_self
|
3
2
|
|
4
3
|
/**
|
@@ -60,10 +59,8 @@ format_product_autocomplete = function(item){
|
|
60
59
|
}
|
61
60
|
|
62
61
|
html += "<div><h4>" + product['name'] + "</h4>";
|
63
|
-
|
64
|
-
|
65
|
-
}
|
66
|
-
html += "<span><strong><%= ::I18n.t(:on_hand) %>: </strong>" + product['count_on_hand'] + "</span></div>";
|
62
|
+
html += "<span><strong>Sku: </strong>" + product['master']['sku'] + "</span>";
|
63
|
+
html += "<span><strong>On Hand: </strong>" + product['count_on_hand'] + "</span></div>";
|
67
64
|
}else{
|
68
65
|
// variant
|
69
66
|
var variant = item.data['variant'];
|
@@ -78,12 +75,12 @@ format_product_autocomplete = function(item){
|
|
78
75
|
}
|
79
76
|
|
80
77
|
name += " - " + $.map(variant['option_values'], function(option_value){
|
81
|
-
return option_value["option_type"]["presentation"] + ": " + option_value['
|
78
|
+
return option_value["option_type"]["presentation"] + ": " + option_value['name'];
|
82
79
|
}).join(", ")
|
83
80
|
|
84
81
|
html += "<div><h4>" + name + "</h4>";
|
85
|
-
html += "<span><strong
|
86
|
-
html += "<span><strong
|
82
|
+
html += "<span><strong>Sku: </strong>" + variant['sku'] + "</span>";
|
83
|
+
html += "<span><strong>On Hand: </strong>" + variant['count_on_hand'] + "</span></div>";
|
87
84
|
}
|
88
85
|
|
89
86
|
return html
|
@@ -100,7 +97,7 @@ prep_product_autocomplete_data = function(data){
|
|
100
97
|
|
101
98
|
var name = product['name'];
|
102
99
|
name += " - " + $.map(variant['option_values'], function(option_value){
|
103
|
-
return option_value["option_type"]["presentation"] + ": " + option_value['
|
100
|
+
return option_value["option_type"]["presentation"] + ": " + option_value['name'];
|
104
101
|
}).join(", ");
|
105
102
|
|
106
103
|
return {
|
@@ -123,7 +120,7 @@ $.fn.product_autocomplete = function(){
|
|
123
120
|
return this.each(function() {
|
124
121
|
$(this).autocomplete({
|
125
122
|
source: function(request, response) {
|
126
|
-
$.get(
|
123
|
+
$.get("/admin/products.json?q=" + $('#add_product_name').val() + "&authenticity_token=" + encodeURIComponent($('meta[name=csrf-token]').attr("content")), function(data) {
|
127
124
|
result = prep_product_autocomplete_data(data)
|
128
125
|
response(result);
|
129
126
|
});
|
@@ -174,9 +171,8 @@ $.fn.objectPicker = function(url){
|
|
174
171
|
$.fn.productPicker = function(){
|
175
172
|
$(this).objectPicker(ajax_urls.product_search_basic_json);
|
176
173
|
}
|
177
|
-
|
178
174
|
$.fn.userPicker = function(){
|
179
|
-
$(this).objectPicker(ajax_urls.
|
175
|
+
$(this).objectPicker(ajax_urls.user_search_basic_json);
|
180
176
|
}
|
181
177
|
|
182
178
|
// Possible defunct
|
@@ -210,12 +206,7 @@ $(".observe_field").live('change', function() {
|
|
210
206
|
|
211
207
|
handle_date_picker_fields = function(){
|
212
208
|
$('.datepicker').datepicker({
|
213
|
-
dateFormat:
|
214
|
-
dayNames: <%= ::I18n.t(:day_names, :scope => :date).to_json %>,
|
215
|
-
dayNamesMin: <%= ::I18n.t(:abbr_day_names, :scope => :date).to_json %>,
|
216
|
-
monthNames: <%= (::I18n.t(:month_names, :scope => :date).delete_if(&:blank?)).to_json %>,
|
217
|
-
prevText: '<%= ::I18n.t(:previous) %>',
|
218
|
-
nextText: '<%= ::I18n.t(:next) %>',
|
209
|
+
dateFormat: 'yy/mm/dd',
|
219
210
|
showOn: "button",
|
220
211
|
buttonImage: "<%= asset_path 'datepicker/cal.gif' %>",
|
221
212
|
buttonImageOnly: true
|
@@ -1,14 +1,15 @@
|
|
1
1
|
$(function() {
|
2
|
-
var
|
3
|
-
|
4
|
-
$('#
|
5
|
-
|
2
|
+
var calculator_select = $('select#calc_type')
|
3
|
+
var original_calc_type = calculator_select.attr('value');
|
4
|
+
$('div#calculator-settings-warning').hide();
|
5
|
+
calculator_select.change(function() {
|
6
|
+
if (calculator_select.attr('value') == original_calc_type) {
|
6
7
|
$('div.calculator-settings').show();
|
7
|
-
$('div
|
8
|
+
$('div#calculator-settings-warning').hide();
|
8
9
|
$('.calculator-settings input').prop("disabled", false);
|
9
10
|
} else {
|
10
11
|
$('div.calculator-settings').hide();
|
11
|
-
$('div
|
12
|
+
$('div#calculator-settings-warning').show();
|
12
13
|
$('.calculator-settings input').prop("disabled", true);
|
13
14
|
}
|
14
15
|
});
|
@@ -46,7 +46,7 @@ $(document).ready(function(){
|
|
46
46
|
minChars: 5,
|
47
47
|
delay: 1500,
|
48
48
|
source: function(request, response) {
|
49
|
-
$.get(
|
49
|
+
$.get("/admin/users.json?q=" + $("#customer_search").val() + "&authenticity_token=" + encodeURIComponent($('meta[name=csrf-token]').attr("content")), function(data) {
|
50
50
|
result = prep_user_autocomplete_data(data)
|
51
51
|
response(result);
|
52
52
|
});
|
@@ -78,7 +78,6 @@ $(document).ready(function(){
|
|
78
78
|
$('#user_id').val(ui.item.data['id']);
|
79
79
|
$('#guest_checkout_true').prop("checked", false);
|
80
80
|
$('#guest_checkout_false').prop("checked", true);
|
81
|
-
$('#guest_checkout_false').prop("disabled", false);
|
82
81
|
return true;
|
83
82
|
}
|
84
83
|
}).data("autocomplete")._renderItem = function(ul, item) {
|
@@ -108,6 +107,7 @@ $(document).ready(function(){
|
|
108
107
|
$('#customer_search').val("");
|
109
108
|
$('#user_id').val("");
|
110
109
|
$('#checkout_email').val("");
|
110
|
+
$('#guest_checkout_false').prop("disabled", true);
|
111
111
|
|
112
112
|
$('#order_bill_address_attributes_firstname').val("");
|
113
113
|
$('#order_bill_address_attributes_lastname').val("");
|
@@ -0,0 +1,49 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
|
3
|
+
if ($('input#preferences_use_s3[type="checkbox"]:checked').length > 0)
|
4
|
+
$('#s3_settings').show();
|
5
|
+
|
6
|
+
// Toggle display of S3 settings based on value of use_s3 checkbox
|
7
|
+
$('input#preferences_use_s3[type="checkbox"]').click(function() {
|
8
|
+
$('#s3_settings').toggle();
|
9
|
+
});
|
10
|
+
|
11
|
+
$('.destroy_style').live("click", function() {
|
12
|
+
$(this).parent().remove();
|
13
|
+
});
|
14
|
+
|
15
|
+
$('.destroy_header').live("click", function() {
|
16
|
+
$(this).parent().remove();
|
17
|
+
});
|
18
|
+
|
19
|
+
// Handle adding new styles
|
20
|
+
var styles_hash_index = 1;
|
21
|
+
$('.add_style').click(function() {
|
22
|
+
$('#styles_list').append(generate_html_for_hash("new_attachment_styles", styles_hash_index));
|
23
|
+
});
|
24
|
+
|
25
|
+
// Handle adding new headers
|
26
|
+
var headers_hash_index = 1;
|
27
|
+
$('.add_header').click(function() {
|
28
|
+
$('#headers_list').append(generate_html_for_hash("new_s3_headers", headers_hash_index));
|
29
|
+
});
|
30
|
+
|
31
|
+
// Generates html for new paperclip styles form fields
|
32
|
+
generate_html_for_hash = function(hash_name, index) {
|
33
|
+
var html = '<li>';
|
34
|
+
html += '<label for="' + hash_name + '_' + index + '_name">';
|
35
|
+
html += 'Name</label>';
|
36
|
+
html += '<input id="' + hash_name + '_' + index + '_name" name="' + hash_name + '[' + index + '][name]" type="text">';
|
37
|
+
html += '<label for="' + hash_name + '_' + index + '_value">';
|
38
|
+
html += 'Value</label>';
|
39
|
+
html += '<input id="' + hash_name + '_' + index + '_value" name="' + hash_name + '[' + index + '][value]" type="text">';
|
40
|
+
html += '<a href="#" alt="Destroy" class="destroy_style"> x</a>';
|
41
|
+
html += '</li>';
|
42
|
+
|
43
|
+
index += 1;
|
44
|
+
return html;
|
45
|
+
};
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
});
|
@@ -1,18 +1,18 @@
|
|
1
|
-
|
1
|
+
$(document).ready(function() {
|
2
|
+
$.each($('td.qty input'), function(i, input) {
|
2
3
|
|
3
|
-
|
4
|
+
$(input).live('change', function() {
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
var id = "#" + $(this).attr('id').replace("_quantity", "_id");
|
7
|
+
console.log($(this))
|
8
|
+
console.log($(id))
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
});
|
16
|
-
|
17
|
-
}, 0,5);
|
10
|
+
jQuery.post("/admin/orders/" + $('input#order_number').val() + "/line_items/" + $(id).val(),
|
11
|
+
{ _method: "put", "line_item[quantity]": $(this).val()},
|
12
|
+
function(resp) {
|
13
|
+
$('#order-form-wrapper').html(resp.responseText);
|
14
|
+
})
|
15
|
+
})
|
16
|
+
})
|
18
17
|
});
|
18
|
+
|
@@ -313,7 +313,7 @@ body {
|
|
313
313
|
width: 24px; }
|
314
314
|
button.small {
|
315
315
|
font-size: 1em;
|
316
|
-
padding: 0
|
316
|
+
padding: 0 10px 0 10px;
|
317
317
|
}
|
318
318
|
input.title,
|
319
319
|
textarea {
|
@@ -476,25 +476,15 @@ div#calculator-settings-warning, .warning {
|
|
476
476
|
padding-right:10px;
|
477
477
|
}
|
478
478
|
|
479
|
-
ul#
|
479
|
+
ul#shipping_specs {
|
480
480
|
margin: 0;
|
481
481
|
padding-bottom:10px;
|
482
482
|
}
|
483
|
-
ul#
|
483
|
+
ul#shipping_specs li {
|
484
484
|
list-style-image:none;
|
485
485
|
display:inline;
|
486
486
|
}
|
487
487
|
|
488
|
-
.product-scopes ul > li {
|
489
|
-
float: left;
|
490
|
-
width: 220px;
|
491
|
-
margin-right: 20px;
|
492
|
-
}
|
493
|
-
|
494
|
-
.product-scopes .invalid {
|
495
|
-
background-color: red;
|
496
|
-
}
|
497
|
-
|
498
488
|
div.product-preview-products {
|
499
489
|
max-height: 200px;
|
500
490
|
overflow: auto;
|
@@ -536,50 +526,29 @@ div.product-preview-products {
|
|
536
526
|
padding-left:10px;
|
537
527
|
}
|
538
528
|
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
/* Product Groups */
|
546
|
-
|
547
|
-
table#product_scopes tr {
|
548
|
-
background-color: #eee;
|
549
|
-
|
550
|
-
}
|
551
|
-
table#product_scopes tr td {
|
552
|
-
border-top: 4px solid #fff;
|
553
|
-
border-bottom: 1px solid #bbb;
|
554
|
-
padding: 5px 10px;
|
529
|
+
.product-prototype-options,
|
530
|
+
.product-prototype-options ul {
|
531
|
+
list-style-type: none;
|
532
|
+
margin-left: 0;
|
555
533
|
}
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
}
|
560
|
-
table#product_scopes tr td table {
|
561
|
-
margin: 0;
|
534
|
+
.product-prototype-options > li {
|
535
|
+
display: block;
|
536
|
+
float: left;
|
562
537
|
width: auto;
|
563
538
|
}
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
539
|
+
.product-prototype-options > li b {
|
540
|
+
display: block;
|
541
|
+
padding-right: 30px;
|
542
|
+
margin-right: 20px;
|
543
|
+
font-size: 14px;
|
544
|
+
border-bottom: 1px solid #ddd;
|
568
545
|
}
|
569
|
-
|
570
|
-
|
571
|
-
position: relative;
|
546
|
+
.product-prototype-options > li ul {
|
547
|
+
padding: 5px 0;
|
572
548
|
}
|
573
|
-
|
574
|
-
|
575
|
-
right: 25px;
|
576
|
-
bottom: 0;
|
549
|
+
.product-prototype-options > li label {
|
550
|
+
padding-left: 5px;
|
577
551
|
}
|
578
|
-
#new_product_group_form p {
|
579
|
-
text-align: right;
|
580
|
-
margin: 0;
|
581
|
-
}
|
582
|
-
|
583
552
|
|
584
553
|
span.handle{
|
585
554
|
background-image: url(<%= asset_path 'admin/icons/switch.png' %>);
|
@@ -597,9 +566,7 @@ span.handle{
|
|
597
566
|
border: 1px solid #000;
|
598
567
|
}
|
599
568
|
|
600
|
-
.ac_results li
|
601
|
-
|
602
|
-
.ac_results li h4 { width: 100%; }
|
569
|
+
.ac_results li h4 { width: 100% }
|
603
570
|
|
604
571
|
.ac_results li:last-child { border: none; }
|
605
572
|
|
@@ -686,3 +653,18 @@ span.handle{
|
|
686
653
|
float: right;
|
687
654
|
margin-right: 25px;
|
688
655
|
}
|
656
|
+
|
657
|
+
/* Image Settings Styles */
|
658
|
+
#s3_settings {
|
659
|
+
display: none;
|
660
|
+
}
|
661
|
+
#styles_list {
|
662
|
+
list-style: none;
|
663
|
+
}
|
664
|
+
#headers_list {
|
665
|
+
list-style: none;
|
666
|
+
}
|
667
|
+
#s3_settings label, #attachment_styles label {
|
668
|
+
padding-left: 3px;
|
669
|
+
padding-right: 5px;
|
670
|
+
}
|
@@ -462,6 +462,7 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
|
|
462
462
|
margin-top: 15px;
|
463
463
|
|
464
464
|
input[type="number"] {
|
465
|
+
margin-right: 3px;
|
465
466
|
width: 60px;
|
466
467
|
vertical-align: middle;
|
467
468
|
padding: 5px;
|
@@ -474,13 +475,13 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
|
|
474
475
|
color: $link_text_color;
|
475
476
|
|
476
477
|
&.selling {
|
477
|
-
font-size: $product_detail_price_font_size;
|
478
|
+
font-size: $product_detail_price_font_size;
|
478
479
|
}
|
479
480
|
&.diff {
|
480
481
|
font-weight: bold;
|
481
482
|
}
|
482
483
|
}
|
483
|
-
|
484
|
+
|
484
485
|
.taxon-title {
|
485
486
|
font-size: $product_list_header_font_size;
|
486
487
|
}
|
@@ -490,14 +491,14 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
|
|
490
491
|
}
|
491
492
|
|
492
493
|
ul#products {
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
494
|
+
&:after {
|
495
|
+
content: " ";
|
496
|
+
display: block;
|
497
|
+
clear: both;
|
498
|
+
visibility: hidden;
|
499
|
+
line-height: 0;
|
500
|
+
height: 0;
|
501
|
+
}
|
501
502
|
|
502
503
|
li {
|
503
504
|
text-align: center;
|
@@ -513,6 +514,7 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
|
|
513
514
|
font-size: $product_list_name_font_size;
|
514
515
|
color: $product_link_text_color;
|
515
516
|
border-bottom: 1px solid lighten($body_text_color, 60);
|
517
|
+
overflow: hidden;
|
516
518
|
}
|
517
519
|
}
|
518
520
|
|
@@ -567,7 +569,7 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
|
|
567
569
|
line-height: 24px;
|
568
570
|
}
|
569
571
|
}
|
570
|
-
|
572
|
+
|
571
573
|
.taxon {
|
572
574
|
overflow: hidden;
|
573
575
|
}
|
@@ -629,6 +631,17 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
|
|
629
631
|
}
|
630
632
|
}
|
631
633
|
|
634
|
+
#cart-form {
|
635
|
+
#inside-product-cart-form:after {
|
636
|
+
content: " ";
|
637
|
+
display: block;
|
638
|
+
clear: both;
|
639
|
+
visibility: hidden;
|
640
|
+
line-height: 0;
|
641
|
+
height: 0;
|
642
|
+
}
|
643
|
+
}
|
644
|
+
|
632
645
|
/*--------------------------------------*/
|
633
646
|
/* Checkout
|
634
647
|
/*--------------------------------------*/
|
@@ -807,7 +820,7 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
|
|
807
820
|
/* Cart
|
808
821
|
/*--------------------------------------*/
|
809
822
|
table#cart-detail {
|
810
|
-
|
823
|
+
width: 100%;
|
811
824
|
tbody#line_items {
|
812
825
|
tr {
|
813
826
|
|
@@ -7,11 +7,11 @@ module Spree
|
|
7
7
|
helper 'spree/admin/navigation'
|
8
8
|
layout '/spree/layouts/admin'
|
9
9
|
|
10
|
-
before_filter :check_alerts
|
10
|
+
before_filter :check_alerts
|
11
11
|
|
12
12
|
protected
|
13
13
|
def check_alerts
|
14
|
-
return unless
|
14
|
+
return unless should_check_alerts?
|
15
15
|
|
16
16
|
unless session.has_key? :alerts
|
17
17
|
begin
|
@@ -25,7 +25,7 @@ module Spree
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def should_check_alerts?
|
28
|
-
return false if
|
28
|
+
return false if !Rails.env.production? || !Spree::Config[:check_for_spree_alerts]
|
29
29
|
|
30
30
|
last_check = Spree::Config[:last_check_for_spree_alerts]
|
31
31
|
return true if last_check.blank?
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module Spree
|
2
|
+
module Admin
|
3
|
+
class ImageSettingsController < BaseController
|
4
|
+
def show
|
5
|
+
styles = ActiveSupport::JSON.decode(Spree::Config[:attachment_styles])
|
6
|
+
@styles_list = styles.collect { |k, v| k }.join(", ")
|
7
|
+
end
|
8
|
+
|
9
|
+
def edit
|
10
|
+
@styles = ActiveSupport::JSON.decode(Spree::Config[:attachment_styles])
|
11
|
+
@headers = ActiveSupport::JSON.decode(Spree::Config[:s3_headers])
|
12
|
+
end
|
13
|
+
|
14
|
+
def update
|
15
|
+
update_styles(params)
|
16
|
+
update_headers(params) if Spree::Config[:use_s3]
|
17
|
+
|
18
|
+
Spree::Config.set(params[:preferences])
|
19
|
+
update_paperclip_settings
|
20
|
+
|
21
|
+
respond_to do |format|
|
22
|
+
format.html {
|
23
|
+
flash[:notice] = t(:image_settings_updated)
|
24
|
+
redirect_to admin_image_settings_path
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def update_styles(params)
|
33
|
+
params[:new_attachment_styles].each do |index, style|
|
34
|
+
params[:attachment_styles][style[:name]] = style[:value] unless style[:value].empty?
|
35
|
+
end if params[:new_attachment_styles].present?
|
36
|
+
|
37
|
+
styles = params[:attachment_styles]
|
38
|
+
|
39
|
+
Spree::Config[:attachment_styles] = ActiveSupport::JSON.encode(styles) unless styles.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
def update_headers(params)
|
43
|
+
params[:new_s3_headers].each do |index, header|
|
44
|
+
params[:s3_headers][header[:name]] = header[:value] unless header[:value].empty?
|
45
|
+
end if params[:new_s3_headers].present?
|
46
|
+
|
47
|
+
headers = params[:s3_headers]
|
48
|
+
|
49
|
+
Spree::Config[:s3_headers] = ActiveSupport::JSON.encode(headers) unless headers.nil?
|
50
|
+
end
|
51
|
+
|
52
|
+
def update_paperclip_settings
|
53
|
+
if Spree::Config[:use_s3]
|
54
|
+
s3_creds = { :access_key_id => Spree::Config[:s3_access_key], :secret_access_key => Spree::Config[:s3_secret], :bucket => Spree::Config[:s3_bucket] }
|
55
|
+
Spree::Image.attachment_definitions[:attachment][:storage] = :s3
|
56
|
+
Spree::Image.attachment_definitions[:attachment][:s3_credentials] = s3_creds
|
57
|
+
Spree::Image.attachment_definitions[:attachment][:s3_headers] = ActiveSupport::JSON.decode(Spree::Config[:s3_headers])
|
58
|
+
Spree::Image.attachment_definitions[:attachment][:bucket] = Spree::Config[:s3_bucket]
|
59
|
+
else
|
60
|
+
Spree::Image.attachment_definitions[:attachment].delete :storage
|
61
|
+
end
|
62
|
+
|
63
|
+
Spree::Image.attachment_definitions[:attachment][:styles] = ActiveSupport::JSON.decode(Spree::Config[:attachment_styles])
|
64
|
+
Spree::Image.attachment_definitions[:attachment][:path] = Spree::Config[:attachment_path]
|
65
|
+
Spree::Image.attachment_definitions[:attachment][:default_url] = Spree::Config[:attachment_default_url]
|
66
|
+
Spree::Image.attachment_definitions[:attachment][:default_style] = Spree::Config[:attachment_default_style]
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
@@ -17,36 +17,37 @@ module Spree
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
|
20
21
|
private
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
def location_after_save
|
24
|
+
admin_product_images_url(@product)
|
25
|
+
end
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
def load_data
|
28
|
+
@product = Product.find_by_permalink(params[:product_id])
|
29
|
+
@variants = @product.variants.collect do |variant|
|
30
|
+
[variant.options_text, variant.id]
|
31
|
+
end
|
32
|
+
@variants.insert(0, [I18n.t(:all), 'All'])
|
30
33
|
end
|
31
|
-
@variants.insert(0, [I18n.t(:all), 'All'])
|
32
|
-
end
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
def set_viewable
|
36
|
+
if params[:image].has_key? :viewable_id
|
37
|
+
if params[:image][:viewable_id] == 'All'
|
38
|
+
@image.viewable = @product.master
|
39
|
+
else
|
40
|
+
@image.viewable_type = 'Spree::Variant'
|
41
|
+
@image.viewable_id = params[:image][:viewable_id]
|
42
|
+
end
|
38
43
|
else
|
39
|
-
@image.
|
40
|
-
@image.viewable_id = params[:image][:viewable_id]
|
44
|
+
@image.viewable = @product.master
|
41
45
|
end
|
42
|
-
else
|
43
|
-
@image.viewable = @product
|
44
46
|
end
|
45
|
-
end
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
48
|
+
def destroy_before
|
49
|
+
@viewable = @image.viewable
|
50
|
+
end
|
50
51
|
|
51
52
|
end
|
52
53
|
end
|
@@ -5,7 +5,7 @@ module Spree
|
|
5
5
|
|
6
6
|
def testmail
|
7
7
|
@mail_method = Spree::MailMethod.find(params[:id])
|
8
|
-
if TestMailer.test_email(@mail_method, current_user).deliver
|
8
|
+
if TestMailer.test_email(@mail_method, respond_to?(:current_user) ? current_user : nil).deliver
|
9
9
|
flash.notice = t('admin.mail_methods.testmail.delivery_success')
|
10
10
|
else
|
11
11
|
flash[:error] = t('admin.mail_methods.testmail.delivery_error')
|
@@ -10,8 +10,8 @@ module Spree
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def edit
|
13
|
-
@order.
|
14
|
-
@order.
|
13
|
+
@order.build_bill_address(:country_id => Spree::Config[:default_country_id]) if @order.bill_address.nil?
|
14
|
+
@order.build_ship_address(:country_id => Spree::Config[:default_country_id]) if @order.ship_address.nil?
|
15
15
|
end
|
16
16
|
|
17
17
|
def update
|
@@ -9,27 +9,26 @@ module Spree
|
|
9
9
|
respond_to :html
|
10
10
|
|
11
11
|
def index
|
12
|
-
params[:
|
13
|
-
params[:
|
14
|
-
@show_only_completed = params[:
|
15
|
-
params[:
|
12
|
+
params[:q] ||= {}
|
13
|
+
params[:q][:completed_at_not_null] ||= '1' if Spree::Config[:show_only_complete_orders_by_default]
|
14
|
+
@show_only_completed = params[:q][:completed_at_not_null].present?
|
15
|
+
params[:q][:meta_sort] ||= @show_only_completed ? 'completed_at.desc' : 'created_at.desc'
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
if !params[:search][:created_at_greater_than].blank?
|
20
|
-
params[:search][:created_at_greater_than] = Time.zone.parse(params[:search][:created_at_greater_than]).beginning_of_day rescue ""
|
17
|
+
if !params[:q][:created_at_gt].blank?
|
18
|
+
params[:q][:created_at_gt] = Time.zone.parse(params[:q][:created_at_gt]).beginning_of_day rescue ""
|
21
19
|
end
|
22
20
|
|
23
|
-
if !params[:
|
24
|
-
params[:
|
21
|
+
if !params[:q][:created_at_lt].blank?
|
22
|
+
params[:q][:created_at_lt] = Time.zone.parse(params[:q][:created_at_lt]).end_of_day rescue ""
|
25
23
|
end
|
26
24
|
|
27
25
|
if @show_only_completed
|
28
|
-
params[:
|
29
|
-
params[:
|
26
|
+
params[:q][:completed_at_gt] = params[:q].delete(:created_at_gt)
|
27
|
+
params[:q][:completed_at_lt] = params[:q].delete(:created_at_lt)
|
30
28
|
end
|
31
29
|
|
32
|
-
@
|
30
|
+
@search = Order.search(params[:q])
|
31
|
+
@orders = @search.result.includes([:user, :shipments, :payments]).page(params[:page]).per(Spree::Config[:orders_per_page])
|
33
32
|
respond_with(@orders)
|
34
33
|
end
|
35
34
|
|
@@ -49,6 +48,7 @@ module Spree
|
|
49
48
|
def update
|
50
49
|
return_path = nil
|
51
50
|
if @order.update_attributes(params[:order]) && @order.line_items.present?
|
51
|
+
@order.update!
|
52
52
|
unless @order.complete?
|
53
53
|
|
54
54
|
else
|
@@ -5,7 +5,7 @@ module Spree
|
|
5
5
|
before_filter :load_data
|
6
6
|
|
7
7
|
def create
|
8
|
-
@payment_method = params[:payment_method]
|
8
|
+
@payment_method = params[:payment_method].delete(:type).constantize.new(params[:payment_method])
|
9
9
|
@object = @payment_method
|
10
10
|
invoke_callbacks(:create, :before)
|
11
11
|
if @payment_method.save
|