refinerycms-stores 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/Gemfile +26 -0
  2. data/Gemfile.lock +306 -0
  3. data/Guardfile +27 -0
  4. data/LICENSE.txt +20 -0
  5. data/Rakefile +65 -0
  6. data/VERSION +1 -0
  7. data/app/assets/stylesheets/refinery/refinerycms-stores.sass +76 -0
  8. data/app/controllers/refinery/addresses/admin/addresses_controller.rb +12 -0
  9. data/app/controllers/refinery/orders/admin/orders_controller.rb +12 -0
  10. data/app/controllers/refinery/orders/orders_controller.rb +96 -0
  11. data/app/controllers/refinery/products/admin/products_controller.rb +12 -0
  12. data/app/controllers/refinery/products/products_controller.rb +17 -0
  13. data/app/controllers/refinery/stores/admin/stores_controller.rb +12 -0
  14. data/app/controllers/refinery/stores/stores_controller.rb +80 -0
  15. data/app/helpers/refinery/orders/orders_helper.rb +11 -0
  16. data/app/models/refinery/addresses/address.rb +12 -0
  17. data/app/models/refinery/orders/line_item.rb +24 -0
  18. data/app/models/refinery/orders/order.rb +364 -0
  19. data/app/models/refinery/products/product.rb +17 -0
  20. data/app/models/refinery/stores/store.rb +33 -0
  21. data/app/views/refinery/addresses/admin/addresses/_actions.html.erb +25 -0
  22. data/app/views/refinery/addresses/admin/addresses/_address.html.erb +16 -0
  23. data/app/views/refinery/addresses/admin/addresses/_addresses.html.erb +2 -0
  24. data/app/views/refinery/addresses/admin/addresses/_form.html.erb +89 -0
  25. data/app/views/refinery/addresses/admin/addresses/_records.html.erb +18 -0
  26. data/app/views/refinery/addresses/admin/addresses/_sortable_list.html.erb +5 -0
  27. data/app/views/refinery/addresses/admin/addresses/edit.html.erb +1 -0
  28. data/app/views/refinery/addresses/admin/addresses/index.html.erb +7 -0
  29. data/app/views/refinery/addresses/admin/addresses/new.html.erb +1 -0
  30. data/app/views/refinery/orders/admin/orders/_actions.html.erb +25 -0
  31. data/app/views/refinery/orders/admin/orders/_form.html.erb +122 -0
  32. data/app/views/refinery/orders/admin/orders/_order.html.erb +20 -0
  33. data/app/views/refinery/orders/admin/orders/_orders.html.erb +2 -0
  34. data/app/views/refinery/orders/admin/orders/_records.html.erb +18 -0
  35. data/app/views/refinery/orders/admin/orders/_sortable_list.html.erb +5 -0
  36. data/app/views/refinery/orders/admin/orders/edit.html.erb +1 -0
  37. data/app/views/refinery/orders/admin/orders/index.html.erb +7 -0
  38. data/app/views/refinery/orders/admin/orders/new.html.erb +1 -0
  39. data/app/views/refinery/orders/orders/_address_form.html.haml +35 -0
  40. data/app/views/refinery/orders/orders/_card_form.html.haml +63 -0
  41. data/app/views/refinery/orders/orders/_order_snapshot.html.haml +44 -0
  42. data/app/views/refinery/orders/orders/confirmation.html.haml +26 -0
  43. data/app/views/refinery/orders/orders/edit.html.haml +36 -0
  44. data/app/views/refinery/orders/orders/index.html.haml +6 -0
  45. data/app/views/refinery/orders/orders/purchase.html.haml +25 -0
  46. data/app/views/refinery/orders/orders/show.html.haml +36 -0
  47. data/app/views/refinery/products/admin/products/_actions.html.erb +25 -0
  48. data/app/views/refinery/products/admin/products/_form.html.erb +127 -0
  49. data/app/views/refinery/products/admin/products/_product.html.erb +20 -0
  50. data/app/views/refinery/products/admin/products/_products.html.erb +2 -0
  51. data/app/views/refinery/products/admin/products/_records.html.erb +18 -0
  52. data/app/views/refinery/products/admin/products/_sortable_list.html.erb +5 -0
  53. data/app/views/refinery/products/admin/products/edit.html.erb +4 -0
  54. data/app/views/refinery/products/admin/products/index.html.erb +10 -0
  55. data/app/views/refinery/products/admin/products/new.html.erb +4 -0
  56. data/app/views/refinery/products/products/show.html.erb +105 -0
  57. data/app/views/refinery/stores/admin/stores/_actions.html.erb +57 -0
  58. data/app/views/refinery/stores/admin/stores/_form.html.erb +56 -0
  59. data/app/views/refinery/stores/admin/stores/_records.html.erb +18 -0
  60. data/app/views/refinery/stores/admin/stores/_sortable_list.html.erb +5 -0
  61. data/app/views/refinery/stores/admin/stores/_store.html.erb +20 -0
  62. data/app/views/refinery/stores/admin/stores/_stores.html.erb +2 -0
  63. data/app/views/refinery/stores/admin/stores/edit.html.erb +4 -0
  64. data/app/views/refinery/stores/admin/stores/index.html.erb +13 -0
  65. data/app/views/refinery/stores/admin/stores/new.html.erb +4 -0
  66. data/app/views/refinery/stores/stores/_cart.html.erb +22 -0
  67. data/app/views/refinery/stores/stores/_cart_item.html.erb +9 -0
  68. data/app/views/refinery/stores/stores/_list_product.html.erb +16 -0
  69. data/app/views/refinery/stores/stores/index.html.erb +11 -0
  70. data/app/views/refinery/stores/stores/show.html.erb +28 -0
  71. data/config/locales/en.yml +143 -0
  72. data/config/locales/es.yml +143 -0
  73. data/config/locales/fr.yml +139 -0
  74. data/config/locales/nb.yml +143 -0
  75. data/config/locales/nl.yml +143 -0
  76. data/config/routes.rb +81 -0
  77. data/db/migrate/1_create_stores_stores.rb +29 -0
  78. data/db/migrate/2_create_products_products.rb +44 -0
  79. data/db/migrate/3_create_orders_orders.rb +44 -0
  80. data/db/migrate/4_create_orders_line_items.rb +20 -0
  81. data/db/migrate/5_create_addresses_addresses.rb +39 -0
  82. data/db/seeds.rb +23 -0
  83. data/lib/generators/refinery/stores_generator.rb +17 -0
  84. data/lib/refinery/addresses/engine.rb +31 -0
  85. data/lib/refinery/addresses.rb +21 -0
  86. data/lib/refinery/cart.rb +36 -0
  87. data/lib/refinery/cart_item.rb +28 -0
  88. data/lib/refinery/orders/engine.rb +31 -0
  89. data/lib/refinery/orders.rb +21 -0
  90. data/lib/refinery/products/engine.rb +31 -0
  91. data/lib/refinery/products.rb +21 -0
  92. data/lib/refinery/store_gateway.rb +106 -0
  93. data/lib/refinery/stores/engine.rb +31 -0
  94. data/lib/refinery/stores.rb +21 -0
  95. data/lib/refinerycms-stores.rb +7 -0
  96. data/lib/tasks/refinery/stores.rake +13 -0
  97. data/readme.md +10 -0
  98. data/refinerycms-stores.gemspec +261 -0
  99. data/spec/models/refinery/addresses/address_spec.rb +18 -0
  100. data/spec/models/refinery/orders/order_spec.rb +18 -0
  101. data/spec/models/refinery/products/product_spec.rb +18 -0
  102. data/spec/models/refinery/stores/store_spec.rb +18 -0
  103. data/spec/requests/refinery/addresses/admin/addresses_spec.rb +101 -0
  104. data/spec/requests/refinery/orders/admin/orders_spec.rb +101 -0
  105. data/spec/requests/refinery/products/admin/products_spec.rb +101 -0
  106. data/spec/requests/refinery/stores/admin/stores_spec.rb +101 -0
  107. data/spec/spec_helper.rb +53 -0
  108. data/spec/support/factories/refinery/addresses.rb +7 -0
  109. data/spec/support/factories/refinery/orders.rb +7 -0
  110. data/spec/support/factories/refinery/products.rb +7 -0
  111. data/spec/support/factories/refinery/stores.rb +7 -0
  112. data/tasks/rspec.rake +6 -0
  113. data/tasks/testing.rake +8 -0
  114. data/test/helper.rb +17 -0
  115. data/test/test_refinerycms-cart.rb +7 -0
  116. metadata +571 -0
@@ -0,0 +1,18 @@
1
+ <% if searching? %>
2
+ <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
3
+ <% end %>
4
+ <div class='pagination_container'>
5
+ <% if @addresses.any? %>
6
+ <%= render 'addresses' %>
7
+ <% else %>
8
+ <p>
9
+ <% unless searching? %>
10
+ <strong>
11
+ <%= t('.no_items_yet') %>
12
+ </strong>
13
+ <% else %>
14
+ <%= t('no_results', :scope => 'refinery.admin.search') %>
15
+ <% end %>
16
+ </p>
17
+ <% end %>
18
+ </div>
@@ -0,0 +1,5 @@
1
+ <ul id='sortable_list'>
2
+ <%= render :partial => 'address', :collection => @addresses %>
3
+ </ul>
4
+ <%= render '/refinery/admin/sortable_list',
5
+ :continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true %>
@@ -0,0 +1 @@
1
+ <%= render 'form' %>
@@ -0,0 +1,7 @@
1
+ <section id='records'>
2
+ <%= render 'records' %>
3
+ </section>
4
+ <aside id='actions'>
5
+ <%= render 'actions' %>
6
+ </aside>
7
+ <%= render '/refinery/admin/make_sortable', :tree => false if !searching? and ::Refinery::Addresses::Admin::AddressesController.sortable? and ::Refinery::Addresses::Address.count > 1 %>
@@ -0,0 +1 @@
1
+ <%= render 'form' %>
@@ -0,0 +1,25 @@
1
+ <ul>
2
+ <% if ::Refinery::Orders::Admin::OrdersController.searchable? %>
3
+ <li>
4
+ <%= render '/refinery/admin/search', :url => refinery.orders_admin_orders_path %>
5
+ </li>
6
+ <% end %>
7
+ <li>
8
+ <%= link_to t('.create_new'), refinery.new_orders_admin_order_path,
9
+ :class => "add_icon" %>
10
+ </li>
11
+ <% if !searching? && ::Refinery::Orders::Admin::OrdersController.sortable? && ::Refinery::Orders::Order.any? %>
12
+ <li>
13
+ <%= link_to t('.reorder', :what => "Orders"),
14
+ refinery.orders_admin_orders_path,
15
+ :id => "reorder_action",
16
+ :class => "reorder_icon" %>
17
+
18
+ <%= link_to t('.reorder_done', :what => "Orders"),
19
+ refinery.orders_admin_orders_path,
20
+ :id => "reorder_action_done",
21
+ :style => "display: none;",
22
+ :class => "reorder_icon" %>
23
+ </li>
24
+ <% end %>
25
+ </ul>
@@ -0,0 +1,122 @@
1
+ <%= form_for [refinery, :orders_admin, @order] do |f| -%>
2
+ <%= render '/refinery/admin/error_messages',
3
+ :object => @order,
4
+ :include_object_name => true %>
5
+
6
+
7
+ <div class='field'>
8
+ <%= f.label :order_number -%>
9
+ <%= f.number_field :order_number -%>
10
+
11
+ </div>
12
+
13
+ <div class='field'>
14
+ <%= f.label :order_customer -%>
15
+ <%= f.text_field :order_customer -%>
16
+
17
+ </div>
18
+
19
+ <div class='field'>
20
+ <%= f.label :order_status -%>
21
+ <%= f.text_field :order_status -%>
22
+
23
+ </div>
24
+
25
+ <div class='field'>
26
+ <div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'>
27
+ <ul id='page_parts'>
28
+ <% [:order_notes].each_with_index do |part, part_index| %>
29
+ <li class='ui-state-default<%= ' ui-state-active' if part_index == 0 %>'>
30
+ <%= link_to t("#{part}", :scope => "activerecord.attributes.refinery/orders/order", :default => part.to_s.titleize), "##{part}" %>
31
+ </li>
32
+ <% end %>
33
+ </ul>
34
+ <div id='page_part_editors'>
35
+ <% [:order_notes].each do |part| %>
36
+ <div class='page_part' id='<%= part %>'>
37
+ <%= f.text_area part, :rows => 20, :class => 'wymeditor widest' -%>
38
+ </div>
39
+ <% end %>
40
+ </div>
41
+ </div>
42
+
43
+ </div>
44
+
45
+ <div class='field'>
46
+ <%= f.label :shipping_type -%>
47
+ <%= f.text_field :shipping_type -%>
48
+
49
+ </div>
50
+
51
+ <div class='field'>
52
+ <%= f.label :shipped_on -%>
53
+ <%= f.datetime_select :shipped_on -%>
54
+
55
+ </div>
56
+
57
+ <div class='field'>
58
+ <%= f.label :product_total -%>
59
+ <%= f.text_field :product_total -%>
60
+
61
+ </div>
62
+
63
+ <div class='field'>
64
+ <%= f.label :shipping_charges -%>
65
+ <%= f.text_field :shipping_charges -%>
66
+
67
+ </div>
68
+
69
+ <div class='field'>
70
+ <%= f.label :tax_charges -%>
71
+ <%= f.text_field :tax_charges -%>
72
+
73
+ </div>
74
+
75
+ <div class='field'>
76
+ <%= f.label :cc_last4 -%>
77
+ <%= f.text_field :cc_last4 -%>
78
+
79
+ </div>
80
+
81
+ <div class='field'>
82
+ <%= f.label :cc_card_type -%>
83
+ <%= f.text_field :cc_card_type -%>
84
+
85
+ </div>
86
+
87
+ <div class='field'>
88
+ <%= f.label :cc_expiry_month -%>
89
+ <%= f.number_field :cc_expiry_month -%>
90
+
91
+ </div>
92
+
93
+ <div class='field'>
94
+ <%= f.label :cc_expiry_year -%>
95
+ <%= f.number_field :cc_expiry_year -%>
96
+
97
+ </div>
98
+
99
+ <div class='field'>
100
+ <%= f.label :cc_token -%>
101
+ <%= f.text_field :cc_token -%>
102
+
103
+ </div>
104
+
105
+ <div class='field'>
106
+ <%= f.label :cc_purchased_on -%>
107
+ <%= f.datetime_select :cc_purchased_on -%>
108
+
109
+ </div>
110
+
111
+ <%= render '/refinery/admin/form_actions', :f => f,
112
+ :continue_editing => false,
113
+ :delete_title => t('delete', :scope => 'refinery.orders.admin.orders.order'),
114
+ :delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @order.order_status) %>
115
+ <% end -%>
116
+ <% content_for :javascripts do %>
117
+ <script>
118
+ $(document).ready(function(){
119
+ page_options.init(false, '', '');
120
+ });
121
+ </script>
122
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(order) -%>">
2
+ <span class='title'>
3
+ <%= order.order_status %>
4
+
5
+ </span>
6
+ <span class='actions'>
7
+
8
+ <%= link_to refinery_icon_tag("application_go.png"), refinery.orders_order_path(order),
9
+ :title => t('.view_live_html'),
10
+ :target => "_blank" %>
11
+
12
+ <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_orders_admin_order_path(order),
13
+ :title => t('.edit') %>
14
+ <%= link_to refinery_icon_tag("delete.png"), refinery.orders_admin_order_path(order),
15
+ :class => "cancel confirm-delete",
16
+ :title => t('.delete'),
17
+ :confirm => t('message', :scope => 'refinery.admin.delete', :title => order.order_status),
18
+ :method => :delete %>
19
+ </span>
20
+ </li>
@@ -0,0 +1,2 @@
1
+ <%= will_paginate @orders if Refinery::Orders::Admin::OrdersController.pageable? %>
2
+ <%= render 'sortable_list' %>
@@ -0,0 +1,18 @@
1
+ <% if searching? %>
2
+ <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
3
+ <% end %>
4
+ <div class='pagination_container'>
5
+ <% if @orders.any? %>
6
+ <%= render 'orders' %>
7
+ <% else %>
8
+ <p>
9
+ <% unless searching? %>
10
+ <strong>
11
+ <%= t('.no_items_yet') %>
12
+ </strong>
13
+ <% else %>
14
+ <%= t('no_results', :scope => 'refinery.admin.search') %>
15
+ <% end %>
16
+ </p>
17
+ <% end %>
18
+ </div>
@@ -0,0 +1,5 @@
1
+ <ul id='sortable_list'>
2
+ <%= render :partial => 'order', :collection => @orders %>
3
+ </ul>
4
+ <%= render '/refinery/admin/sortable_list',
5
+ :continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true %>
@@ -0,0 +1 @@
1
+ <%= render 'form' %>
@@ -0,0 +1,7 @@
1
+ <section id='records'>
2
+ <%= render 'records' %>
3
+ </section>
4
+ <aside id='actions'>
5
+ <%= render 'actions' %>
6
+ </aside>
7
+ <%= render '/refinery/admin/make_sortable', :tree => false if !searching? and ::Refinery::Orders::Admin::OrdersController.sortable? and ::Refinery::Orders::Order.count > 1 %>
@@ -0,0 +1 @@
1
+ <%= render 'form' %>
@@ -0,0 +1,35 @@
1
+ %div( id = '#{as_name.to_s}' )
2
+ = fields_for( as_name, address_form ) do |f|
3
+ = render :partial => "/refinery/admin/error_messages", :locals => { :object => address_form, :include_object_name => true }
4
+
5
+ %fieldset.modal-fieldset.clearfix2
6
+ = f.label( :first_name, 'First Name*' )
7
+ = f.text_field( :first_name )
8
+
9
+ = f.label( :last_name, 'Last Name*' )
10
+ = f.text_field( :last_name )
11
+
12
+ = f.label( :phone, 'phone' )
13
+ = f.telephone_field( :phone )
14
+
15
+ = f.label( :email, 'email')
16
+ = f.email_field( :email )
17
+
18
+ = f.label( :address1, 'address1*')
19
+ = f.text_field( :address1 )
20
+
21
+ = f.label( :address2, 'address2' )
22
+ = f.text_field( :address2 )
23
+
24
+ = f.label( :city, 'city*')
25
+ = f.text_field( :city )
26
+
27
+ = f.label( :state, 'state*' )
28
+ = f.text_field( :state )
29
+
30
+ = f.label( :zip, 'zip*' )
31
+ = f.text_field( :zip )
32
+
33
+ = f.label( :country, 'country*' )
34
+ = f.text_field( :country )
35
+
@@ -0,0 +1,63 @@
1
+ - content_for :stylesheets do
2
+ = javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"
3
+ = javascript_include_tag "https://js.stripe.com/v1/"
4
+
5
+ :javascript
6
+ Stripe.setPublishableKey( '#{@payment_gateway.payment_api_key}' );
7
+
8
+ function stripeResponseHandler(status, response) {
9
+ if (response.error) {
10
+ // re-enable the submit button
11
+ $('.submit-button').removeAttr("disabled");
12
+ // show the errors on the form
13
+ $(".payment-errors").html(response.error.message);
14
+ } else {
15
+ var form$ = $("#payment-form");
16
+ // token contains id, last4, and card type
17
+ var token = response['id'];
18
+ var cardobj = response['card'];
19
+ var last4 = cardobj['last4'];
20
+ var card_type = cardobj['type'];
21
+ // insert the token into the form so it gets submitted to the server
22
+ form$.append("<input type='hidden' name='stripeToken' value='" + token + "' />");
23
+ form$.append("<input type='hidden' name='last4' value='" + last4 + "' />");
24
+ form$.append("<input type='hidden' name='card_type' value='" + card_type + "' />");
25
+ // and submit
26
+ form$.get(0).submit();
27
+ }
28
+ }
29
+
30
+ $(document).ready(function() {
31
+ $("#payment-form").submit(function(event) {
32
+ // disable the submit button to prevent repeated clicks
33
+ $('.submit-button').attr("disabled", "disabled");
34
+ // createToken returns immediately - the supplied callback submits the form if there are no errors
35
+ // errors of all kinds will be handled by above stripeResponseHandler function and
36
+ // display in .payment-errors section of form
37
+ Stripe.createToken({
38
+ number: $('.card-number').val(),
39
+ cvc: $('.card-cvc').val(),
40
+ exp_month: $('.card-expiry-month').val(),
41
+ exp_year: $('.card-expiry-year').val()
42
+ }, stripeResponseHandler);
43
+ return false; // submit from callback
44
+ });
45
+ });
46
+
47
+ -# expects to be wrapped within a form: %form{ :method => 'post', :id => 'payment-form' }
48
+ -# expects a submit button like this: %button( type="submit" class="submit-button">Submit Payment</button )
49
+ .cc-form-errors
50
+ %span.payment-errors
51
+
52
+ .cc-form-row
53
+ = label_tag 'Card Number'
54
+ %input(type="text" size="20" autocomplete="off" class="card-number")
55
+ .cc-form-row
56
+ = label_tag 'CVC'
57
+ %input(type="text" size="4" autocomplete="off" class="card-cvc")
58
+ .cc-form-row
59
+ = label_tag 'Expiration (MM/YYYY)'
60
+ %input(type="text" size="2" autocomplete="off" class="card-expiry-month")
61
+ \/
62
+ %input(type="text" size="4" autocomplete="off" class="card-expiry-year")
63
+
@@ -0,0 +1,44 @@
1
+ #order
2
+ .order-title
3
+ %h3
4
+ Order &ndash;
5
+ = @action.to_s.gsub(/_/,' ').titleize
6
+
7
+ .order-header
8
+ %p
9
+ \#
10
+ = order_snapshot.order_number
11
+
12
+ .order-content
13
+ %ul
14
+ - order_snapshot.line_items.each do |item|
15
+ %li
16
+ .item-name= item.product.name
17
+ .item-quantity= item.quantity
18
+ .item-unit-price= item.unit_price
19
+ .item-total-price= pretty_total_price( item )
20
+
21
+ .order-totals
22
+ - sub_product = order_snapshot.total_price
23
+ - sub_discount = 0.0
24
+ - sub_shipping = 0.0
25
+ - sub_tax = 0.0
26
+ - grand_total = sub_product - sub_discount + sub_shipping + sub_tax
27
+
28
+ .sub-total-type product
29
+ .sub-total-amount= number_to_currency sub_product
30
+
31
+ .sub-total-type discount
32
+ .sub-total-amount= number_to_currency sub_discount
33
+
34
+ .sub-total-type shipping
35
+ .sub-total-amount= number_to_currency sub_shipping
36
+
37
+ .sub-total-type tax
38
+ .sub-total-amount= number_to_currency sub_shipping
39
+
40
+ .total-type purchase total
41
+ .total-amount= number_to_currency grand_total
42
+
43
+ .order-footer
44
+ &nbsp;
@@ -0,0 +1,26 @@
1
+ - content_for :stylesheets do
2
+ = stylesheet_link_tag('refinery/refinerycms-stores')
3
+
4
+ - content_for :body_content_title do
5
+ %h1 Place your order
6
+
7
+ - content_for :body_content_left do
8
+
9
+ %section
10
+ %h3 Billing Information
11
+ %h3 Shipping Information
12
+ %h3 Payment
13
+ %p
14
+ = @order.cc_card_type
15
+ xxxx-xxxx-xxxx-#{@order.cc_last4}
16
+
17
+ = link_to( 'cancel', refinery.cancel_order_orders_order_path( @order ) )
18
+ = button_to( "change", refinery.re_edit_orders_order_path( @order ), :class => "re_edit-cart" )
19
+ = button_to( "Place your order &raquo;".html_safe, refinery.purchase_orders_order_path( @order ), :class => "checkout-cart" )
20
+
21
+ - content_for :body_content_right do
22
+ %aside
23
+ = render :partial => "order_snapshot", :object => @order
24
+
25
+ = render "/refinery/content_page"
26
+
@@ -0,0 +1,36 @@
1
+ - content_for :stylesheets do
2
+ = stylesheet_link_tag('refinery/refinerycms-stores')
3
+
4
+ - content_for :body_content_title do
5
+ %h1 Order Shipping & Billing
6
+
7
+ - content_for :body_content_left do
8
+
9
+ %section
10
+ .modal-form.basic-form
11
+ = @order.errors.full_messages.inspect
12
+ = render '/refinery/admin/error_messages', :object => @order, :include_object_name => true
13
+ = form_tag( refinery.orders_order_path(@order), :method => :put, :id => 'payment-form' ) do
14
+ %h3 Your Billing Information
15
+ = render( :partial => "address_form", :object => @billing_address, :locals => { :as_name => :billing_address } )
16
+
17
+ %h3 Your Shipping Information
18
+ = check_box_tag( :use_billing, '1', false, { :onclick => "$('#shipping_address').toggle();" } )
19
+ = label_tag( :use_billing, 'use billing address for shipping', {:title => "use billing address for shipping"} )
20
+
21
+ = render( :partial => "address_form", :object => @shipping_address, :locals => { :as_name => :shipping_address } )
22
+
23
+ %h3 Your Payment Method
24
+
25
+ = render :partial => "card_form"
26
+
27
+ = link_to( 'cancel', refinery.cancel_order_orders_order_path( @order ) )
28
+ = submit_tag( 'continue', :class => "modal-submit submit-button", :value => "continue &raquo;".html_safe )
29
+
30
+
31
+ - content_for :body_content_right do
32
+ %aside
33
+ = render :partial => "order_snapshot", :object => @order
34
+
35
+ = render "/refinery/content_page"
36
+
@@ -0,0 +1,6 @@
1
+ - content_for :body_content_left do
2
+ %ul#orders
3
+ - @orders.each do |order|
4
+ %li
5
+ = link_to order.order_status, refinery.orders_order_path(order)
6
+ = render "/refinery/content_page"
@@ -0,0 +1,25 @@
1
+ - content_for :stylesheets do
2
+ = stylesheet_link_tag('refinery/refinerycms-stores')
3
+
4
+ - content_for :body_content_title do
5
+ %h1 Purchase Completed
6
+
7
+ - content_for :body_content_left do
8
+
9
+ %section
10
+ %h3= @purchase_status
11
+ - if @order.errors.empty?
12
+ %h3 Confirmation code: #{@order.cc_confirmation_id}
13
+ = link_to( "continue &raquo;".html_safe, refinery.stores_stores_path( ) )
14
+ - else
15
+ = render '/refinery/admin/error_messages', :object => @order, :include_object_name => true
16
+ = link_to( 'cancel', refinery.cancel_order_orders_order_path( @order ) )
17
+ = button_to( "change", refinery.re_edit_orders_order_path( @order ), :class => "re_edit-cart" )
18
+
19
+
20
+ - content_for :body_content_right do
21
+ %aside
22
+ = render :partial => "order_snapshot", :object => @order
23
+
24
+ = render "/refinery/content_page"
25
+
@@ -0,0 +1,36 @@
1
+ - content_for :body_content_title do
2
+ %h1
3
+ Order Number:
4
+ = @order.order_number
5
+
6
+ - content_for :body_content_left do
7
+ %section
8
+ %h1 Order Status
9
+ %p
10
+ = raw @order.order_status
11
+ %section
12
+ %h1 Shipping Type
13
+ %p
14
+ = raw @order.shipping_type
15
+ %section
16
+ %h1 Shipped On
17
+ %p
18
+ = raw @order.shipped_on
19
+ %section
20
+ %h1 Poduct Cost
21
+ %p
22
+ = raw @order.poduct_cost
23
+ %section
24
+ %h1 Shipping Cost
25
+ %p
26
+ = raw @order.shipping_cost
27
+ %section
28
+ %h1 Tax Cost
29
+ %p
30
+ = raw @order.tax_cost
31
+
32
+ - content_for :body_content_right do
33
+ %aside
34
+ %h2= t('.other')
35
+
36
+ = render "/refinery/content_page"
@@ -0,0 +1,25 @@
1
+ <ul>
2
+ <% if ::Refinery::Products::Admin::ProductsController.searchable? %>
3
+ <li>
4
+ <%= render '/refinery/admin/search', :url => refinery.products_admin_products_path %>
5
+ </li>
6
+ <% end %>
7
+ <li>
8
+ <%= link_to t('.create_new'), refinery.new_products_admin_product_path,
9
+ :class => "add_icon" %>
10
+ </li>
11
+ <% if !searching? && ::Refinery::Products::Admin::ProductsController.sortable? && ::Refinery::Products::Product.any? %>
12
+ <li>
13
+ <%= link_to t('.reorder', :what => "Products"),
14
+ refinery.products_admin_products_path,
15
+ :id => "reorder_action",
16
+ :class => "reorder_icon" %>
17
+
18
+ <%= link_to t('.reorder_done', :what => "Products"),
19
+ refinery.products_admin_products_path,
20
+ :id => "reorder_action_done",
21
+ :style => "display: none;",
22
+ :class => "reorder_icon" %>
23
+ </li>
24
+ <% end %>
25
+ </ul>