op_cart 0.0.12 → 0.1.0

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: 32b387aaa77d790a4531b2632ee96549d64e9e19
4
- data.tar.gz: f9d4749e1df95fa59d4e958afcfc6e1e8858791e
3
+ metadata.gz: b53bcf845fbb66f6499ce3c4379859f668bf0a57
4
+ data.tar.gz: bc9c5fc2170f6e18c1820eac88e796185d11a13a
5
5
  SHA512:
6
- metadata.gz: d15243927655156b24360107719bf6e2c08edb8f03d3c3332a3f8601416c4b51fde9f3eeb33b26d3c394a484deccda34e96d01fd4cf904c97931c33c897bc5ac
7
- data.tar.gz: f9db8fd0ba1c303c0c76b95aa0badd6fc870ae5d577345eb899a6442dbb372593be8f749c6dd15e23267f54ea7124082fe9397dc9ca038c8894263360529f245
6
+ metadata.gz: 2efa883210203ab59244df6053ccb5ff706740806b87e097b0da27870b29febd219f35fdc4f8f615a8c462fecb4176670d9d13f838b877aa1049097f6ef7749e
7
+ data.tar.gz: c185243268ffb1c4f6ef97d7a9658d2a14889b5f2659851a3ac782ef1454c08b278f8fe7b2302538466656d1b870fbc062962348bd77d0c580d87e505c1e891f
@@ -75,10 +75,10 @@
75
75
  @updateDisplayedQuantity productId
76
76
 
77
77
  updateDisplayedQuantities: ->
78
- $('li[data-product-id]').each -> OpCart.updateDisplayedQuantity $(@).data('product-id')
78
+ $('[data-product-id]').each -> OpCart.updateDisplayedQuantity $(@).data('product-id')
79
79
 
80
80
  updateDisplayedQuantity: (productId) ->
81
- $quantity = $ "#line_item_product_#{productId} .quantity .value"
81
+ $quantity = $ "#line_item_product_#{productId} .quantity"
82
82
  $quantity.html @lineItemQuantity(productId)
83
83
 
84
84
  lineItemQuantity: (productId, quantity) ->
@@ -67,7 +67,7 @@ module OpCart
67
67
  end
68
68
 
69
69
  unless signed_in?
70
- sign_in User.create name: params[:order][:shipping_address][:full_name],
70
+ sign_in User.create name: params[:shipping_address][:full_name],
71
71
  email: params[:user][:email], password: params[:user][:password],
72
72
  password_confirmation: params[:user][:password]
73
73
  end
@@ -1,65 +1,80 @@
1
- - if @products.present?
2
- .new_order
3
- h2 Purchasble Items
4
- ul style="list-style-type: none"
5
- - @products.each do |product|
6
- li id="#{dom_id product}" data-product-id=(product.id)
7
- p = product.name
8
- p = product.description
9
- p = number_to_currency product.price / 100
10
- p
11
- a href="#" onclick="OpCart.addItemToOrder(#{product.id}, 1); return false" Add to Order
1
+ .op-cart_content
2
+ - if @products.present?
3
+ .op-cart_new-order
4
+ .op-cart_purchasable-items
5
+ h2 Purchasable Items
6
+ table
7
+ thead
8
+ tr
9
+ th Product Name
10
+ th Description
11
+ th Price
12
+ th
13
+ tbody
14
+ - @products.each do |product|
15
+ tr id="#{dom_id product}" data-product-id=(product.id)
16
+ td = product.name
17
+ td = product.description
18
+ td = number_to_currency product.price / 100
19
+ td
20
+ a.op-cart_add href="#" onclick="OpCart.addItemToOrder(#{product.id}, 1); return false" Add to Order
12
21
 
13
- h2 Items in Order
14
- ul style="list-style-type: none"
15
- - @products.each do |product|
16
- li id="#{dom_id product, 'line_item'}"
17
- p = product.name
18
- p = number_to_currency product.price / 100
19
- p.quantity
20
- span.name Quantity: 
21
- span.value 0
22
- p
23
- a href="#" onclick="OpCart.removeItemFromOrder(#{product.id}); return false" Remove
22
+ .op-cart_items-in-order
23
+ h2 Items in Order
24
+ table
25
+ thead
26
+ tr
27
+ th Product Name
28
+ th Price
29
+ th Qty
30
+ th
31
+ tbody
32
+ - @products.each do |product|
33
+ tr id="#{dom_id product, 'line_item'}"
34
+ td = product.name
35
+ td = number_to_currency product.price / 100
36
+ td.quantity 0
37
+ td
38
+ a.op-cart_remove href="#" onclick="OpCart.removeItemFromOrder(#{product.id}); return false" Remove
24
39
 
25
- = simple_form_for @order, data: { stripe_key: Rails.configuration.stripe[:publishable_key] } do |f|
26
- span.payment-errors
27
- p
28
- h2 Your Information
29
- - if signed_in?
30
- strong Email: 
31
- span = current_user.email
32
- - else
33
- = simple_fields_for :user do |fu|
34
- = fu.input :email, autofocus: true, input_html: { autocomplete: 'email' }
35
- = fu.input :password
40
+ = simple_form_for @order, data: { stripe_key: Rails.configuration.stripe[:publishable_key] } do |f|
41
+ span.payment-errors
42
+ .op-cart_your-information
43
+ h2 Your Information
44
+ - if signed_in?
45
+ strong Email: 
46
+ span = current_user.email
47
+ - else
48
+ = simple_fields_for :user do |fu|
49
+ = fu.input :email, autofocus: true, input_html: { autocomplete: 'email' }
50
+ = fu.input :password
36
51
 
37
- p
38
- h2 Shipping Address
39
- = simple_fields_for :shipping_address do |sa|
40
- - focus_name = signed_in? ? true : false
41
- = sa.input :full_name, autofocus: focus_name, input_html: { autocomplete: 'name' }
42
- = sa.input :street, input_html: { autocomplete: 'street-address' }
43
- = sa.input :postal_code, input_html: { autocomplete: 'postal-code' }
44
- = sa.input :locality, disabled: true, input_html: { autocomplete: 'city' }
45
- = sa.input :region, disabled: true, input_html: { autocomplete: 'state' }
52
+ .op-cart_shipping-address
53
+ h2 Shipping Address
54
+ = simple_fields_for :shipping_address do |sa|
55
+ - focus_name = signed_in? ? true : false
56
+ = sa.input :full_name, autofocus: focus_name, input_html: { autocomplete: 'name' }
57
+ = sa.input :street, input_html: { autocomplete: 'street-address' }
58
+ = sa.input :postal_code, input_html: { autocomplete: 'postal-code' }
59
+ = sa.input :locality, disabled: true, input_html: { autocomplete: 'city' }
60
+ = sa.input :region, disabled: true, input_html: { autocomplete: 'state' }
46
61
 
47
- p
48
- h2 Card Details
49
- - if f.object.card_token.present?
50
- span Card information already provided.
51
- - else
52
- #card_form_inputs
53
- = simple_fields_for :credit_card do |c|
54
- = c.input :number, input_html: { autocomplete: 'cc-number' }
55
- = c.input :expiry, input_html: { autocomplete: 'cc-exp' }
56
- = c.input :cvc, input_html: { autocomplete: 'cc-csc' }
62
+ .op-cart_card-details
63
+ h2 Card Details
64
+ - if f.object.card_token.present?
65
+ span Card information already provided.
66
+ - else
67
+ #card_form_inputs
68
+ = simple_fields_for :credit_card do |c|
69
+ = c.input :number, input_html: { autocomplete: 'cc-number' }
70
+ = c.input :expiry, input_html: { autocomplete: 'cc-exp' }
71
+ = c.input :cvc, input_html: { autocomplete: 'cc-csc' }
57
72
 
58
- = simple_fields_for :line_items do |li|
59
- = li.input :quantities_json, as: :hidden
60
- = f.input :card_token, as: :hidden
73
+ = simple_fields_for :line_items do |li|
74
+ = li.input :quantities_json, as: :hidden
75
+ = f.input :card_token, as: :hidden
61
76
 
62
- .form-actions
63
- = f.button :button, "Submit Payment"
64
- - else
65
- p Add an item to your order to begin.
77
+ .form-actions
78
+ = f.button :button, "Submit Payment"
79
+ - else
80
+ p Add an item to your order to begin.
@@ -1,24 +1,25 @@
1
- .new_order
2
- h2 Items in Order
3
- ul
4
- - @order.line_items.each do |line_item|
5
- li id="#{dom_id line_item}"
6
- p = line_item.sellable.name
7
- p.quantity
8
- = line_item.quantity
9
- |  @ 
10
- = number_to_currency line_item.unit_price / 100
11
- |  = 
12
- = number_to_currency line_item.total / 100
13
- li
14
- p Order Total: #{number_to_currency @order.total / 100}
1
+ .op-cart_content
2
+ .op-cart_new-order
3
+ h2 Items in Order
4
+ ul.op-cart_items-in-order
5
+ - @order.line_items.each do |line_item|
6
+ li id="#{dom_id line_item}"
7
+ p = line_item.sellable.name
8
+ p.quantity
9
+ = line_item.quantity
10
+ |  @ 
11
+ = number_to_currency line_item.unit_price / 100
12
+ |  = 
13
+ = number_to_currency line_item.total / 100
14
+ li
15
+ p Order Total: #{number_to_currency @order.total / 100}
15
16
 
16
- p
17
- h2 Your Information
18
- = @order.user.email
19
- p
20
- h2 Shipping Address
21
- - sa = @order.shipping_address
22
- p = sa.full_name
23
- p = sa.street
24
- p = "#{sa.locality}, #{sa.region} #{sa.postal_code}"
17
+ .op-cart_your-information
18
+ h2 Your Information
19
+ = @order.user.email
20
+ .op-cart_shipping-address
21
+ h2 Shipping Address
22
+ - sa = @order.shipping_address
23
+ p = sa.full_name
24
+ p = sa.street
25
+ p = "#{sa.locality}, #{sa.region} #{sa.postal_code}"
@@ -1,3 +1,3 @@
1
1
  module OpCart
2
- VERSION = "0.0.12"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: op_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Boehs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-26 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails