caboose-cms 0.8.69 → 0.8.71
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/caboose/admin_edit_invoice.js +8 -6
- data/app/assets/javascripts/caboose/block_content_controller.js +14 -0
- data/app/assets/javascripts/caboose/block_modal_controllers/block_modal_controller.js +18 -1
- data/app/assets/javascripts/caboose/checkout/cart_controller.js +1 -1
- data/app/assets/javascripts/caboose/checkout/checkout_controller.js +29 -7
- data/app/assets/javascripts/caboose/checkout/shipping_address_controller.js +8 -5
- data/app/assets/javascripts/caboose/checkout/shipping_method_controller.js +6 -3
- data/app/assets/javascripts/caboose/checkout/stripe_payment_method_controller.js +52 -2
- data/app/assets/javascripts/caboose/model/bound_text.js +2 -0
- data/app/assets/stylesheets/caboose/admin_main.css +2 -2
- data/app/assets/stylesheets/caboose/model_binder.css +8 -2
- data/app/controllers/caboose/blocks_controller.rb +11 -0
- data/app/controllers/caboose/checkout_controller.rb +65 -5
- data/app/controllers/caboose/checkout_controller_bak.rb +22 -0
- data/app/controllers/caboose/my_account_invoices_controller.rb +1 -1
- data/app/controllers/caboose/store_controller.rb +1 -0
- data/app/models/caboose/block.rb +32 -0
- data/app/models/caboose/invoice_package.rb +2 -1
- data/app/models/caboose/schema.rb +8 -5
- data/app/models/caboose/shipping_package.rb +2 -1
- data/app/models/caboose/store_config.rb +2 -1
- data/app/views/caboose/admin/index.html.erb +0 -1
- data/app/views/caboose/checkout/checkout.html.erb +5 -0
- data/app/views/caboose/invoices/admin_index.html.erb +1 -1
- data/app/views/caboose/invoices_mailer/customer_new_invoice.html.erb +8 -4
- data/app/views/caboose/pages/admin_edit_content.html.erb +4 -1
- data/app/views/caboose/posts/admin_edit_content.html.erb +4 -1
- data/app/views/caboose/store/_admin_header.html.erb +1 -0
- data/app/views/caboose/store/admin_edit_shipping.html.erb +27 -25
- data/lib/caboose/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c2bdccd0f70ac5bf7db43d791b2daee4365bc25
|
4
|
+
data.tar.gz: ff312c0a6e625462f187b4fd4a2b7cd76350126b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad4ea9b173b2063b471ba237017687fdfad81d034058b745ad8ee763b75aaed737c4c880369d8b5989f1990918f589c4bcc0b4bfbdab0e35e60569da556091b1
|
7
|
+
data.tar.gz: 23cbd2e369ef1ba6bd0c5b52a761a026448e42f9c4ffcb760aecbf4bd9c0ee2d69a071f2d7fa49bcc8ef18c5a4ed09f5931890142562d255e7e0fcb367175fd0
|
@@ -78,11 +78,12 @@ InvoiceController.prototype = {
|
|
78
78
|
id: op.id,
|
79
79
|
update_url: '/admin/invoices/' + op.invoice_id + '/packages/' + op.id,
|
80
80
|
authenticity_token: that.authenticity_token,
|
81
|
-
attributes: [
|
82
|
-
{ name: '
|
83
|
-
{ name: '
|
84
|
-
{ name: '
|
85
|
-
{ name: '
|
81
|
+
attributes: [
|
82
|
+
{ name: 'instore_pickup' , nice_name: 'In-store Pickup' , type: 'checkbox' , value: op.instore_pickup , width: 300, fixed_placeholder: true },
|
83
|
+
{ name: 'status' , nice_name: 'Status' , type: 'select' , value: op.status , width: 300, fixed_placeholder: true , options_url: '/admin/invoices/line-items/status-options' },
|
84
|
+
{ name: 'package_method' , nice_name: 'Package/Method' , type: 'select' , value: op.shipping_package_id + '_' + op.shipping_method_id , width: 300, fixed_placeholder: false, options_url: '/admin/shipping-packages/package-method-options' },
|
85
|
+
{ name: 'tracking_number' , nice_name: 'Tracking Number' , type: 'text' , value: op.tracking_number , width: 300, fixed_placeholder: true, align: 'right' },
|
86
|
+
{ name: 'total' , nice_name: 'Shipping Total' , type: 'text' , value: curr(op.total) , width: 300, fixed_placeholder: true, align: 'right' , after_update: function() { that.refresh_invoice(); }}
|
86
87
|
]
|
87
88
|
});
|
88
89
|
});
|
@@ -555,7 +556,8 @@ InvoiceController.prototype = {
|
|
555
556
|
total_weight += li.variant.weight * li.quantity;
|
556
557
|
});
|
557
558
|
|
558
|
-
var div = $('<div/>');
|
559
|
+
var div = $('<div/>');
|
560
|
+
div.append($('<div/>').attr('id', 'invoicepackage_' + op.id + '_instore_pickup'));
|
559
561
|
div.append($('<div/>').attr('id', 'invoicepackage_' + op.id + '_package_method'));
|
560
562
|
div.append($('<div/>').attr('id', 'invoicepackage_' + op.id + '_status'));
|
561
563
|
div.append($('<div/>').attr('id', 'invoicepackage_' + op.id + '_tracking_number'));
|
@@ -170,6 +170,19 @@ BlockContentController.prototype = {
|
|
170
170
|
}
|
171
171
|
});
|
172
172
|
},
|
173
|
+
|
174
|
+
duplicate_block: function(block_id)
|
175
|
+
{
|
176
|
+
var that = this;
|
177
|
+
that.loadify($('#block_' + block_id + '_duplicate_handle span'));
|
178
|
+
$.ajax({
|
179
|
+
url: that.base_url() + '/' + block_id + '/duplicate',
|
180
|
+
type: 'put',
|
181
|
+
success: function(resp) {
|
182
|
+
if (resp.success) that.render_blocks(function() { that.stop_loadify(); });
|
183
|
+
}
|
184
|
+
});
|
185
|
+
},
|
173
186
|
|
174
187
|
loadify: function(el)
|
175
188
|
{
|
@@ -233,6 +246,7 @@ BlockContentController.prototype = {
|
|
233
246
|
$('#block_' + b.id + ' *').attr('onclick', '').unbind('click');
|
234
247
|
$('#block_' + b.id)
|
235
248
|
.prepend($('<a/>').attr('id', 'block_' + b.id + '_select_handle' ).addClass('select_handle' ).append($('<span/>').addClass('ui-icon ui-icon-check' )).click(function(e) { e.preventDefault(); e.stopPropagation(); that.select_block(b.id); }))
|
249
|
+
.prepend($('<a/>').attr('id', 'block_' + b.id + '_duplicate_handle' ).addClass('duplicate_handle' ).append($('<span/>').addClass('ui-icon ui-icon-copy' )).click(function(e) { e.preventDefault(); e.stopPropagation(); that.duplicate_block(b.id); }))
|
236
250
|
.prepend($('<a/>').attr('id', 'block_' + b.id + '_move_up_handle' ).addClass('move_up_handle' ).append($('<span/>').addClass('ui-icon ui-icon-arrow-1-n' )).click(function(e) { e.preventDefault(); e.stopPropagation(); that.move_block_up(b.id); }))
|
237
251
|
.prepend($('<a/>').attr('id', 'block_' + b.id + '_move_down_handle' ).addClass('move_down_handle' ).append($('<span/>').addClass('ui-icon ui-icon-arrow-1-s' )).click(function(e) { e.preventDefault(); e.stopPropagation(); that.move_block_down(b.id); }))
|
238
252
|
.prepend($('<a/>').attr('id', 'block_' + b.id + '_delete_handle' ).addClass('delete_handle' ).append($('<span/>').addClass('ui-icon ui-icon-close' )).click(function(e) { e.preventDefault(); e.stopPropagation(); that.delete_block(b.id); }));
|
@@ -129,7 +129,8 @@ var BlockModalController = ModalController.extend({
|
|
129
129
|
.append($('<input/>').attr('type', 'button').addClass('btn').val('Close').click(function() { that.close(); that.parent_controller.render_blocks(); })).append(' ');
|
130
130
|
if (!that.block.name)
|
131
131
|
{
|
132
|
-
p.append($('<input/>').attr('type', 'button').addClass('btn').val('Delete Block').click(function() { that.delete_block(); })).append(' ');
|
132
|
+
p.append($('<input/>').attr('type', 'button').addClass('btn').val('Delete Block').click(function() { that.delete_block(); })).append(' ');
|
133
|
+
p.append($('<input/>').attr('type', 'button').addClass('btn').val('Duplicate Block').click(function() { that.duplicate_block(); })).append(' ');
|
133
134
|
}
|
134
135
|
p.append($('<input/>').attr('type', 'button').addClass('btn').val('Move Up' ).click(function() { that.move_up(); })).append(' ');
|
135
136
|
p.append($('<input/>').attr('type', 'button').addClass('btn').val('Move Down' ).click(function() { that.move_down(); })).append(' ');
|
@@ -441,6 +442,22 @@ var BlockModalController = ModalController.extend({
|
|
441
442
|
}
|
442
443
|
});
|
443
444
|
},
|
445
|
+
|
446
|
+
duplicate_block: function()
|
447
|
+
{
|
448
|
+
var that = this;
|
449
|
+
that.autosize("<p class='loading'>Duplicating...</p>");
|
450
|
+
$.ajax({
|
451
|
+
url: that.block_url(that.block) + '/duplicate',
|
452
|
+
type: 'put',
|
453
|
+
success: function(resp) {
|
454
|
+
if (resp.success) {
|
455
|
+
that.autosize("<p class='note success'>Duplicated block.</p>");
|
456
|
+
that.parent_controller.render_blocks();
|
457
|
+
}
|
458
|
+
}
|
459
|
+
});
|
460
|
+
},
|
444
461
|
|
445
462
|
move_up: function()
|
446
463
|
{
|
@@ -184,7 +184,7 @@ CartController.prototype = {
|
|
184
184
|
var that = this;
|
185
185
|
|
186
186
|
tbody.append($('<tr/>')
|
187
|
-
.append($('<th/>').addClass('invoice_totals_header').attr('colspan', '4').html('<h3>
|
187
|
+
.append($('<th/>').addClass('invoice_totals_header').attr('colspan', '4').html('<h3>Order Totals</h3>')));
|
188
188
|
tbody.append($('<tr/>')
|
189
189
|
.append($('<td/>').css('text-align', 'right').attr('colspan', 3).html('Subtotal'))
|
190
190
|
.append($('<td/>').css('text-align', 'right').attr('id', 'totals_subtotal').html('$' + parseFloat(that.cc.invoice.subtotal).toFixed(2)))
|
@@ -40,7 +40,7 @@ CheckoutController.prototype = {
|
|
40
40
|
for (var i in params)
|
41
41
|
that[i] = params[i];
|
42
42
|
|
43
|
-
that.gift_cards_controller = new GiftCardsController({ cc: that });
|
43
|
+
that.gift_cards_controller = new GiftCardsController({ cc: that });
|
44
44
|
that.shipping_address_controller = new ShippingAddressController({ cc: that });
|
45
45
|
if (that.pp_name == 'stripe') that.payment_method_controller = new StripePaymentMethodController({ cc: that });
|
46
46
|
//else if (that.pp_name == 'authnet') that.payment_method_controller = new AuthnetPaymentMethodController({ cc: that });
|
@@ -125,7 +125,8 @@ CheckoutController.prototype = {
|
|
125
125
|
{
|
126
126
|
var that = this;
|
127
127
|
var div = $('<div/>')
|
128
|
-
.append($('<h2/>').html(confirm ? 'Confirm
|
128
|
+
.append($('<h2/>').html(confirm ? 'Confirm Order' : 'Checkout'))
|
129
|
+
.append($('<div/>').attr('id', 'invoice_1_instore_pickup' ))
|
129
130
|
.append($('<section/>').attr('id', 'shipping_address_container'))
|
130
131
|
.append($('<section/>').attr('id', 'cart'))
|
131
132
|
.append($('<section/>').attr('id', 'gift_cards_container'))
|
@@ -133,6 +134,27 @@ CheckoutController.prototype = {
|
|
133
134
|
.append($('<div/>').attr('id', 'message'));
|
134
135
|
$('#'+that.container).empty().append(div);
|
135
136
|
|
137
|
+
that.model_binder = new ModelBinder({
|
138
|
+
name: 'Invoice',
|
139
|
+
id: 1,
|
140
|
+
update_url: '/checkout/invoice',
|
141
|
+
authenticity_token: that.authenticity_token,
|
142
|
+
attributes: [
|
143
|
+
{ name: 'instore_pickup', nice_name: 'In-store Pickup', type: 'checkbox' , value: that.invoice.instore_pickup, fixed_placeholder: true,
|
144
|
+
//before_update: function() { this.value_old = this.value_clean; },
|
145
|
+
after_update: function() {
|
146
|
+
var arr = ['shipping_address_container'];
|
147
|
+
$.each(that.invoice.invoice_packages, function(i, ip) {
|
148
|
+
arr.push('invoice_package_' + ip.id + '_shipping_method');
|
149
|
+
});
|
150
|
+
if (parseInt(this.value) == 0) $.each(arr, function(i, el) { $('#'+el).slideDown(); });
|
151
|
+
else $.each(arr, function(i, el) { $('#'+el).slideUp(); });
|
152
|
+
that.print_ready_message();
|
153
|
+
}
|
154
|
+
}
|
155
|
+
]
|
156
|
+
});
|
157
|
+
|
136
158
|
if (confirm)
|
137
159
|
{
|
138
160
|
that.gift_cards_controller.print();
|
@@ -147,7 +169,7 @@ CheckoutController.prototype = {
|
|
147
169
|
that.gift_cards_controller.edit();
|
148
170
|
that.shipping_address_controller.edit();
|
149
171
|
if (that.invoice.payment_terms == 'pia')
|
150
|
-
that.payment_method_controller.
|
172
|
+
that.payment_method_controller.print_or_edit_if_empty();
|
151
173
|
that.cart_controller.print();
|
152
174
|
that.print_ready_message();
|
153
175
|
}
|
@@ -187,7 +209,7 @@ CheckoutController.prototype = {
|
|
187
209
|
|
188
210
|
$('#message').empty().append($('<p/>')
|
189
211
|
.append($('<input/>').attr('type', 'button').val('Make Changes' ).click(function(e) { that.print(); })).append(' ')
|
190
|
-
.append($('<input/>').attr('type', 'button').val('Confirm
|
212
|
+
.append($('<input/>').attr('type', 'button').val('Confirm Order').click(function(e) { that.confirm_invoice(); }))
|
191
213
|
);
|
192
214
|
},
|
193
215
|
|
@@ -199,11 +221,11 @@ CheckoutController.prototype = {
|
|
199
221
|
{
|
200
222
|
var that = this;
|
201
223
|
|
202
|
-
$('#message').html("<p class='loading'>Verifying
|
224
|
+
$('#message').html("<p class='loading'>Verifying order total...</p>");
|
203
225
|
var t = $.ajax_value('/checkout/total');
|
204
226
|
if (parseFloat(t) != that.invoice.total)
|
205
227
|
{
|
206
|
-
$('#message').html("<p class='note error'>It looks like the
|
228
|
+
$('#message').html("<p class='note error'>It looks like the order total has changed since this was loaded. Please submit your order again after this page refreshes.</p>");
|
207
229
|
setTimeout(function() { window.location.reload(true); }, 3000);
|
208
230
|
return;
|
209
231
|
}
|
@@ -220,7 +242,7 @@ CheckoutController.prototype = {
|
|
220
242
|
.append($('<p/>').addClass('note error').append(resp.error))
|
221
243
|
.append($('<p/>')
|
222
244
|
.append($('<input/>').attr('type', 'button').val('Make Changes' ).click(function(e) { that.print(); })).append(' ')
|
223
|
-
.append($('<input/>').attr('type', 'button').val('Confirm
|
245
|
+
.append($('<input/>').attr('type', 'button').val('Confirm Order').click(function(e) { that.confirm_invoice(); }))
|
224
246
|
);
|
225
247
|
}
|
226
248
|
}
|
@@ -27,7 +27,7 @@ ShippingAddressController.prototype = {
|
|
27
27
|
var sa = that.cc.invoice.shipping_address;
|
28
28
|
|
29
29
|
var div = $('<div/>').append($('<h3/>').html('Shipping Address'));
|
30
|
-
|
30
|
+
|
31
31
|
if (that.cc.is_empty_address(sa))
|
32
32
|
div.append($('<p/>').append('[Empty]'));
|
33
33
|
else
|
@@ -46,6 +46,7 @@ ShippingAddressController.prototype = {
|
|
46
46
|
|
47
47
|
div.append($('<p/>').append($('<a/>').attr('href', '#').html('Edit').click(function(e) { e.preventDefault(); that.cc.refresh_and_print(); })));
|
48
48
|
$('#shipping_address_container').empty().append(div);
|
49
|
+
if (that.cc.invoice.instore_pickup) $('#shipping_address_container').css('display', 'none');
|
49
50
|
},
|
50
51
|
|
51
52
|
edit: function()
|
@@ -61,7 +62,7 @@ ShippingAddressController.prototype = {
|
|
61
62
|
var sa = that.cc.invoice.shipping_address;
|
62
63
|
if (!sa.id) sa.id = 1;
|
63
64
|
|
64
|
-
var div = $('<div/>')
|
65
|
+
var div = $('<div/>')
|
65
66
|
.append($('<h3/>').html('Shipping Address'))
|
66
67
|
.append($('<div/>').attr('id', 'shippingaddress_' + sa.id + '_first_name' ))
|
67
68
|
.append($('<div/>').attr('id', 'shippingaddress_' + sa.id + '_last_name' ))
|
@@ -70,8 +71,9 @@ ShippingAddressController.prototype = {
|
|
70
71
|
.append($('<div/>').attr('id', 'shippingaddress_' + sa.id + '_address2' ))
|
71
72
|
.append($('<div/>').attr('id', 'shippingaddress_' + sa.id + '_city' ))
|
72
73
|
.append($('<div/>').attr('id', 'shippingaddress_' + sa.id + '_state' ))
|
73
|
-
.append($('<div/>').attr('id', 'shippingaddress_' + sa.id + '_zip' ));
|
74
|
+
.append($('<div/>').attr('id', 'shippingaddress_' + sa.id + '_zip' ));
|
74
75
|
$('#shipping_address_container').empty().append(div);
|
76
|
+
if (that.cc.invoice.instore_pickup) $('#shipping_address_container').css('display', 'none');
|
75
77
|
|
76
78
|
that.model_binder = new ModelBinder({
|
77
79
|
name: 'ShippingAddress',
|
@@ -93,8 +95,9 @@ ShippingAddressController.prototype = {
|
|
93
95
|
|
94
96
|
ready: function()
|
95
97
|
{
|
96
|
-
var that = this;
|
97
|
-
if (that.cc.
|
98
|
+
var that = this;
|
99
|
+
if (that.cc.invoice.instore_pickup) return true;
|
100
|
+
if (that.cc.all_downloadable()) return true;
|
98
101
|
if (that.cc.is_empty_address(that.cc.invoice.shipping_address)) return false;
|
99
102
|
|
100
103
|
var sa = that.cc.invoice.shipping_address;
|
@@ -19,8 +19,7 @@ ShippingMethodController.prototype = {
|
|
19
19
|
var div = $('<div/>');
|
20
20
|
|
21
21
|
var sa = that.cc.invoice.shipping_address;
|
22
|
-
var op = that.cc.invoice_package_for_id(that.invoice_package_id);
|
23
|
-
console.log(op);
|
22
|
+
var op = that.cc.invoice_package_for_id(that.invoice_package_id);
|
24
23
|
var sm = op && op.shipping_method ? op.shipping_method : false;
|
25
24
|
|
26
25
|
if (!op)
|
@@ -44,8 +43,10 @@ ShippingMethodController.prototype = {
|
|
44
43
|
{
|
45
44
|
div.append($('<p/>').append(sm.service_name + ' - $' + op.total))
|
46
45
|
}
|
47
|
-
|
46
|
+
|
48
47
|
$('#invoice_package_' + that.invoice_package_id + '_shipping_method').empty().append(div);
|
48
|
+
if (that.cc.invoice.instore_pickup)
|
49
|
+
$('#invoice_package_' + that.invoice_package_id + '_shipping_method').css('display', 'none');
|
49
50
|
},
|
50
51
|
|
51
52
|
edit: function()
|
@@ -97,6 +98,8 @@ ShippingMethodController.prototype = {
|
|
97
98
|
.append($('<p/>').append(select))
|
98
99
|
.append($('<div/>').attr('id', 'invoice_package_' + that.invoice_package_id + '_message'));
|
99
100
|
$('#invoice_package_' + that.invoice_package_id + '_shipping_method').empty().append(div);
|
101
|
+
if (that.cc.invoice.instore_pickup)
|
102
|
+
$('#invoice_package_' + that.invoice_package_id + '_shipping_method').css('display', 'none');
|
100
103
|
},
|
101
104
|
|
102
105
|
update: function(shipping_method_id, total)
|
@@ -37,6 +37,17 @@ StripePaymentMethodController.prototype = {
|
|
37
37
|
});
|
38
38
|
},
|
39
39
|
|
40
|
+
print_or_edit_if_empty: function()
|
41
|
+
{
|
42
|
+
var that = this;
|
43
|
+
that.refresh(function() {
|
44
|
+
if (!that.card_brand || !that.card_last4)
|
45
|
+
that.edit();
|
46
|
+
else
|
47
|
+
that.print();
|
48
|
+
});
|
49
|
+
},
|
50
|
+
|
40
51
|
print: function()
|
41
52
|
{
|
42
53
|
var that = this;
|
@@ -53,8 +64,10 @@ StripePaymentMethodController.prototype = {
|
|
53
64
|
var msg = that.card_brand && that.card_last4 ? that.card_brand + ' ending in ' + that.card_last4 : 'You have no card on file.';
|
54
65
|
div.append($('<p/>')
|
55
66
|
.append(msg).append(' ')
|
56
|
-
.append($('<a/>').attr('href', '#').html('Edit').click(function(e) { e.preventDefault(); that.edit();
|
57
|
-
|
67
|
+
.append($('<a/>').attr('href', '#').html('Edit' ).click(function(e) { e.preventDefault(); that.edit(); })).append(' ')
|
68
|
+
.append($('<a/>').attr('href', '#').html('Remove' ).click(function(e) { e.preventDefault(); that.delete(); }))
|
69
|
+
.append($('<div/>').attr('id', 'payment_message'))
|
70
|
+
);
|
58
71
|
}
|
59
72
|
else
|
60
73
|
{
|
@@ -152,6 +165,9 @@ StripePaymentMethodController.prototype = {
|
|
152
165
|
if (resp2.success)
|
153
166
|
{
|
154
167
|
that.customer_id = resp2.customer_id;
|
168
|
+
that.card_brand = resp2.card_brand;
|
169
|
+
that.card_last4 = resp2.card_last4;
|
170
|
+
|
155
171
|
that.print();
|
156
172
|
that.cc.print_ready_message();
|
157
173
|
}
|
@@ -162,6 +178,40 @@ StripePaymentMethodController.prototype = {
|
|
162
178
|
});
|
163
179
|
},
|
164
180
|
|
181
|
+
delete: function(confirm)
|
182
|
+
{
|
183
|
+
var that = this;
|
184
|
+
|
185
|
+
if (!confirm)
|
186
|
+
{
|
187
|
+
var div = $('<div/>').addClass('note error')
|
188
|
+
.append($('<p/>').append("Are you sure you want to remove your payment method on file?"))
|
189
|
+
.append($('<p/>')
|
190
|
+
.append($('<input/>').attr('type', 'button').val('Yes').click(function() { that.delete(true); })).append(' ')
|
191
|
+
.append($('<input/>').attr('type', 'button').val('No' ).click(function() { $('#payment_message').empty(); }))
|
192
|
+
);
|
193
|
+
$('#payment_message').empty().append(div);
|
194
|
+
return;
|
195
|
+
}
|
196
|
+
$('#payment_message').html("<p class='loading'>Removing payment method...</p>");
|
197
|
+
$.ajax({
|
198
|
+
url: '/checkout/payment-method',
|
199
|
+
type: 'delete',
|
200
|
+
success: function(resp) {
|
201
|
+
if (resp.error)
|
202
|
+
$('#payment_message').html("<p class='note error'>" + resp.error + "</p>");
|
203
|
+
else
|
204
|
+
{
|
205
|
+
that.customer_id = null;
|
206
|
+
that.card_brand = null;
|
207
|
+
that.card_last4 = null;
|
208
|
+
that.edit();
|
209
|
+
that.cc.print_ready_message();
|
210
|
+
}
|
211
|
+
}
|
212
|
+
});
|
213
|
+
},
|
214
|
+
|
165
215
|
ready: function()
|
166
216
|
{
|
167
217
|
var that = this;
|
@@ -33,6 +33,8 @@ BoundText = BoundControl.extend({
|
|
33
33
|
$('#'+this.el+'_container').append($('<div/>').attr('id', this.el + '_placeholder').addClass('mb_placeholder').append($('<span/>').html(this.attribute.nice_name + ': ')));
|
34
34
|
$('#'+this.el).css('background', 'transparent');
|
35
35
|
}
|
36
|
+
console.log("width: " + that.width);
|
37
|
+
console.log("width2: " + this.attribute.width);
|
36
38
|
if (this.attribute.width) $('#'+this.el).css('width' , this.attribute.width);
|
37
39
|
if (this.attribute.fixed_placeholder && this.attribute.align != 'right')
|
38
40
|
{
|
@@ -7,6 +7,12 @@
|
|
7
7
|
overflow: hidden;
|
8
8
|
}
|
9
9
|
|
10
|
+
.mb_container * {
|
11
|
+
-moz-box-sizing: border-box;
|
12
|
+
-webkit-box-sizing: border-box;
|
13
|
+
box-sizing: border-box;
|
14
|
+
}
|
15
|
+
|
10
16
|
.mb_container div.mb_model_attribute_text {
|
11
17
|
color: #000;
|
12
18
|
}
|
@@ -84,7 +90,7 @@ div.mb_container div.mb_placeholder {
|
|
84
90
|
/*height: 34px;*/
|
85
91
|
|
86
92
|
position: absolute;
|
87
|
-
top:
|
93
|
+
top: 8px;
|
88
94
|
left: 10px;
|
89
95
|
z-index: 19;
|
90
96
|
}
|
@@ -97,7 +103,7 @@ div.mb_container form.mb_file_form div.mb_placeholder {
|
|
97
103
|
|
98
104
|
.mb_container .mb_placeholder span {
|
99
105
|
display: block;
|
100
|
-
font-size:
|
106
|
+
font-size: 16px;
|
101
107
|
color: #757575;
|
102
108
|
}
|
103
109
|
|
@@ -508,6 +508,17 @@ module Caboose
|
|
508
508
|
|
509
509
|
render :json => resp
|
510
510
|
end
|
511
|
+
|
512
|
+
# @route PUT /admin/pages/:page_id/blocks/:id/duplicate
|
513
|
+
# @route PUT /admin/posts/:post_id/blocks/:id/duplicate
|
514
|
+
def admin_duplicate
|
515
|
+
return unless user_is_allowed('pages', 'edit')
|
516
|
+
resp = StdClass.new
|
517
|
+
b = Block.find(params[:id])
|
518
|
+
b.duplicate_block(@site.id, params[:page_id], params[:post_id], b.block_type_id, b.parent_id)
|
519
|
+
resp.success = true
|
520
|
+
render :json => resp
|
521
|
+
end
|
511
522
|
|
512
523
|
# @route PUT /admin/pages/:page_id/blocks/:id/move-up
|
513
524
|
# @route PUT /admin/posts/:post_id/blocks/:id/move-up
|
@@ -155,17 +155,55 @@ module Caboose
|
|
155
155
|
u.save
|
156
156
|
|
157
157
|
render :json => {
|
158
|
-
:success
|
159
|
-
:customer_id
|
158
|
+
:success => true,
|
159
|
+
:customer_id => u.stripe_customer_id,
|
160
|
+
:card_last4 => u.card_last4,
|
161
|
+
:card_brand => u.card_brand,
|
162
|
+
:card_exp_month => u.card_exp_month,
|
163
|
+
:card_exp_year => u.card_exp_year
|
160
164
|
}
|
161
165
|
end
|
162
|
-
|
166
|
+
|
167
|
+
# @route DELETE /checkout/payment-method
|
168
|
+
def remove_payment_method
|
169
|
+
render :json => false and return if !logged_in?
|
170
|
+
|
171
|
+
resp = Caboose::StdClass.new
|
172
|
+
sc = @site.store_config
|
173
|
+
if sc.pp_name == 'stripe'
|
174
|
+
Stripe.api_key = sc.stripe_secret_key.strip
|
175
|
+
u = logged_in_user
|
176
|
+
if u.stripe_customer_id
|
177
|
+
begin
|
178
|
+
c = Stripe::Customer.retrieve(u.stripe_customer_id)
|
179
|
+
c.delete
|
180
|
+
rescue Exception => ex
|
181
|
+
Caboose.log(ex)
|
182
|
+
resp.error = ex.message if !ex.message.starts_with?('No such customer')
|
183
|
+
end
|
184
|
+
if resp.error.nil?
|
185
|
+
u.stripe_customer_id = nil
|
186
|
+
u.card_last4 = nil
|
187
|
+
u.card_brand = nil
|
188
|
+
u.card_exp_month = nil
|
189
|
+
u.card_exp_year = nil
|
190
|
+
u.save
|
191
|
+
else
|
192
|
+
resp.success = true
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
render :json => resp
|
197
|
+
end
|
198
|
+
|
163
199
|
# @route POST /checkout/confirm
|
164
200
|
def confirm
|
165
201
|
render :json => { :error => 'Not logged in.' } and return if !logged_in?
|
166
202
|
#render :json => { :error => 'Invalid billing address.' } and return if @invoice.billing_address.nil?
|
167
|
-
|
168
|
-
|
203
|
+
if !@invoice.instore_pickup && @invoice.has_shippable_items?
|
204
|
+
render :json => { :error => 'Invalid shipping address.' } and return if @invoice.shipping_address.nil?
|
205
|
+
render :json => { :error => 'Invalid shipping methods.' } and return if @invoice.has_empty_shipping_methods?
|
206
|
+
end
|
169
207
|
|
170
208
|
resp = Caboose::StdClass.new
|
171
209
|
sc = @site.store_config
|
@@ -411,6 +449,28 @@ module Caboose
|
|
411
449
|
render :json => { :success => true }
|
412
450
|
end
|
413
451
|
|
452
|
+
# @route PUT /checkout/invoice
|
453
|
+
def update_invoice
|
454
|
+
render :json => false and return if !logged_in?
|
455
|
+
resp = Caboose::StdClass.new
|
456
|
+
|
457
|
+
params.each do |k,v|
|
458
|
+
case k
|
459
|
+
when 'instore_pickup'
|
460
|
+
@invoice.instore_pickup = v
|
461
|
+
@invoice.save
|
462
|
+
|
463
|
+
@invoice.invoice_packages.each do |ip|
|
464
|
+
ip.instore_pickup = v
|
465
|
+
ip.save
|
466
|
+
end
|
467
|
+
end
|
468
|
+
end
|
469
|
+
|
470
|
+
resp.success = true
|
471
|
+
render :json => resp
|
472
|
+
end
|
473
|
+
|
414
474
|
# @route POST /checkout/attach-user
|
415
475
|
def attach_user
|
416
476
|
render :json => { :success => false, :errors => ['User is not logged in'] } and return if !logged_in?
|
@@ -438,6 +438,28 @@ module Caboose
|
|
438
438
|
|
439
439
|
render :json => { :success => true }
|
440
440
|
end
|
441
|
+
|
442
|
+
# @route PUT /checkout/invoice
|
443
|
+
def update_invoice
|
444
|
+
render :json => false and return if !logged_in?
|
445
|
+
resp = Caboose::StdClass.new
|
446
|
+
|
447
|
+
params.each do |k,v|
|
448
|
+
case k
|
449
|
+
when 'instore_pickup'
|
450
|
+
@invoice.instore_pickup = v
|
451
|
+
@invoice.save
|
452
|
+
|
453
|
+
@invoice.invoice_packages.each do |ip
|
454
|
+
ip.instore_pickup = v
|
455
|
+
ip.save
|
456
|
+
end
|
457
|
+
end
|
458
|
+
end
|
459
|
+
|
460
|
+
resp.success = true
|
461
|
+
render :json => resp
|
462
|
+
end
|
441
463
|
|
442
464
|
# GET /checkout/payment
|
443
465
|
#def payment
|
@@ -10,7 +10,7 @@ module Caboose
|
|
10
10
|
|
11
11
|
@pager = Caboose::PageBarGenerator.new(params, {
|
12
12
|
'customer_id' => logged_in_user.id,
|
13
|
-
'status' =>
|
13
|
+
'status' => ''
|
14
14
|
}, {
|
15
15
|
'model' => 'Caboose::Invoice',
|
16
16
|
'sort' => 'invoice_number',
|
@@ -126,6 +126,7 @@ module Caboose
|
|
126
126
|
when 'download_url_expires_in' then sc.download_url_expires_in = value
|
127
127
|
when 'starting_invoice_number' then sc.starting_invoice_number = value
|
128
128
|
when 'default_payment_terms' then sc.default_payment_terms = value
|
129
|
+
when 'allow_instore_pickup' then sc.allow_instore_pickup = value
|
129
130
|
|
130
131
|
when 'product_vendor_id' then pd.vendor_id = value
|
131
132
|
when 'product_option1' then pd.option1 = value
|
data/app/models/caboose/block.rb
CHANGED
@@ -604,6 +604,38 @@ class Caboose::Block < ActiveRecord::Base
|
|
604
604
|
end
|
605
605
|
end
|
606
606
|
end
|
607
|
+
|
608
|
+
|
609
|
+
# Assumes that we start the duplicate process at the top level block
|
610
|
+
def duplicate_block(site_id, page_id, post_id, new_block_type_id = nil, new_parent_id = nil)
|
611
|
+
b = Caboose::Block.create(
|
612
|
+
:page_id => page_id,
|
613
|
+
:post_id => post_id,
|
614
|
+
:parent_id => new_parent_id,
|
615
|
+
:media_id => self.media_id,
|
616
|
+
:block_type_id => self.block_type_id,
|
617
|
+
:sort_order => self.sort_order + 1,
|
618
|
+
:constrain => self.constrain,
|
619
|
+
:full_width => self.full_width,
|
620
|
+
:name => self.name,
|
621
|
+
:value => self.value
|
622
|
+
)
|
623
|
+
self.children.each do |b2|
|
624
|
+
if b2.name
|
625
|
+
# The block is part of the block type, so we have to find the corresponding child block in the new block type
|
626
|
+
bt = Caboose::BlockType.where(:parent_id => self.block_type_id, :name => b2.name).first
|
627
|
+
if bt
|
628
|
+
b2.duplicate_block(site_id, page_id, post_id, bt.id, b.id)
|
629
|
+
else
|
630
|
+
# Don't duplicate it because the corresponding child block doesn't exist in the new block type
|
631
|
+
end
|
632
|
+
else
|
633
|
+
# The block is a child block that isn't part of the block type definition
|
634
|
+
b2.duplicate_block(site_id, page_id, post_id, b2.block_type_id, b.id)
|
635
|
+
end
|
636
|
+
end
|
637
|
+
return true
|
638
|
+
end
|
607
639
|
|
608
640
|
def modal_js_block_names
|
609
641
|
arr = []
|
@@ -409,11 +409,12 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
409
409
|
],
|
410
410
|
Caboose::InvoicePackage => [
|
411
411
|
[ :invoice_id , :integer ],
|
412
|
+
[ :instore_pickup , :boolean , { :default => false }],
|
412
413
|
[ :shipping_method_id , :integer ],
|
413
414
|
[ :shipping_package_id , :integer ],
|
414
415
|
[ :status , :string ],
|
415
416
|
[ :tracking_number , :string ],
|
416
|
-
[ :total , :decimal , { :precision => 8, :scale => 2 }]
|
417
|
+
[ :total , :decimal , { :precision => 8, :scale => 2 }]
|
417
418
|
],
|
418
419
|
Caboose::Invoice => [
|
419
420
|
[ :site_id , :integer ],
|
@@ -447,7 +448,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
447
448
|
[ :landing_page_ref , :string ],
|
448
449
|
[ :auth_amount , :decimal , { :precision => 8, :scale => 2 }],
|
449
450
|
[ :gift_message , :text ],
|
450
|
-
[ :include_receipt , :boolean , { :default => true }]
|
451
|
+
[ :include_receipt , :boolean , { :default => true }],
|
452
|
+
[ :instore_pickup , :boolean , { :default => false }]
|
451
453
|
|
452
454
|
#[ :email , :string ],
|
453
455
|
#[ :invoice_number , :string ],
|
@@ -699,8 +701,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
699
701
|
[ :outside_height , :decimal ],
|
700
702
|
[ :volume , :decimal ],
|
701
703
|
[ :empty_weight , :decimal ],
|
702
|
-
[ :cylinder , :boolean
|
703
|
-
[ :priority , :integer
|
704
|
+
[ :cylinder , :boolean , { :default => false }],
|
705
|
+
[ :priority , :integer , { :default => 1 }],
|
704
706
|
[ :flat_rate_price , :decimal ]
|
705
707
|
],
|
706
708
|
Caboose::ShippingPackageMethod => [
|
@@ -823,7 +825,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
823
825
|
[ :default_payment_terms , :string , { :default => 'pia' }],
|
824
826
|
[ :default_vendor_id , :integer ],
|
825
827
|
[ :default_product_status , :string ],
|
826
|
-
[ :default_taxable , :boolean ]
|
828
|
+
[ :default_taxable , :boolean ],
|
829
|
+
[ :allow_instore_pickup , :boolean , { :default => false }]
|
827
830
|
],
|
828
831
|
Caboose::Subscription => [
|
829
832
|
[ :site_id , :integer ],
|
@@ -79,6 +79,11 @@ tr.invoice_totals_header td { border: 0; }
|
|
79
79
|
#checkout input.zip { display: block; width: 75px !important; }
|
80
80
|
*/
|
81
81
|
|
82
|
+
#invoice_1_instore_pickup_placeholder { left: 4px; top: 0; }
|
83
|
+
#invoice_1_instore_pickup_placeholder span { color: #000 !important; }
|
84
|
+
#invoice_1_instore_pickup_background { border: none; }
|
85
|
+
#invoice_1_instore_pickup { top: 0; width: 30px; height: 30px; }
|
86
|
+
|
82
87
|
.mb_container.first_name { display: block; width: 50% !important; float: left; } .mb_container.first_name input { width: 100% !important; border-color: #b9b9b9; border-right: none; border-bottom: none; }
|
83
88
|
.mb_container.last_name { display: block; width: 50% !important; } .mb_container.last_name input { width: 100% !important; border-color: #b9b9b9; border-bottom: none; }
|
84
89
|
.mb_container.company { display: block; width: 100% !important; clear:left; } .mb_container.company input { width: 100% !important; border-color: #b9b9b9; border-bottom: none; }
|
@@ -27,7 +27,7 @@
|
|
27
27
|
<p><select name='status'>
|
28
28
|
<optgroup label='Status'>
|
29
29
|
<option value=''>-- All statuses --</option>
|
30
|
-
<% statuses = ['cart',
|
30
|
+
<% statuses = ['cart','pending','canceled','ready to ship','shipped','paid'] %>
|
31
31
|
<% statuses.each do |status| %>
|
32
32
|
<option value='<%= status %>'<%= @pager.params['status'] == status ? " selected='true'" : '' %>><%= status.capitalize %></option>
|
33
33
|
<% end %>
|
@@ -21,9 +21,13 @@
|
|
21
21
|
<tr>
|
22
22
|
<% if i == 0 %>
|
23
23
|
<td rowspan="<%= op.line_items.count %>">
|
24
|
-
|
25
|
-
|
26
|
-
<%
|
24
|
+
<% if op.instore_pickup %>
|
25
|
+
<div>In-store Pickup</div>
|
26
|
+
<% else %>
|
27
|
+
<div><%= op.shipping_method.service_name %></div>
|
28
|
+
<div><%= op.status %></div>
|
29
|
+
<% if op.tracking_number %><div><%= op.tracking_number %></div><% end %>
|
30
|
+
<% end %>
|
27
31
|
</td>
|
28
32
|
<% end %>
|
29
33
|
<td>
|
@@ -89,7 +93,7 @@
|
|
89
93
|
<tr><td colspan="4" align='right'>Total: </td><td align='right'><%= number_to_currency(@invoice.total) %></td></tr>
|
90
94
|
</table>
|
91
95
|
|
92
|
-
<% if @invoice.shipping_address %>
|
96
|
+
<% if !@invoice.instore_pickup && @invoice.shipping_address %>
|
93
97
|
<% sa = @invoice.shipping_address %>
|
94
98
|
<h2>Shipping Address</h2>
|
95
99
|
<p>
|
@@ -34,14 +34,17 @@
|
|
34
34
|
.move_up_handle { display: none; }
|
35
35
|
.move_down_handle { display: none; }
|
36
36
|
.delete_handle { display: none; }
|
37
|
+
.duplicate_handle { display: none; }
|
37
38
|
.block_over > .select_handle { display: block; position: relative; z-index: 3; }
|
38
39
|
.block_over > .move_up_handle { display: block; position: relative; z-index: 3; }
|
39
40
|
.block_over > .move_down_handle { display: block; position: relative; z-index: 3; }
|
40
41
|
.block_over > .delete_handle { display: block; position: relative; z-index: 3; }
|
41
|
-
.block_over > .
|
42
|
+
.block_over > .duplicate_handle { display: block; position: relative; z-index: 3; }
|
43
|
+
.block_over > .select_handle span { position: absolute; top: 0; right: 72px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
42
44
|
.block_over > .move_up_handle span { position: absolute; top: 0; right: 36px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
43
45
|
.block_over > .move_down_handle span { position: absolute; top: 0; right: 18px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
44
46
|
.block_over > .delete_handle span { position: absolute; top: 0; right: 0px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
47
|
+
.block_over > .duplicate_handle span { position: absolute; top: 0; right: 54px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
45
48
|
|
46
49
|
.selected { background: #fff799; }
|
47
50
|
|
@@ -34,14 +34,17 @@
|
|
34
34
|
.move_up_handle { display: none; }
|
35
35
|
.move_down_handle { display: none; }
|
36
36
|
.delete_handle { display: none; }
|
37
|
+
.duplicate_handle { display: none; }
|
37
38
|
.block_over > .select_handle { display: block; position: relative; }
|
38
39
|
.block_over > .move_up_handle { display: block; position: relative; }
|
39
40
|
.block_over > .move_down_handle { display: block; position: relative; }
|
40
41
|
.block_over > .delete_handle { display: block; position: relative; }
|
41
|
-
.block_over > .
|
42
|
+
.block_over > .duplicate_handle { display: block; position: relative; }
|
43
|
+
.block_over > .select_handle span { position: absolute; top: 0; right: 72px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
42
44
|
.block_over > .move_up_handle span { position: absolute; top: 0; right: 36px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
43
45
|
.block_over > .move_down_handle span { position: absolute; top: 0; right: 18px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
44
46
|
.block_over > .delete_handle span { position: absolute; top: 0; right: 0px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
47
|
+
.block_over > .duplicate_handle span { position: absolute; top: 0; right: 54px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
45
48
|
|
46
49
|
.selected { background: #fff799; }
|
47
50
|
|
@@ -3,8 +3,9 @@ sc = @store_config
|
|
3
3
|
%>
|
4
4
|
<%= render :partial => 'caboose/store/admin_header' %>
|
5
5
|
|
6
|
-
<p
|
6
|
+
<p><div id='storeconfig_<%= sc.id %>_allow_instore_pickup' ></div></p>
|
7
7
|
<p><div id='storeconfig_<%= sc.id %>_auto_calculate_shipping' ></div></p>
|
8
|
+
<p>If calculating shipping rates automatically, all shippable variants must have dimensions and weights populated. Otherwise, a custom shipping rates function is required.</p>
|
8
9
|
<div id='custom_shipping_container' <% if sc.auto_calculate_shipping %>style='display: none;'<% end %>>
|
9
10
|
<h3>Custom Shipping Rates Function</h3>
|
10
11
|
<p><code>def custom_shipping_rates_function(invoice) {</code></p>
|
@@ -60,31 +61,32 @@ $(document).ready(function() {
|
|
60
61
|
update_url: '/admin/store',
|
61
62
|
authenticity_token: '<%= form_authenticity_token %>',
|
62
63
|
attributes: [
|
63
|
-
{ name: '
|
64
|
-
{ name: '
|
65
|
-
{ name: '
|
66
|
-
{ name: '
|
67
|
-
{ name: '
|
68
|
-
{ name: '
|
69
|
-
{ name: '
|
70
|
-
{ name: '
|
71
|
-
{ name: '
|
72
|
-
{ name: '
|
73
|
-
{ name: '
|
74
|
-
{ name: '
|
75
|
-
{ name: '
|
76
|
-
{ name: '
|
77
|
-
{ name: '
|
78
|
-
{ name: '
|
79
|
-
{ name: '
|
80
|
-
{ name: '
|
81
|
-
{ name: '
|
82
|
-
{ name: '
|
83
|
-
{ name: '
|
84
|
-
{ name: '
|
85
|
-
{ name: '
|
64
|
+
{ name: 'allow_instore_pickup' , nice_name: 'Allow In-store Pickup' , type: 'checkbox' , value: <%= raw Caboose.json(sc.allow_instore_pickup ? 1 : 0 ) %>, width: 400 },
|
65
|
+
{ name: 'ups_username' , nice_name: 'UPS Username' , type: 'text' , value: <%= raw Caboose.json(sc.ups_username ) %>, width: 400 },
|
66
|
+
{ name: 'ups_password' , nice_name: 'UPS Password' , type: 'text' , value: <%= raw Caboose.json(sc.ups_password ) %>, width: 400 },
|
67
|
+
{ name: 'ups_key' , nice_name: 'UPS Key' , type: 'text' , value: <%= raw Caboose.json(sc.ups_key ) %>, width: 400 },
|
68
|
+
{ name: 'ups_origin_account' , nice_name: 'UPS Origin Account' , type: 'text' , value: <%= raw Caboose.json(sc.ups_origin_account ) %>, width: 400 },
|
69
|
+
{ name: 'usps_username' , nice_name: 'USPS Username' , type: 'text' , value: <%= raw Caboose.json(sc.usps_username ) %>, width: 400 },
|
70
|
+
{ name: 'usps_secret_key' , nice_name: 'USPS Secret Key' , type: 'text' , value: <%= raw Caboose.json(sc.usps_secret_key ) %>, width: 400 },
|
71
|
+
{ name: 'usps_publishable_key' , nice_name: 'USPS Publishable Key' , type: 'text' , value: <%= raw Caboose.json(sc.usps_publishable_key ) %>, width: 400 },
|
72
|
+
{ name: 'fedex_username' , nice_name: 'FedEx Username' , type: 'text' , value: <%= raw Caboose.json(sc.fedex_username ) %>, width: 400 },
|
73
|
+
{ name: 'fedex_password' , nice_name: 'FedEx Password' , type: 'text' , value: <%= raw Caboose.json(sc.fedex_password ) %>, width: 400 },
|
74
|
+
{ name: 'fedex_key' , nice_name: 'FedEx Key' , type: 'text' , value: <%= raw Caboose.json(sc.fedex_key ) %>, width: 400 },
|
75
|
+
{ name: 'fedex_account' , nice_name: 'FedEx Account' , type: 'text' , value: <%= raw Caboose.json(sc.fedex_account ) %>, width: 400 },
|
76
|
+
{ name: 'ups_min' , nice_name: 'UPS Min' , type: 'text' , value: <%= raw Caboose.json(sc.ups_min ) %>, width: 400 },
|
77
|
+
{ name: 'ups_max' , nice_name: 'UPS Max' , type: 'text' , value: <%= raw Caboose.json(sc.ups_max ) %>, width: 400 },
|
78
|
+
{ name: 'usps_min' , nice_name: 'USPS Min' , type: 'text' , value: <%= raw Caboose.json(sc.usps_min ) %>, width: 400 },
|
79
|
+
{ name: 'usps_max' , nice_name: 'USPS Max' , type: 'text' , value: <%= raw Caboose.json(sc.usps_max ) %>, width: 400 },
|
80
|
+
{ name: 'fedex_min' , nice_name: 'FedEx Min' , type: 'text' , value: <%= raw Caboose.json(sc.fedex_min ) %>, width: 400 },
|
81
|
+
{ name: 'fedex_max' , nice_name: 'FedEx Max' , type: 'text' , value: <%= raw Caboose.json(sc.fedex_max ) %>, width: 400 },
|
82
|
+
{ name: 'origin_address1' , nice_name: 'Address 1' , type: 'text' , value: <%= raw Caboose.json(sc.origin_address1 ) %>, width: 400 },
|
83
|
+
{ name: 'origin_address2' , nice_name: 'Address 2' , type: 'text' , value: <%= raw Caboose.json(sc.origin_address2 ) %>, width: 400 },
|
84
|
+
{ name: 'origin_city' , nice_name: 'City' , type: 'text' , value: <%= raw Caboose.json(sc.origin_city ) %>, width: 400 },
|
85
|
+
{ name: 'origin_state' , nice_name: 'State' , type: 'text' , value: <%= raw Caboose.json(sc.origin_state ) %>, width: 400 },
|
86
|
+
{ name: 'origin_zip' , nice_name: 'Zip' , type: 'text' , value: <%= raw Caboose.json(sc.origin_zip ) %>, width: 400 },
|
87
|
+
{ name: 'origin_country' , nice_name: 'Country' , type: 'text' , value: <%= raw Caboose.json(sc.origin_country ) %>, width: 400 },
|
86
88
|
{ name: 'auto_calculate_shipping' , nice_name: 'Calculate Shipping Automatically' , type: 'checkbox' , value: <%= raw Caboose.json(sc.auto_calculate_shipping ? 1 : 0 ) %>, width: 400, after_update: function() { toggleCustomShipping(this.value); }},
|
87
|
-
{ name: 'custom_shipping_function' , nice_name: 'Custom Shipping Function' , type: 'textarea' , value: <%= raw Caboose.json(sc.custom_shipping_function
|
89
|
+
{ name: 'custom_shipping_function' , nice_name: 'Custom Shipping Function' , type: 'textarea' , value: <%= raw Caboose.json(sc.custom_shipping_function ) %>, width: 800, height: 200, fixed_placeholder: false }
|
88
90
|
]
|
89
91
|
});
|
90
92
|
|
data/lib/caboose/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Caboose
|
2
|
-
VERSION = '0.8.
|
3
|
-
end
|
2
|
+
VERSION = '0.8.71'
|
3
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.71
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|