caboose-cms 0.5.89 → 0.5.90

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDk1M2U0YmY4NzM1YzZhN2E3Yjk4MDczYWYyZjE3OTQ2OGM5ZTU3Nw==
4
+ YTZmMjA4ZGY0YTdlYTg1N2I3ZGE1ZTk2MWFhNTg1NTMxYTE0Y2QzMg==
5
5
  data.tar.gz: !binary |-
6
- NTFjYmMwN2Y4MGM1Y2U5NzAwMTdhMmNhMjk2MzllOWU5MGFiYmJjMA==
6
+ YjE4M2E4ZWRjYWEwZjQyMGQzOGRkNDc3OTEwNTQ5MzgyOTdmNWQzZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjZiYzUwYzFiMmNkZWMzNjkwZTZlZTAzZTY2NWZjMjQzYjc3YmRmNWU5YzZj
10
- MjQzNTBmMGIxMzg4ZTBjODY3MTY5YzdjNjk2YjUzZDI1NzYzNDgxMWFkMjJm
11
- N2NkZTAxNWZjZTlhM2M5N2YyZWRmNDYxYmU5ZTYyYTBmYjQzYWQ=
9
+ YzZlMzcxYzZkNzI3YzAxZGM4MWMzODk3ODNmMzU5NDNjOGY2M2YzZWM4ODdm
10
+ ZWFhMWI4YTgzY2Q0ODZjYjBkOTEyMDY2YzkwODJlNTcyNmYyYmQ3MzBlOTdm
11
+ NDEzYTcyNjk2NWVhYmEwMTcyOTM2ZWZlNGQ2NWQwY2IwMGExYTU=
12
12
  data.tar.gz: !binary |-
13
- MDExYjAzMjE4ZjdiMTEzNTQ3Zjk0ODZmY2VlMWZjYTYxNDNkNjk1MzlmYTYy
14
- NjFjOWY2ZWI5OTBmNDViNTcyNTExZTNiODhjYjA2YzU5MzdkNjZhODZkMmJj
15
- MzIwNzRlMzZlMWFjNjdhNTZiMmU3ZmNkYzQ0ZDQ3ZDM4ZmIwOTc=
13
+ ZTZlMmIwYWM4OWFlZTAxNjlhOTA5YWU1ODczYTY5MTI0OTE1NzRiY2MxYzVk
14
+ NWE2OGY0M2E2Yjk3MjVkMWVlYmZiZGRlNzdiZDk0MWUwZDdkODBmOGY0MmM3
15
+ MjJiM2ZjNTBlNzA3NjBlZWEyZGJiZmQ3MTE2YmVkNmYzYzlhYjI=
@@ -23,8 +23,7 @@ Caboose.Store.Modules.CheckoutLoginRegister = (function() {
23
23
  }
24
24
 
25
25
  $('#signin_form_container' ).slideUp();
26
- $('#register_form_container' ).slideUp();
27
- $('#guest_form_container' ).slideUp();
26
+ $('#register_form_container' ).slideUp();
28
27
 
29
28
  self.$checkout = $('#checkout')
30
29
  self.bindEventHandlers();
@@ -35,12 +34,9 @@ Caboose.Store.Modules.CheckoutLoginRegister = (function() {
35
34
  //
36
35
 
37
36
  self.bindEventHandlers = function() {
38
- self.$checkout.on('click' , '[data-login-action]', self.login_click_handler);
39
- //self.$checkout.on('submit', '#checkout-login form', self.login_submit_handler);
40
- //self.$checkout.on('click' , '#checkout-continue button', self.continue_handler);
37
+ self.$checkout.on('click' , '[data-login-action]', self.login_click_handler);
41
38
  $('#signin_form' ).submit(self.login_form_submit_handler);
42
- $('#register_form').submit(self.register_form_submit_handler);
43
- $('#guest_form' ).submit(self.guest_form_submit_handler);
39
+ $('#register_form').submit(self.register_form_submit_handler);
44
40
  };
45
41
 
46
42
  self.login_click_handler = function(event) {
@@ -112,20 +108,6 @@ Caboose.Store.Modules.CheckoutLoginRegister = (function() {
112
108
  });
113
109
  return false;
114
110
  };
115
-
116
- self.guest_form_submit_handler = function(event) {
117
- $('#message').html("<p class='loading'>Submitting...</p>");
118
- $.ajax({
119
- url: '/checkout/attach-guest',
120
- type: 'post',
121
- data: $('#guest_form').serialize(),
122
- success: function(resp) {
123
- if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>");
124
- else window.location = '/checkout/addresses';
125
- }
126
- });
127
- return false;
128
- };
129
111
 
130
112
  return self
131
113
  }).call(Caboose.Store);
@@ -27,6 +27,7 @@ module Caboose
27
27
  # GET /checkout/addresses
28
28
  def addresses
29
29
  redirect_to '/checkout' if !logged_in?
30
+ @logged_in_user = logged_in_user
30
31
  end
31
32
 
32
33
  # Step 3 - Shipping method
@@ -44,7 +45,8 @@ module Caboose
44
45
 
45
46
  # Now get the rates for those packages
46
47
  @rates = ShippingCalculator.rates(@order)
47
- Caboose.log(@rates.inspect)
48
+ #Caboose.log(@rates.inspect)
49
+ @logged_in_user = logged_in_user
48
50
  end
49
51
 
50
52
  # Step 4 - Gift cards
@@ -53,6 +55,7 @@ module Caboose
53
55
  redirect_to '/checkout' and return if !logged_in?
54
56
  redirect_to '/checkout/addresses' and return if @order.shipping_address.nil? || @order.billing_address.nil?
55
57
  redirect_to '/checkout/shipping' and return if @order.has_empty_shipping_methods?
58
+ @logged_in_user = logged_in_user
56
59
  end
57
60
 
58
61
  # Step 5 - Payment
@@ -93,10 +96,12 @@ module Caboose
93
96
  when 'payscape'
94
97
  @form_url = Caboose::PaymentProcessor.form_url(@order)
95
98
  end
99
+ @logged_in_user = logged_in_user
96
100
  end
97
101
 
98
102
  # GET /checkout/thanks
99
103
  def thanks
104
+ @logged_in_user = logged_in_user
100
105
  end
101
106
 
102
107
  #===========================================================================
@@ -153,9 +158,10 @@ module Caboose
153
158
  end
154
159
 
155
160
  # POST /checkout/attach-user
156
- def attach_user
161
+ def attach_user
157
162
  render :json => { :success => false, :errors => ['User is not logged in'] } and return if !logged_in?
158
163
  @order.customer_id = logged_in_user.id
164
+ #Caboose.log("Attaching user to order: customer_id = #{@order.customer_id}")
159
165
  render :json => { :success => @order.save, :errors => @order.errors.full_messages, :logged_in => logged_in? }
160
166
  end
161
167
 
@@ -27,20 +27,13 @@ module Caboose
27
27
  pass1 = params[:pass1]
28
28
  pass2 = params[:pass2]
29
29
 
30
- if first_name.nil? || first_name.strip.length == 0
31
- resp.error = "Your first name is required."
32
- elsif last_name.nil? || last_name.strip.length == 0
33
- resp.error = "Your last name is required."
34
- elsif email.nil? || email.strip.length == 0
35
- resp.error = "Your email address is required."
36
- elsif User.where(:email => email.strip.downcase).exists?
37
- resp.error = "A user with that email address already exists."
38
- elsif phone.nil? || phone.strip.length < 10
39
- resp.error = "Your phone number is required. Please include your area code."
40
- elsif pass1.nil? || pass1.strip.length < 8
41
- resp.error = "Your password must be at least 8 characters."
42
- elsif pass2.nil? || pass1 != pass2
43
- resp.error = "Your passwords don't match."
30
+ if first_name.nil? || first_name.strip.length == 0 then resp.error = "Your first name is required."
31
+ elsif last_name.nil? || last_name.strip.length == 0 then resp.error = "Your last name is required."
32
+ elsif email.nil? || email.strip.length == 0 then resp.error = "Your email address is required."
33
+ elsif User.where(:email => email.strip.downcase).exists? then resp.error = "A user with that email address already exists."
34
+ elsif phone.nil? || phone.strip.length < 10 then resp.error = "Your phone number is required. Please include your area code."
35
+ elsif pass1.nil? || pass1.strip.length < 8 then resp.error = "Your password must be at least 8 characters."
36
+ elsif pass2.nil? || pass1 != pass2 then resp.error = "Your passwords don't match."
44
37
  else
45
38
 
46
39
  u = Caboose::User.new
@@ -54,7 +47,7 @@ module Caboose
54
47
 
55
48
  # Go ahead and log the user in
56
49
  u = Caboose::User.find(u.id)
57
- login_user(u)
50
+ login_user(u, true)
58
51
 
59
52
  resp.redirect = "/login?return_url=#{return_url}"
60
53
 
@@ -2,11 +2,11 @@
2
2
  sa = @order.shipping_address
3
3
  ba = @order.billing_address
4
4
  if sa.nil?
5
- q = ["status <> ? and id < ?", 'cart', @order.id]
5
+ q = ["status <> ? and id < ? and customer_id = ?", 'cart', @order.id, @order.customer_id]
6
6
  if Caboose::Order.where(q).exists?
7
7
  last_order = Caboose::Order.where(q).first
8
8
  sa = last_order.shipping_address
9
- ba = last_order.billing_address
9
+ ba = last_order.billing_address
10
10
  end
11
11
  end
12
12
  %>
@@ -14,10 +14,10 @@ end
14
14
  <div id="checkout">
15
15
  <% if @logged_in_user.id == 1 %>
16
16
  <p class='note error'>You are logged in as the admin user. Please <a href='/logout'>logout</a> and complete your order as a different user.</p>
17
- <% else %>
17
+ <% else %>
18
18
  <form action="/checkout/addresses" method="put" id='address_form'>
19
19
  <section id="checkout-address">
20
- <div class="wrapper">
20
+ <div class="wrapper">
21
21
  <section>
22
22
  <fieldset id="shipping">
23
23
  <h3>Shipping Address</h3>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.89'
2
+ VERSION = '0.5.90'
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.5.89
4
+ version: 0.5.90
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-06 00:00:00.000000000 Z
11
+ date: 2015-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg