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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c1a38c7958001c122e61895b2f7d359b74bf2f6
4
- data.tar.gz: 31caf3a735aa7303f2a8231eea25125268701fe2
3
+ metadata.gz: 90866b1d7d4c42dfffa6d9e29884127fb63b443f
4
+ data.tar.gz: 3b9cd1b1a63ffbf4850de31c88d8c88cf023f6a4
5
5
  SHA512:
6
- metadata.gz: 22d9e3eecde0cca94372615827879641ecf9c26b6e193ae3a6cfcc9bc02a14d17de4fe2ac2ca78d520246a41429b33d3d0b7ff2503465e5200628a32452dba79
7
- data.tar.gz: cfcecd2436bd34a232099612a7d406b167d409c0807622b74dadc70552ec8eff4321c5b1cbe1bc9e9d6ef7ba64293b33555eca289a6e890ce965093e48efab7a
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() { that.cart_controller.print(); });
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
- .append($('<h3/>').html('Payment Method'))
49
- .append($('<p/>')
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
- e.preventDefault();
53
- that.edit();
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;
@@ -1,7 +1,7 @@
1
1
  module Caboose
2
2
  class PageCustomFieldValuesController < ApplicationController
3
3
 
4
- # PUT /admin/page-custom-field-values/:id
4
+ # @route PUT /admin/page-custom-field-values/:id
5
5
  def admin_update
6
6
  return if !user_is_allowed('pagecustomfieldvalues', 'edit')
7
7
 
@@ -537,7 +537,8 @@ module Caboose
537
537
  render json: resp
538
538
  end
539
539
 
540
- # @route GET /admin/pages/:field-options
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')
@@ -250,6 +250,7 @@ module Caboose
250
250
  end
251
251
 
252
252
  # @route GET /admin/products/:id
253
+ # @route GET /admin/products/:id/general
253
254
  def admin_edit_general
254
255
  return if !user_is_allowed('products', 'edit')
255
256
  @product = Product.find(params[:id])
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.11'
2
+ VERSION = '0.8.12'
3
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.11
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-21 00:00:00.000000000 Z
11
+ date: 2016-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg