caboose-cms 0.8.11 → 0.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/caboose/checkout/checkout_controller.js +5 -2
- data/app/assets/javascripts/caboose/checkout/gift_cards_controller.js +2 -0
- data/app/assets/javascripts/caboose/checkout/stripe_payment_method_controller.js +24 -8
- data/app/controllers/caboose/page_custom_field_values_controller.rb +1 -1
- data/app/controllers/caboose/pages_controller.rb +2 -1
- data/app/controllers/caboose/products_controller.rb +1 -0
- data/lib/caboose/version.rb +1 -1
- 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: 90866b1d7d4c42dfffa6d9e29884127fb63b443f
|
4
|
+
data.tar.gz: 3b9cd1b1a63ffbf4850de31c88d8c88cf023f6a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29c983d4718e404ec587a048799863fdfc8463ed8a2e534d128d7dd29ca4c2133cb7138dcaee7dc2f28f365b9226b44065e7029eb83f6251f2bc5c8def98611b
|
7
|
+
data.tar.gz: 82e08132ea2f605dd2aace8b53bd45c2603c666caad8707b1c052cdfef17c07e8c34fcef845ca3bb34427f4c4554c37119ee7778ca14374c6c82c80267b94933
|
@@ -62,10 +62,13 @@ CheckoutController.prototype = {
|
|
62
62
|
that.refresh(function() { that.cart_controller.update_totals(); });
|
63
63
|
},
|
64
64
|
|
65
|
-
refresh_cart: function()
|
65
|
+
refresh_cart: function(after)
|
66
66
|
{
|
67
67
|
var that = this;
|
68
|
-
that.refresh(function() {
|
68
|
+
that.refresh(function() {
|
69
|
+
that.cart_controller.print();
|
70
|
+
if (after) after();
|
71
|
+
});
|
69
72
|
},
|
70
73
|
|
71
74
|
refresh: function(after)
|
@@ -47,7 +47,9 @@ GiftCardsController.prototype = {
|
|
47
47
|
if (resp.error) $('#gift_card_message').html("<p class='note error'>" + resp.error + "</p>");
|
48
48
|
if (resp.success)
|
49
49
|
{
|
50
|
+
that.cc.invoice.total = parseFloat(resp.invoice_total);
|
50
51
|
that.cc.refresh_cart();
|
52
|
+
that.cc.payment_method_controller.print();
|
51
53
|
$('#gift_card_code').val('');
|
52
54
|
$('#gift_card_message').empty();
|
53
55
|
}
|
@@ -44,21 +44,36 @@ StripePaymentMethodController.prototype = {
|
|
44
44
|
return;
|
45
45
|
}
|
46
46
|
var msg = that.card_brand && that.card_last4 ? that.card_brand + ' ending in ' + that.card_last4 : 'You have no card on file.';
|
47
|
-
var div = $('<div/>')
|
48
|
-
|
49
|
-
|
47
|
+
var div = $('<div/>').append($('<h3/>').html('Payment Method'));
|
48
|
+
|
49
|
+
if (that.cc.invoice.total > 0.00)
|
50
|
+
{
|
51
|
+
var msg = that.card_brand && that.card_last4 ? that.card_brand + ' ending in ' + that.card_last4 : 'You have no card on file.';
|
52
|
+
div.append($('<p/>')
|
50
53
|
.append(msg).append(' ')
|
51
|
-
.append($('<a/>').attr('href', '#').html('Edit').click(function(e) {
|
52
|
-
|
53
|
-
|
54
|
-
|
54
|
+
.append($('<a/>').attr('href', '#').html('Edit').click(function(e) { e.preventDefault(); that.edit(); })
|
55
|
+
));
|
56
|
+
}
|
57
|
+
else
|
58
|
+
{
|
59
|
+
div.append($('<p/>')
|
60
|
+
.append("No payment is required at this time. ")
|
61
|
+
.append($('<a/>').attr('href', '#').html('Edit').click(function(e) { e.preventDefault(); that.edit(); })
|
55
62
|
));
|
63
|
+
}
|
56
64
|
$('#'+that.container).empty().append(div);
|
57
65
|
},
|
58
66
|
|
59
67
|
edit: function()
|
60
68
|
{
|
61
69
|
var that = this;
|
70
|
+
|
71
|
+
if (that.cc.invoice.total <= 0.00)
|
72
|
+
{
|
73
|
+
that.print();
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
|
62
77
|
var form = $('<form/>')
|
63
78
|
.attr('action', '')
|
64
79
|
.attr('method', 'post')
|
@@ -147,7 +162,8 @@ StripePaymentMethodController.prototype = {
|
|
147
162
|
|
148
163
|
ready: function()
|
149
164
|
{
|
150
|
-
var that = this;
|
165
|
+
var that = this;
|
166
|
+
if (that.cc.invoice.total <= 0.00) return true;
|
151
167
|
if (!that.customer_id ) return false;
|
152
168
|
if (!that.card_brand ) return false;
|
153
169
|
if (!that.card_last4 ) return false;
|
@@ -537,7 +537,8 @@ module Caboose
|
|
537
537
|
render json: resp
|
538
538
|
end
|
539
539
|
|
540
|
-
# @
|
540
|
+
# @route_priority 1
|
541
|
+
# @route GET /admin/pages/:field-options
|
541
542
|
# @route GET /admin/pages/:id/:field-options
|
542
543
|
def admin_options
|
543
544
|
if !user_is_allowed('pages', 'edit')
|
data/lib/caboose/version.rb
CHANGED
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.12
|
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-06-
|
11
|
+
date: 2016-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|