caboose-cms 0.5.110 → 0.5.111

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmU2ZDE0NjkyYTRkNmYyNjViNGE3N2FlMmVhZGNlYzIwY2JkZjM1Yw==
4
+ N2E3NTQ0YTk2ZTM3YmEzMjllYzk0N2U3Y2FlMzBkYWE5MGQ2YTVlZQ==
5
5
  data.tar.gz: !binary |-
6
- YjI5ZDRiYWJmYmYwMDBmOWIxMDY0ZmNhM2NiMWM1NDcyZjg4MmNjYQ==
6
+ ZjViMjY5YWU2MTE3MGE4MzdiMDM1MzM4ODZhOTM5YzBiOTlhYWQ3Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Zjg3MmYwZDUwYzNlZjg1YmQ2OWJiYzNlYTBkMWNmYmE5NTYxMDE3ZTMzMjE2
10
- M2FmMDM2NWM0YTlkOWM1NTkxNzM3MTVhMjA3YWZiOWIyZWQyNGIzYTA0ZmMz
11
- Mjk3YWE5OGFiN2I2ZDQzMTBlYWZiZTM4YjI4YzJlMTllODcwNjE=
9
+ MjI4OGM4ODFkYTU3Y2U5MGU4ZjJjZDNiMWY5ZjUzZGIzNWMzMDljM2Y2MTMy
10
+ ZjRjNjMwNDc1YTYzMDk0OWRjMWE5Y2NmNzE2NTMwMDlmZDBkYjI5NjU3MWM1
11
+ YTRjNmM3ODJjYTIwMTZhOTkwYWE3NGJhNjFmYzEyNjAzODNkY2E=
12
12
  data.tar.gz: !binary |-
13
- YjY3NzQxNWNjNGZhMmVkNjg1YTBjZmZlODQ1OWUxNWE2NDFlYmJkYjY2Mjgz
14
- NWZhMDNlNDQ0MTAwOTMyODIwMDE5MThlYjE4ZmJkMmRmMzk3YzhkMTBmNzI4
15
- Mjk0MTdmYTk5NTExNzI2N2Y0YzYyYWY2YzI3ZmIzOTQzOGYyODk=
13
+ OWEyOTMwMmJkZmQxMTUzN2VhYzhjYTA4ODU1YTk0MDA5MGUzZDk3NzEyN2Iw
14
+ NTliZDAxYTQyMDIwYWJhMjBkMjIxYjE3NTAwNWFiNjQ3NTkyMzkxYTUzOTg1
15
+ ZWU3NWI3OWJiMThiOTk2NDg5MjA3NTA0MDZhOGE2Zjg0YmVjNzE=
@@ -3,9 +3,13 @@ require 'prawn'
3
3
  module Caboose
4
4
  class OrderPdf < Prawn::Document
5
5
 
6
- attr_accessor :order
6
+ attr_accessor :order, :card_type, :card_number
7
7
 
8
8
  def to_pdf
9
+
10
+ # Get the type of card and last four digits
11
+ get_card_details
12
+
9
13
  #image open("https://dmwwflw4i3miv.cloudfront.net/logo.png"), :position => :center
10
14
  text " "
11
15
  customer_info
@@ -14,6 +18,33 @@ module Caboose
14
18
  render
15
19
  end
16
20
 
21
+ def formatted_phone(str)
22
+ return '' if str.nil?
23
+ str = str.gsub(/[^0-9]/i, '')
24
+ return "#{str[0]} (#{str[1..3]}) #{str[4..6]}-#{str[7..10]}" if str.length == 11
25
+ return "(#{str[0..2]}) #{str[3..5]}-#{str[6..9]}" if str.length == 10
26
+ return "#{str[0..2]}-#{str[3..6]}" if str.length == 7
27
+ return str
28
+ end
29
+
30
+ def get_card_details
31
+
32
+ sc = self.order.site.store_config
33
+ ot = self.order.order_transactions.where(:transaction_type => OrderTransaction::TYPE_AUTHORIZE, :success => true).first
34
+
35
+ case sc.pp_name
36
+ when 'authorize.net'
37
+
38
+ t = AuthorizeNet::Reporting::Transaction.new(sc.pp_username, sc.pp_password)
39
+ resp = t.get_transaction_details(ot.transaction_id)
40
+ t2 = resp.transaction
41
+ self.card_type = t2.payment_method.card_type
42
+ self.card_number = t2.payment_method.card_number.gsub('X', '')
43
+
44
+ end
45
+
46
+ end
47
+
17
48
  def customer_info
18
49
 
19
50
  order_info = "Order ##{order.id}\n"
@@ -24,7 +55,7 @@ module Caboose
24
55
  end
25
56
 
26
57
  c = order.customer
27
- billed_to = "#{c.first_name} #{c.last_name}\n#{c.email}\n#{c.phone}"
58
+ billed_to = "#{c.first_name} #{c.last_name}\n#{c.email}\n#{self.formatted_phone(c.phone)}\n#{self.card_type} ending in #{self.card_number}"
28
59
 
29
60
  sa = order.shipping_address
30
61
  shipped_to = "#{sa.name}\n#{sa.address1}\n"
@@ -27,7 +27,7 @@ b = @block
27
27
  <%
28
28
  #kids = cat.block_types.where("parent_id is null and (site_id is null or site_id = ?)", @site.id).reorder(:name).all
29
29
  arr = ["parent_id is null and block_type_category_id = ? and block_type_site_memberships.site_id = ?", cat.id, @site.id]
30
- kids = Caboose::BlockType.includes(:block_type_site_memberships).where(arr).reorder(:name).all
30
+ kids = Caboose::BlockType.includes(:block_type_site_memberships).where(arr).reorder(:description).all
31
31
  %>
32
32
  <% if kids && kids.count > 0 %>
33
33
  <h2 onclick="$('#cat<%= cat.id %>_container').slideToggle();"><%= cat.name %></h3>
@@ -1,8 +1,8 @@
1
1
  <div class="constrain">
2
2
  <div id='cart'></div>
3
- <p class='controls'>
4
- <input type='button' value='Continue Shopping' onclick="window.location='/products';" />
5
- <input type='button' value='Checkout' onclick="window.location='/checkout';" />
3
+ <p class='controls' style="text-align:right;margin-top:15px;">
4
+ <input class="btn" type='button' value='Continue Shopping' onclick="window.location='/products';" />
5
+ <input class="btn" type='button' value='Checkout' onclick="window.location='/checkout';" />
6
6
  </p>
7
7
  </div>
8
8
 
@@ -17,7 +17,8 @@
17
17
  <div class="constrain" id='signin_form_container'>
18
18
  <form action="/login" method="post" id='signin_form'>
19
19
  <p><input name="username" type="text" placeholder="Email" /></p>
20
- <p><input name="password" type="password" placeholder="Password" /></p>
20
+ <label class="small">Password:</label>
21
+ <p><input name="password" type="password" /></p>
21
22
  <p><input type="submit" value="Continue" /></p>
22
23
  </form>
23
24
  </div>
@@ -27,8 +28,10 @@
27
28
  <p><input name="last_name" type="text" placeholder="Last Name" /></p>
28
29
  <p><input name="email" type="text" placeholder="Email" /></p>
29
30
  <p><input name="phone" type="text" placeholder="Phone" /></p>
30
- <p><input name="pass1" type="password" placeholder="Password" /></p>
31
- <p><input name="pass2" type="password" placeholder="Confirm Password" /></p>
31
+ <label class="small">Password:</label>
32
+ <p><input name="pass1" type="password" /></p>
33
+ <label class="small">Confirm Password:</label>
34
+ <p><input name="pass2" type="password" /></p>
32
35
  <p><input name='newsletter' id='newsletter' type='checkbox' value='1' /> <label for='newsletter'>Send me updates on new products and special deals</label></p>
33
36
  <p><input type="submit" value="Continue" /></p>
34
37
  </form>
@@ -51,4 +54,12 @@
51
54
  <%= content_for :caboose_css do %>
52
55
  <%= stylesheet_link_tag 'caboose/message_boxes' %>
53
56
  <%= stylesheet_link_tag 'caboose/checkout' %>
57
+ <style>
58
+ label.small {
59
+ font-size: 14px;
60
+ margin: 0 0 3px 0;
61
+ padding-left: 5px;
62
+ color: rgb(79, 79, 79);
63
+ }
64
+ </style>
54
65
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.110'
2
+ VERSION = '0.5.111'
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.110
4
+ version: 0.5.111
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-12 00:00:00.000000000 Z
11
+ date: 2015-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg