spree_core 1.1.2.rc1 → 1.1.2
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 +3 -16
- data/app/assets/javascripts/admin/checkouts/edit.js +4 -2
- data/app/assets/javascripts/admin/spree_core.js +2 -3
- data/app/models/spree/order.rb +0 -4
- data/app/views/spree/admin/adjustments/_form.html.erb +12 -11
- data/app/views/spree/admin/images/_form.html.erb +17 -15
- data/app/views/spree/admin/mail_methods/_form.html.erb +81 -79
- data/app/views/spree/admin/option_types/_form.html.erb +12 -10
- data/app/views/spree/admin/orders/_add_product.html.erb +5 -2
- data/app/views/spree/admin/orders/_form.html.erb +49 -47
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +44 -44
- data/app/views/spree/admin/payment_methods/_form.html.erb +46 -44
- data/app/views/spree/admin/payments/_form.html.erb +13 -11
- data/app/views/spree/admin/products/_form.html.erb +89 -87
- data/app/views/spree/admin/properties/_form.html.erb +2 -4
- data/app/views/spree/admin/prototypes/_form.html.erb +41 -39
- data/app/views/spree/admin/return_authorizations/_form.html.erb +67 -65
- data/app/views/spree/admin/shared/_head.html.erb +8 -6
- data/app/views/spree/admin/shipments/_form.html.erb +65 -63
- data/app/views/spree/admin/shipping_categories/_form.html.erb +8 -6
- data/app/views/spree/admin/states/_form.html.erb +10 -8
- data/app/views/spree/admin/tax_categories/_form.html.erb +16 -12
- data/app/views/spree/admin/tax_rates/_form.html.erb +21 -19
- data/app/views/spree/admin/taxonomies/_form.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +1 -2
- data/app/views/spree/admin/trackers/_form.html.erb +29 -27
- data/app/views/spree/admin/variants/_form.html.erb +33 -31
- data/app/views/spree/admin/zones/_form.html.erb +27 -25
- data/lib/spree/core/version.rb +1 -1
- metadata +36 -34
- data/app/assets/javascripts/admin/spree.routes.js.erb +0 -30
@@ -123,7 +123,7 @@ $.fn.product_autocomplete = function(){
|
|
123
123
|
return this.each(function() {
|
124
124
|
$(this).autocomplete({
|
125
125
|
source: function(request, response) {
|
126
|
-
$.get(Spree.routes.
|
126
|
+
$.get(Spree.routes.product_search + '?' + jQuery.param({ q: $('#add_product_name').val(), authenticity_token: encodeURIComponent($('meta[name=csrf-token]').attr("content"))}), function(data) {
|
127
127
|
result = prep_product_autocomplete_data(data)
|
128
128
|
response(result);
|
129
129
|
});
|
@@ -172,25 +172,12 @@ $.fn.objectPicker = function(url){
|
|
172
172
|
};
|
173
173
|
|
174
174
|
$.fn.productPicker = function(){
|
175
|
-
$(this).objectPicker(
|
175
|
+
$(this).objectPicker(Spree.routes.product_search_basic);
|
176
176
|
}
|
177
177
|
$.fn.userPicker = function(){
|
178
|
-
$(this).objectPicker(
|
178
|
+
$(this).objectPicker(Spree.routes.user_search);
|
179
179
|
}
|
180
180
|
|
181
|
-
// Possible defunct
|
182
|
-
add_fields = function(target, association, content) {
|
183
|
-
var new_id = new Date().getTime();
|
184
|
-
var regexp = new RegExp("new_" + association, "g");
|
185
|
-
$(target).append(content.replace(regexp, new_id));
|
186
|
-
}
|
187
|
-
|
188
|
-
$('a.remove_fields').on('click', function() {
|
189
|
-
$(this).prev("input[type=hidden]").val("1");
|
190
|
-
$(this).closest(".fields").hide();
|
191
|
-
return false;
|
192
|
-
});
|
193
|
-
|
194
181
|
$(".observe_field").on('change', function() {
|
195
182
|
target = $(this).attr("data-update");
|
196
183
|
ajax_indicator = $(this).attr("data-ajax-indicator") || '#busy_indicator';
|
@@ -46,7 +46,9 @@ $(document).ready(function(){
|
|
46
46
|
minChars: 5,
|
47
47
|
delay: 1500,
|
48
48
|
source: function(request, response) {
|
49
|
-
|
49
|
+
var params = { q: $('#customer_search').val(),
|
50
|
+
authenticity_token: encodeURIComponent($('meta[name=csrf-token]').attr("content")) }
|
51
|
+
$.get(Spree.routes.user_search + '&' + jQuery.param(params), function(data) {
|
50
52
|
result = prep_user_autocomplete_data(data)
|
51
53
|
response(result);
|
52
54
|
});
|
@@ -78,6 +80,7 @@ $(document).ready(function(){
|
|
78
80
|
$('#user_id').val(ui.item.data['id']);
|
79
81
|
$('#guest_checkout_true').prop("checked", false);
|
80
82
|
$('#guest_checkout_false').prop("checked", true);
|
83
|
+
$('#guest_checkout_false').prob("disabled", false);
|
81
84
|
return true;
|
82
85
|
}
|
83
86
|
}).data("autocomplete")._renderItem = function(ul, item) {
|
@@ -107,7 +110,6 @@ $(document).ready(function(){
|
|
107
110
|
$('#customer_search').val("");
|
108
111
|
$('#user_id').val("");
|
109
112
|
$('#checkout_email').val("");
|
110
|
-
$('#guest_checkout_false').prop("disabled", true);
|
111
113
|
|
112
114
|
$('#order_bill_address_attributes_firstname').val("");
|
113
115
|
$('#order_bill_address_attributes_lastname').val("");
|
data/app/models/spree/order.rb
CHANGED
@@ -413,10 +413,6 @@ module Spree
|
|
413
413
|
ShippingMethod.all_available(self, display_on)
|
414
414
|
end
|
415
415
|
|
416
|
-
def available_payment_methods(display_on = nil)
|
417
|
-
PaymentMethod.all(display_on)
|
418
|
-
end
|
419
|
-
|
420
416
|
def rate_hash
|
421
417
|
@rate_hash ||= available_shipping_methods(:front_end).collect do |ship_method|
|
422
418
|
next unless cost = ship_method.calculator.compute(self)
|
@@ -1,12 +1,13 @@
|
|
1
|
-
|
2
|
-
<%= f.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<%= f.field_container :label do %>
|
8
|
-
<%= f.label :label, t(:description) %> <span class="required">*</span><br />
|
9
|
-
<%= text_field :adjustment, :label, {:style => 'width:180px;'} %>
|
10
|
-
<%= f.error_message_on :label %>
|
11
|
-
<% end %>
|
1
|
+
<div data-hook="admin_adjustment_form_fields">
|
2
|
+
<%= f.field_container :amount do %>
|
3
|
+
<%= f.label :amount, t(:amount) %> <span class="required">*</span><br />
|
4
|
+
<%= text_field :adjustment, :amount, {:style => 'width:80px;'} %>
|
5
|
+
<%= f.error_message_on :amount %>
|
6
|
+
<% end %>
|
12
7
|
|
8
|
+
<%= f.field_container :label do %>
|
9
|
+
<%= f.label :label, t(:description) %> <span class="required">*</span><br />
|
10
|
+
<%= text_field :adjustment, :label, {:style => 'width:180px;'} %>
|
11
|
+
<%= f.error_message_on :label %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
@@ -1,16 +1,18 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
<% if @product.has_variants? %>
|
6
|
-
<tr data-hook="variant">
|
7
|
-
<td><%= Spree::Variant.model_name.human %>:</td>
|
8
|
-
<td><%= f.select :viewable_id, @variants %></td>
|
1
|
+
<div data-hook="admin_image_form_fields">
|
2
|
+
<tr data-hook="file">
|
3
|
+
<td><%= t(:filename) %>:</td>
|
4
|
+
<td><%= f.file_field :attachment %></td>
|
9
5
|
</tr>
|
10
|
-
<%
|
11
|
-
|
12
|
-
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
<% if @product.has_variants? %>
|
7
|
+
<tr data-hook="variant">
|
8
|
+
<td><%= Spree::Variant.model_name.human %>:</td>
|
9
|
+
<td><%= f.select :viewable_id, @variants %></td>
|
10
|
+
</tr>
|
11
|
+
<% else %>
|
12
|
+
<%= hidden_field_tag :product_id, @product.id %>
|
13
|
+
<% end %>
|
14
|
+
<tr data-hook="alt_text">
|
15
|
+
<td><%= t(:alt_text) %>:</td>
|
16
|
+
<td><%= f.text_area :alt %></td>
|
17
|
+
</tr>
|
18
|
+
</div>
|
@@ -1,90 +1,92 @@
|
|
1
|
-
<div
|
2
|
-
<div class="
|
3
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
<div data-hook="admin_mail_method_form_fields">
|
2
|
+
<div class="clearfix">
|
3
|
+
<div class="left" data-hook="general">
|
4
|
+
<fieldset>
|
5
|
+
<legend><%= t(:general) %></legend>
|
6
|
+
<p>
|
7
|
+
<%= f.label :environment, t(:environment) %><br />
|
8
|
+
<%= f.collection_select(:environment,
|
9
|
+
Rails.configuration.database_configuration.keys.sort,
|
10
|
+
:to_s, :titleize,
|
11
|
+
{}, {:id => 'gtwy-env'}) %>
|
12
|
+
</p>
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
<p>
|
15
|
+
<%= f.check_box :preferred_enable_mail_delivery, {:style => "vertical-align:middle;"} %>
|
16
|
+
<%= f.label :preferred_enable_mail_delivery, t(:enable_mail_delivery) %>
|
17
|
+
</p>
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
<p>
|
20
|
+
<%= f.label :preferred_mails_from, t(:send_mails_as) %><br />
|
21
|
+
<%= f.text_field :preferred_mails_from, :size => 40, :maxlength => 256 %>
|
22
|
+
<br />
|
23
|
+
<span class="info">
|
24
|
+
<%= t(:smtp_send_all_emails_as_from_following_address) %>
|
25
|
+
</span>
|
26
|
+
</p>
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
<p>
|
29
|
+
<%= f.label :preferred_mail_bcc, t(:send_copy_of_all_mails_to) %><br />
|
30
|
+
<%= f.text_field :preferred_mail_bcc, :size => 40, :maxlength => 256 %>
|
31
|
+
<br />
|
32
|
+
<span class="info">
|
33
|
+
<%= t(:smtp_send_copy_to_this_addresses) %>
|
34
|
+
</span>
|
35
|
+
</p>
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
<p>
|
38
|
+
<%= f.label :preferred_intercept_email, t(:intercept_email_address) %><br />
|
39
|
+
<%= f.text_field :preferred_intercept_email, :size => 40, :maxlength => 256 %>
|
40
|
+
<br />
|
41
|
+
<span class="info">
|
42
|
+
<%= t(:intercept_email_instructions) %>
|
43
|
+
</span>
|
44
|
+
</p>
|
44
45
|
|
45
|
-
|
46
|
+
</fieldset>
|
46
47
|
|
47
|
-
|
48
|
+
</div>
|
48
49
|
|
49
|
-
|
50
|
+
<div class="right" data-hook="smtp">
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
52
|
+
<fieldset>
|
53
|
+
<legend><%= t(:smtp) %></legend>
|
54
|
+
<p>
|
55
|
+
<%= f.label :preferred_mail_domain, t(:smtp_domain) %><br />
|
56
|
+
<%= f.text_field :preferred_mail_domain %>
|
57
|
+
</p>
|
58
|
+
<p>
|
59
|
+
<%= f.label :preferred_mail_host, t(:smtp_mail_host) %><br />
|
60
|
+
<%= f.text_field :preferred_mail_host %>
|
61
|
+
</p>
|
62
|
+
<p>
|
63
|
+
<%= f.label :preferred_mail_port, t(:smtp_port) %><br />
|
64
|
+
<%= f.text_field :preferred_mail_port %>
|
65
|
+
</p>
|
66
|
+
<p>
|
67
|
+
<%= f.label :preferred_secure_connection_type, t(:secure_connection_type) %><br />
|
68
|
+
<%= f.collection_select(:preferred_secure_connection_type,
|
69
|
+
Spree::MailMethod::SECURE_CONNECTION_TYPES,
|
70
|
+
:to_s, :to_s,
|
71
|
+
{}, {'style' => 'width:200px'}) %>
|
72
|
+
<p>
|
73
|
+
<%= f.label :preferred_mail_auth_type, t(:smtp_authentication_type) %><br />
|
74
|
+
<%= f.collection_select(:preferred_mail_auth_type,
|
75
|
+
Spree::MailMethod::MAIL_AUTH,
|
76
|
+
:to_s, :to_s,
|
77
|
+
{}, {'style' => 'width:200px'}) %>
|
78
|
+
</p>
|
79
|
+
<p>
|
80
|
+
<%= f.label :preferred_smtp_username, t(:smtp_username) %><br />
|
81
|
+
<%= f.text_field :preferred_smtp_username %>
|
82
|
+
</p>
|
83
|
+
<p>
|
84
|
+
<%= f.label :preferred_smtp_password, t(:smtp_password) %><br />
|
85
|
+
<%= f.password_field :preferred_smtp_password %>
|
86
|
+
</p>
|
87
|
+
</fieldset>
|
87
88
|
|
88
|
-
|
89
|
+
</div>
|
89
90
|
|
91
|
+
</div>
|
90
92
|
</div>
|
@@ -1,11 +1,13 @@
|
|
1
|
-
|
2
|
-
<%= f.
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<div data-hook="admin_option_type_form_fields">
|
2
|
+
<%= f.field_container :name do %>
|
3
|
+
<%= f.label :name, t(:name) %> <span class="required">*</span><br />
|
4
|
+
<%= f.text_field :name %>
|
5
|
+
<%= f.error_message_on :name %>
|
6
|
+
<% end %>
|
6
7
|
|
7
|
-
<%= f.field_container :presentation do %>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<% end %>
|
8
|
+
<%= f.field_container :presentation do %>
|
9
|
+
<%= f.label :presentation, t(:presentation) %> <span class="required">*</span><br />
|
10
|
+
<%= f.text_field :presentation %>
|
11
|
+
<%= f.error_message_on :presentation %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
@@ -12,8 +12,11 @@
|
|
12
12
|
</div>
|
13
13
|
<div style="float: left; width: 15%; padding-top: 17px;" data-hook="add_button">
|
14
14
|
<%= link_to text_for_button_link(t(:add), :icon => 'add'),
|
15
|
-
|
16
|
-
|
15
|
+
admin_order_line_items_url(@order),
|
16
|
+
:method => :post,
|
17
|
+
:id => 'add_line_item_to_order',
|
18
|
+
:class => 'button',
|
19
|
+
'data-update' => 'order-form-wrapper' %>
|
17
20
|
</div>
|
18
21
|
|
19
22
|
</fieldset>
|
@@ -1,54 +1,56 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
<div data-hook="admin_order_form_fields">
|
2
|
+
<% if @line_item.try(:errors).present? %>
|
3
|
+
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @line_item } %>
|
4
|
+
<% end %>
|
4
5
|
|
5
|
-
<%= form_for @order, :url => admin_order_url(@order), :method => :put do |f| %>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
6
|
+
<%= form_for @order, :url => admin_order_url(@order), :method => :put do |f| %>
|
7
|
+
<%= f.hidden_field :number %>
|
8
|
+
<table class="index">
|
9
|
+
<tbody id="line-items">
|
10
|
+
<tr data-hook="admin_order_form_line_items_headers">
|
11
|
+
<th><%= t(:item_description) %></th>
|
12
|
+
<th class="price"><%= t(:price) %></th>
|
13
|
+
<th class="qty"><%= t(:qty) %></th>
|
14
|
+
<th class="total"><span><%= t(:total) %></span></th>
|
15
|
+
<th class="orders-actions" data-hook="admin_order_form_line_items_header_actions"></th>
|
16
|
+
</tr>
|
17
|
+
<%= f.fields_for :line_items do |li_form| %>
|
18
|
+
<%= render :partial => 'spree/admin/orders/line_item', :locals => { :f => li_form } %>
|
19
|
+
<% end %>
|
20
|
+
</tbody>
|
21
|
+
<tbody id="subtotal" data-hook="admin_order_form_subtotal">
|
22
|
+
<tr id="subtotal-row">
|
23
|
+
<td colspan="3"><b><%= t(:subtotal) %>:</b></td>
|
24
|
+
<td class="total"><span><%= number_to_currency @order.item_total %></span></td>
|
25
|
+
<td></td>
|
26
|
+
</tr>
|
27
|
+
</tbody>
|
28
|
+
<tbody id="order-charges" data-hook="admin_order_form_adjustments">
|
29
|
+
<% @order.adjustments.each do |adjustment| %>
|
30
|
+
<tr>
|
31
|
+
<td colspan="3"><strong><%= adjustment.label %></strong></td>
|
32
|
+
<td class="total"><span><%= number_to_currency adjustment.amount %></span></td>
|
33
|
+
<td></td>
|
34
|
+
</tr>
|
35
|
+
<% end %>
|
36
|
+
</tbody>
|
37
|
+
<tbody id="order-total" data-hook="admin_order_form_total">
|
29
38
|
<tr>
|
30
|
-
<td colspan="3"><
|
31
|
-
<td class="total"><span><%= number_to_currency
|
39
|
+
<td colspan="3"><b><%= t(:order_total) %>:</b></td>
|
40
|
+
<td class="total"><span id="order_total"><%= number_to_currency @order.total %></span></td>
|
32
41
|
<td></td>
|
33
42
|
</tr>
|
34
|
-
|
35
|
-
</
|
36
|
-
<tbody id="order-total" data-hook="admin_order_form_total">
|
37
|
-
<tr>
|
38
|
-
<td colspan="3"><b><%= t(:order_total) %>:</b></td>
|
39
|
-
<td class="total"><span id="order_total"><%= number_to_currency @order.total %></span></td>
|
40
|
-
<td></td>
|
41
|
-
</tr>
|
42
|
-
</tbody>
|
43
|
-
</table>
|
43
|
+
</tbody>
|
44
|
+
</table>
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
<p class="form-buttons" data-hook="admin_order_form_buttons">
|
47
|
+
<%= button t(:update) %>
|
48
|
+
<%= t(:or) %> <%= link_to t(:back), admin_orders_url %>
|
49
|
+
</p>
|
49
50
|
|
50
|
-
<% end %>
|
51
|
+
<% end %>
|
51
52
|
|
52
|
-
<%= javascript_tag do -%>
|
53
|
-
|
54
|
-
<% end -%>
|
53
|
+
<%= javascript_tag do -%>
|
54
|
+
<%= render :partial => 'spree/admin/shared/update_order_state', :handlers => [:js] %>
|
55
|
+
<% end -%>
|
56
|
+
</div>
|