spree_bootstrap_frontend 1.0.1

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.
Files changed (66) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +7 -0
  5. data/LICENSE +23 -0
  6. data/README.md +109 -0
  7. data/Rakefile +15 -0
  8. data/app/assets/images/store/spree-header.jpg +0 -0
  9. data/app/assets/images/store/spree.png +0 -0
  10. data/app/assets/javascripts/spree/backend/spree_bootstrap_frontend.js +1 -0
  11. data/app/assets/javascripts/spree/frontend/spree_bootstrap_frontend.js +1 -0
  12. data/app/assets/stylesheets/spree/backend/spree_bootstrap_frontend.css +1 -0
  13. data/app/assets/stylesheets/spree/frontend/spree_bootstrap_frontend.css.scss +45 -0
  14. data/app/assets/stylesheets/spree/frontend/spree_frontend.css.scss +5 -0
  15. data/app/helpers/spree/base_helper_decorator.rb +57 -0
  16. data/app/helpers/spree/checkout_helper_decorator.rb +30 -0
  17. data/app/views/spree/address/_form.html.erb +75 -0
  18. data/app/views/spree/checkout/_address.html.erb +41 -0
  19. data/app/views/spree/checkout/_confirm.html.erb +13 -0
  20. data/app/views/spree/checkout/_delivery.html.erb +104 -0
  21. data/app/views/spree/checkout/_payment.html.erb +35 -0
  22. data/app/views/spree/checkout/_summary.html.erb +59 -0
  23. data/app/views/spree/checkout/edit.html.erb +38 -0
  24. data/app/views/spree/checkout/payment/_gateway.html.erb +32 -0
  25. data/app/views/spree/checkout/registration.html.erb +29 -0
  26. data/app/views/spree/layouts/spree_application.html.erb +40 -0
  27. data/app/views/spree/orders/_form.html.erb +30 -0
  28. data/app/views/spree/orders/_line_item.html.erb +36 -0
  29. data/app/views/spree/orders/edit.html.erb +45 -0
  30. data/app/views/spree/products/_cart_form.html.erb +62 -0
  31. data/app/views/spree/products/_promotions.html.erb +19 -0
  32. data/app/views/spree/products/_properties.html.erb +15 -0
  33. data/app/views/spree/products/_taxons.html.erb +14 -0
  34. data/app/views/spree/products/_thumbnails.html.erb +19 -0
  35. data/app/views/spree/products/show.html.erb +51 -0
  36. data/app/views/spree/shared/_error_messages.html.erb +12 -0
  37. data/app/views/spree/shared/_filters.html.erb +28 -0
  38. data/app/views/spree/shared/_footer.html.erb +10 -0
  39. data/app/views/spree/shared/_head.html.erb +15 -0
  40. data/app/views/spree/shared/_header.html.erb +13 -0
  41. data/app/views/spree/shared/_login.html.erb +19 -0
  42. data/app/views/spree/shared/_login_bar.html.erb +6 -0
  43. data/app/views/spree/shared/_main_nav_bar.html.erb +10 -0
  44. data/app/views/spree/shared/_nav_bar.html.erb +8 -0
  45. data/app/views/spree/shared/_order_details.html.erb +134 -0
  46. data/app/views/spree/shared/_products.html.erb +39 -0
  47. data/app/views/spree/shared/_search.html.erb +13 -0
  48. data/app/views/spree/shared/_sidebar.html.erb +3 -0
  49. data/app/views/spree/shared/_taxonomies.html.erb +6 -0
  50. data/app/views/spree/shared/_user_form.html.erb +12 -0
  51. data/app/views/spree/user_passwords/edit.html.erb +22 -0
  52. data/app/views/spree/user_passwords/new.html.erb +21 -0
  53. data/app/views/spree/user_registrations/new.html.erb +22 -0
  54. data/app/views/spree/user_sessions/new.html.erb +20 -0
  55. data/app/views/spree/users/edit.html.erb +10 -0
  56. data/app/views/spree/users/show.html.erb +43 -0
  57. data/bin/rails +7 -0
  58. data/config/locales/en.yml +5 -0
  59. data/config/routes.rb +3 -0
  60. data/lib/generators/spree_bootstrap_frontend/install/install_generator.rb +33 -0
  61. data/lib/spree_bootstrap_frontend.rb +3 -0
  62. data/lib/spree_bootstrap_frontend/engine.rb +24 -0
  63. data/lib/spree_bootstrap_frontend/factories.rb +6 -0
  64. data/spec/spec_helper.rb +82 -0
  65. data/spree_bootstrap_frontend.gemspec +33 -0
  66. metadata +289 -0
@@ -0,0 +1,13 @@
1
+ <div class="panel panel-default" id="order_details" data-hook>
2
+ <div class="panel-heading">
3
+ <h3 class="panel-title"><%= Spree.t(@order.state, :scope => :order_state).titleize %></h3>
4
+ </div>
5
+ <div class="panel-body">
6
+ <%= render :partial => 'spree/shared/order_details', :locals => { :order => @order } %>
7
+ </div>
8
+ </div>
9
+
10
+ <div class="well text-right form-buttons" data-hook="buttons">
11
+ <%= submit_tag Spree.t(:place_order), :class => 'btn btn-lg btn-success' %>
12
+ <script>Spree.disableSaveOnClick();</script>
13
+ </div>
@@ -0,0 +1,104 @@
1
+ <div class="panel panel-default" id='shipping_method' data-hook>
2
+ <div class="panel-heading">
3
+ <h3 class="panel-title"><%= Spree.t(:delivery) %></h3>
4
+ </div>
5
+ <div class="panel-body" data-hook="shipping_method_inner">
6
+ <div id="methods">
7
+ <%= form.fields_for :shipments do |ship_form| %>
8
+
9
+ <div class="shipment">
10
+ <h4 class="stock-location" data-hook="stock-location">
11
+ <%= Spree.t(:package_from) %>
12
+ <strong class="stock-location-name" data-hook="stock-location-name"><%= ship_form.object.stock_location.name %></strong>
13
+ </h4>
14
+
15
+ <table class="table stock-contents" data-hook="stock-contents">
16
+ <colgroup>
17
+ <col style="width: 10%;" />
18
+ <col style="width: 60%;" />
19
+ <col style="width: 10%;" />
20
+ <col style="width: 20%;" />
21
+ </colgroup>
22
+ <thead>
23
+ <tr class="active">
24
+ <th></th>
25
+ <th align='left'><%= Spree.t(:item) %></th>
26
+ <th><%= Spree.t(:qty) %></th>
27
+ <th><%= Spree.t(:price) %></th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>
31
+ <% ship_form.object.manifest.each do |item| %>
32
+ <tr class="stock-item">
33
+ <td class="item-image"><%= mini_image(item.variant) %></td>
34
+ <td class="item-name"><%= item.variant.name %></td>
35
+ <td class="item-qty"><%= item.quantity %></td>
36
+ <td class="item-price"><%= display_price(item.variant) %></td>
37
+ </tr>
38
+ <% end %>
39
+ </tbody>
40
+ </table>
41
+
42
+ <h4 class="stock-shipping-method-title"><%= Spree.t(:shipping_method) %></h4>
43
+ <ul class="list-group shipping-methods">
44
+ <% ship_form.object.shipping_rates.frontend.each do |rate| %>
45
+ <li class="list-group-item shipping-method">
46
+ <label>
47
+ <%= ship_form.radio_button :selected_shipping_rate_id, rate.id %>
48
+ <span class="rate-name"><%= rate.name %></span>
49
+ <span class="badge rate-cost"><%= rate.display_cost %></span>
50
+ </label>
51
+ </li>
52
+ <% end %>
53
+ </ul>
54
+ </div>
55
+
56
+ <% end %>
57
+
58
+ <% if @differentiator.try(:missing?) %>
59
+ <div class="shipment unshippable">
60
+ <h3 class="stock-location" data-hook="stock-location">
61
+ <%= Spree.t(:unshippable_items) %>
62
+ </h3>
63
+ <table class="table stock-contents" data-hook="stock-missing">
64
+ <colgroup>
65
+ <col style="width: 10%;" />
66
+ <col style="width: 60%;" />
67
+ <col style="width: 10%;" />
68
+ <col style="width: 20%;" />
69
+ </colgroup>
70
+ <thead>
71
+ <th></th>
72
+ <th align='left'><%= Spree.t(:item) %></th>
73
+ <th><%= Spree.t(:qty) %></th>
74
+ <th><%= Spree.t(:price) %></th>
75
+ </thead>
76
+ <tbody>
77
+ <% @differentiator.missing.each do |variant, quantity| %>
78
+ <tr class="stock-item">
79
+ <td class="item-image"><%= mini_image(variant) %></td>
80
+ <td class="item-name"><%= variant.name %></td>
81
+ <td class="item-qty"><%= quantity %></td>
82
+ <td class="item-price"><%= display_price(variant) %></td>
83
+ </tr>
84
+ <% end %>
85
+ </tbody>
86
+ </table>
87
+ </div>
88
+ <% end %>
89
+
90
+ </div>
91
+ <% if Spree::Config[:shipping_instructions] %>
92
+ <p id="minstrs" data-hook>
93
+ <h4><%= Spree.t(:shipping_instructions) %></h4>
94
+ <%= form.text_area :special_instructions, :cols => 40, :rows => 4, :class => "form-control" %>
95
+ </p>
96
+ <% end %>
97
+ </div>
98
+ </div>
99
+
100
+ <br />
101
+
102
+ <div class="well text-right form-buttons" data-hook="buttons">
103
+ <%= submit_tag Spree.t(:save_and_continue), :class => 'btn btn-lg btn-success' %>
104
+ </div>
@@ -0,0 +1,35 @@
1
+ <div class="panel panel-default" id="payment" data-hook>
2
+ <div class="panel-heading">
3
+ <h3 class="panel-title"><%= Spree.t(:payment_information) %></h3>
4
+ </div>
5
+ <div class="panel-body" data-hook="checkout_payment_step">
6
+ <ul class="list-group">
7
+ <% @order.available_payment_methods.each do |method| %>
8
+ <li class="list-group-item">
9
+ <label>
10
+ <%= radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, method == @order.available_payment_methods.first %>
11
+ <%= Spree.t(method.name, :scope => :payment_methods, :default => method.name) %>
12
+ </label>
13
+ </li>
14
+ <% end %>
15
+ </ul>
16
+
17
+ <ul class="nav" id="payment-methods" data-hook>
18
+ <% @order.available_payment_methods.each do |method| %>
19
+ <li id="payment_method_<%= method.id %>" class="<%= 'last' if method == @order.available_payment_methods.last %>" data-hook>
20
+ <%= render :partial => "spree/checkout/payment/#{method.method_type}", :locals => { :payment_method => method } %>
21
+ </li>
22
+ <% end %>
23
+ </ul>
24
+
25
+ <p class='field' data-hook='coupon_code'>
26
+ <%= form.label :coupon_code %><br />
27
+ <%= form.text_field :coupon_code, :class => 'form-control' %>
28
+ </p>
29
+ </div>
30
+ </div>
31
+
32
+ <div class="well text-right form-buttons" data-hook="buttons">
33
+ <%= submit_tag Spree.t(:save_and_continue), :class => 'btn btn-lg btn-success' %>
34
+ <script>Spree.disableSaveOnClick();</script>
35
+ </div>
@@ -0,0 +1,59 @@
1
+ <h3><%= Spree.t(:order_summary) %></h3>
2
+
3
+ <table class="table" data-hook="order_summary">
4
+ <tbody>
5
+ <tr data-hook="item_total">
6
+ <td><strong><%= Spree.t(:item_total) %>:</strong></td>
7
+ <td><strong><%= order.display_item_total.to_html %></strong></td>
8
+ </tr>
9
+
10
+ <% if order.line_item_adjustments.exists? %>
11
+ <tbody data-hook="order_details_promotion_adjustments">
12
+ <% @order.all_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
13
+ <tr class="total">
14
+ <td><%= label %></td>
15
+ <td><%= Spree::Money.new(adjustments.sum(&:amount)).to_html %></td>
16
+ </tr>
17
+ <% end %>
18
+ </tbody>
19
+ <% end %>
20
+
21
+ <% @order.all_adjustments.tax.eligible.group_by(&:label).each do |label, adjustments| %>
22
+ <tbody data-hook="order_details_tax_adjustments">
23
+ <% @order.all_adjustments.tax.eligible.group_by(&:label).each do |label, adjustments| %>
24
+ <tr class="total">
25
+ <td><%= label %></td>
26
+ <td><%= Spree::Money.new(adjustments.sum(&:amount)).to_html %></td>
27
+ </tr>
28
+ <% end %>
29
+ </tbody>
30
+ <% end %>
31
+
32
+ <tr data-hook="shipping_total">
33
+ <td><%= Spree.t(:shipping_total) %></td>
34
+ <td>
35
+ <%- #Spree::Money.new(@order.shipment_total).to_html -%>
36
+ </td>
37
+ </tr>
38
+
39
+ <% if order.adjustments.eligible.exists? %>
40
+ <tbody id="summary-order-charges" data-hook>
41
+ <tr>
42
+ <td colspan="2">Order adjustments</td>
43
+ </tr>
44
+ <% order.adjustments.eligible.each do |adjustment| %>
45
+ <% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
46
+ <tr class="total">
47
+ <td><%= adjustment.label %>: </td>
48
+ <td><%= adjustment.display_amount.to_html %></td>
49
+ </tr>
50
+ <% end %>
51
+ </tbody>
52
+ <% end %>
53
+
54
+ <tr data-hook="order_total">
55
+ <td><strong><%= Spree.t(:order_total) %>:</strong></td>
56
+ <td><strong><span id='summary-order-total' class="lead text-primary"><%= @order.display_total.to_html %></span></strong></td>
57
+ </tr>
58
+ </tbody>
59
+ </table>
@@ -0,0 +1,38 @@
1
+ <div id="checkout" data-hook>
2
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } %>
3
+
4
+ <div class="row" data-hook="checkout_header">
5
+ <div class="col-sm-3">
6
+ <h1 data-hook="checkout_title"><%= Spree.t(:checkout) %></h1>
7
+ </div>
8
+ <div class="col-sm-9" data-hook="checkout_progress"><%= checkout_progress %></div>
9
+ </div>
10
+
11
+ <div class="row" data-hook="checkout_content">
12
+ <div class="<%= if @order.state != 'confirm' then 'col-md-9' else 'col-md-12' end %>" data-hook="checkout_form_wrapper">
13
+ <%= form_for @order, :url => update_checkout_path(@order.state), :html => { :id => "checkout_form_#{@order.state}" } do |form| %>
14
+ <% unless @order.email? %>
15
+ <p class="field" style='clear: both'>
16
+ <%= form.label :email %><br />
17
+ <%= form.text_field :email %>
18
+ </p>
19
+ <% end %>
20
+ <%= render @order.state, :form => form %>
21
+ <% end %>
22
+ </div>
23
+ <% if @order.state != 'confirm' %>
24
+ <div id="checkout-summary" data-hook="checkout_summary_box" class="col-md-3">
25
+ <%= render :partial => 'summary', :locals => { :order => @order } %>
26
+ </div>
27
+ <% end %>
28
+ </div>
29
+ </div>
30
+
31
+ <script>
32
+ Spree.current_order_id = "<%= @order.number %>"
33
+ Spree.current_order_token = "<%= @order.token %>"
34
+ </script>
35
+
36
+ <% if I18n.locale != :en %>
37
+ <script src='/assets/jquery.validate/localization/messages_<%= I18n.locale %>.js'></script>
38
+ <% end %>
@@ -0,0 +1,32 @@
1
+ <div class="well clearfix">
2
+ <%= image_tag 'credit_cards/credit_card.gif', :id => 'credit-card-image', :class => 'pull-right' %>
3
+ <% param_prefix = "payment_source[#{payment_method.id}]" %>
4
+
5
+ <p class="field" data-hook="card_number">
6
+ <%= label_tag "card_number", Spree.t(:card_number) %><span class="required">*</span><br />
7
+ <% options_hash = Rails.env.production? ? {:autocomplete => 'off'} : {} %>
8
+ <%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(:id => 'card_number', :class => 'form-control required cardNumber', :size => 19, :maxlength => 19, :autocomplete => "off") %>
9
+ &nbsp;
10
+ <span id="card_type" style="display:none;">
11
+ ( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
12
+ <span id="unrecognized"><%= Spree.t(:unrecognized_card_type) %></span>
13
+ )
14
+ </span>
15
+ </p>
16
+ <div class="row">
17
+ <div class="col-md-8 field" data-hook="card_expiration">
18
+ <%= label_tag "card_expiry", Spree.t(:expiration) %><span class="required">*</span><br />
19
+ <%= text_field_tag "#{param_prefix}[expiry]", '', :id => 'card_expiry', :class => "form-control required cardExpiry", :placeholder => "MM / YY" %>
20
+ </div>
21
+ <div class="col-md-4 field" data-hook="card_code">
22
+ <%= label_tag "card_code", Spree.t(:card_code) %><span class="required">*</span><br />
23
+ <%= text_field_tag "#{param_prefix}[verification_value]", '', options_hash.merge(:id => 'card_code', :class => 'form-control required cardCode', :size => 5) %>
24
+ <%= link_to "(#{Spree.t(:what_is_this)})", spree.content_path('cvv'), :target => '_blank', "data-hook" => "cvv_link", :id => "cvv_link" %>
25
+ </div>
26
+ </div>
27
+
28
+ <%= hidden_field_tag "#{param_prefix}[cc_type]", '', :id => "cc_type", :class => 'ccType' %>
29
+
30
+ <%= hidden_field param_prefix, 'first_name', :value => @order.billing_firstname %>
31
+ <%= hidden_field param_prefix, 'last_name', :value => @order.billing_lastname %>
32
+ </div>
@@ -0,0 +1,29 @@
1
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
2
+ <h1><%= Spree.t(:registration) %></h1>
3
+ <div id="registration" data-hook>
4
+
5
+ <div id="account">
6
+ <!-- TODO: add partial with registration form -->
7
+ </div>
8
+
9
+ <% if Spree::Config[:allow_guest_checkout] %>
10
+ <div class="col-md-6">
11
+ <div class="panel panel-default">
12
+ <div class="panel-heading">
13
+ <h3 class="panel-title"><%= Spree.t(:guest_user_account) %></h3>
14
+ </div>
15
+ <div id="guest_checkout" class="panel-body" data-hook>
16
+ <% if flash[:registration_error] %>
17
+ <div class='flash error'><%= flash[:registration_error] %></div>
18
+ <% end %>
19
+ <%= form_for @order, :url => update_checkout_registration_path, :method => :put, :html => { :id => 'checkout_form_registration' } do |f| %>
20
+ <p>
21
+ <%= f.email_field :email, :class => 'form-control title', :placeholder => Spree.t(:email) %>
22
+ </p>
23
+ <p><%= f.submit Spree.t(:continue), :class => 'btn btn-lg btn-success btn-block' %></p>
24
+ <% end %>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ <% end %>
29
+ </div>
@@ -0,0 +1,40 @@
1
+ <!doctype html>
2
+ <!--[if lt IE 7 ]> <html class="ie ie6" lang="<%= I18n.locale %>"> <![endif]-->
3
+ <!--[if IE 7 ]> <html class="ie ie7" lang="<%= I18n.locale %>"> <![endif]-->
4
+ <!--[if IE 8 ]> <html class="ie ie8" lang="<%= I18n.locale %>"> <![endif]-->
5
+ <!--[if IE 9 ]> <html class="ie ie9" lang="<%= I18n.locale %>"> <![endif]-->
6
+ <!--[if gt IE 9]><!--><html lang="<%= I18n.locale %>"><!--<![endif]-->
7
+ <head data-hook="inside_head">
8
+ <%= render :partial => 'spree/shared/head' %>
9
+ </head>
10
+ <body class="<%= body_class %>" id="<%= @body_id || 'default' %>" data-hook="body">
11
+
12
+ <%= render :partial => 'spree/shared/header' %>
13
+
14
+ <div class="container">
15
+
16
+ <div class="row" data-hook>
17
+
18
+ <%= breadcrumbs(@taxon) %>
19
+
20
+ <%= render :partial => 'spree/shared/sidebar' if content_for? :sidebar %>
21
+
22
+ <div id="content" class="<%= !content_for?(:sidebar) ? "col-sm-12" : "col-sm-8 col-md-9" %>" data-hook>
23
+ <%= flash_messages %>
24
+ <%= yield %>
25
+ </div>
26
+
27
+ <%= yield :templates %>
28
+
29
+ </div>
30
+
31
+ </div>
32
+
33
+ <%= render :partial => 'spree/shared/footer' %>
34
+
35
+ <%= render :partial => 'spree/shared/google_analytics' %>
36
+ <script>
37
+ Spree.api_key = <%= raw(try_spree_current_user.try(:spree_api_key).to_s.inspect) %>;
38
+ </script>
39
+ </body>
40
+ </html>
@@ -0,0 +1,30 @@
1
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } %>
2
+ <table class="table" id="cart-detail" data-hook>
3
+ <thead>
4
+ <tr class="active" data-hook="cart_items_headers">
5
+ <th class="cart-item-description-header" colspan="2"><%= Spree.t(:item) %></th>
6
+ <th class="cart-item-price-header"><%= Spree.t(:price) %></th>
7
+ <th class="cart-item-quantity-header"><%= Spree.t(:qty) %></th>
8
+ <th class="cart-item-total-header"><%= Spree.t(:total) %></th>
9
+ <th class="cart-item-delete-header"></th>
10
+ </tr>
11
+ </thead>
12
+ <tbody id="line_items" data-hook>
13
+ <%= render partial: 'line_item', collection: order_form.object.line_items, locals: {order_form: order_form} %>
14
+ </tbody>
15
+ <% if false %>
16
+ <% if @order.adjustments.exists? || @order.line_item_adjustments.exists? || @order.shipment_adjustments.exists? %>
17
+ <tr class="cart-subtotal">
18
+ <td colspan="4" align='right'><h5><%= Spree.t(:cart_subtotal, :count => @order.line_items.sum(:quantity)) %></h5></th>
19
+ <td colspan><h5><%= order_form.object.display_item_total %></h5></td>
20
+ <td></td>
21
+ </tr>
22
+ <%= render "spree/orders/adjustments" %>
23
+ <% end %>
24
+ <% end %>
25
+ <tr class="warning cart-total">
26
+ <td colspan="4" align='right'><h5><%= Spree.t(:total) %></h5></th>
27
+ <td class="lead" colspan><%= order_form.object.display_total %></td>
28
+ <td></td>
29
+ </tr>
30
+ </table>
@@ -0,0 +1,36 @@
1
+ <% variant = line_item.variant -%>
2
+ <%= order_form.fields_for :line_items, line_item do |item_form| -%>
3
+ <tr class="line-item">
4
+ <td class="cart-item-image" data-hook="cart_item_image">
5
+ <% if variant.images.length == 0 %>
6
+ <%= link_to small_image(variant.product), variant.product %>
7
+ <% else %>
8
+ <%= link_to image_tag(variant.images.first.attachment.url(:small)), variant.product %>
9
+ <% end %>
10
+ </td>
11
+ <td class="cart-item-description" data-hook="cart_item_description">
12
+ <h4><%= link_to line_item.name, product_path(variant.product) %></h4>
13
+ <%= variant.options_text %>
14
+ <% if @order.insufficient_stock_lines.include? line_item %>
15
+ <span class="out-of-stock">
16
+ <%= Spree.t(:out_of_stock) %>&nbsp;&nbsp;<br />
17
+ </span>
18
+ <% end %>
19
+ <span class="line-item-description" data-hook="line_item_description">
20
+ <%= line_item_description_text(line_item.description) %>
21
+ </span>
22
+ </td>
23
+ <td class="lead text-primary cart-item-price" data-hook="cart_item_price">
24
+ <%= line_item.single_money.to_html %>
25
+ </td>
26
+ <td class="cart-item-quantity" data-hook="cart_item_quantity">
27
+ <%= item_form.number_field :quantity, :min => 0, :class => "form-control line_item_quantity", :size => 5 %>
28
+ </td>
29
+ <td class="lead text-primary cart-item-total" data-hook="cart_item_total">
30
+ <%= line_item.display_amount.to_html unless line_item.quantity.nil? %>
31
+ </td>
32
+ <td class="cart-item-delete" data-hook="cart_item_delete">
33
+ <%= link_to image_tag('icons/delete.png'), '#', :class => 'delete', :id => "delete_#{dom_id(line_item)}" %>
34
+ </td>
35
+ </tr>
36
+ <% end -%>
@@ -0,0 +1,45 @@
1
+ <% @body_id = 'cart' %>
2
+
3
+ <h1><%= Spree.t(:shopping_cart) %></h1>
4
+
5
+ <% if @order.line_items.empty? %>
6
+
7
+ <div data-hook="empty_cart">
8
+ <div class="alert alert-info"><%= Spree.t(:your_cart_is_empty) %></div>
9
+ <p><%= link_to Spree.t(:continue_shopping), products_path, :class => 'btn btn-default' %></p>
10
+ </div>
11
+
12
+ <% else %>
13
+ <div data-hook="outside_cart_form">
14
+ <%= form_for @order, :url => update_cart_path, :html => {:id => 'update-cart'} do |order_form| %>
15
+ <div data-hook="inside_cart_form">
16
+
17
+ <div data-hook="cart_items">
18
+ <%= render :partial => 'form', :locals => { :order_form => order_form } %>
19
+ </div>
20
+
21
+ <div class="links col-md-6 navbar-form pull-right text-right" data-hook="cart_buttons">
22
+ <div class="form-group">
23
+ <%= order_form.text_field :coupon_code, :size => 10, :placeholder => Spree.t(:coupon_code), class: "form-control form-control-inline" %></div>
24
+ <%= button_tag :class => 'btn btn-primary', :id => 'update-button' do %>
25
+ <%= Spree.t(:update) %>
26
+ <% end %>
27
+ <%= button_tag :class => 'btn btn-lg btn-success', :id => 'checkout-link', :name => 'checkout' do %>
28
+ <%= Spree.t(:checkout) %>
29
+ <% end %>
30
+ </div>
31
+ </div>
32
+ <% end %>
33
+ </div>
34
+
35
+ <div id="empty-cart" class="col-md-6 pull-left" data-hook>
36
+ <%= form_tag empty_cart_path, :method => :put do %>
37
+ <p id="clear_cart_link" data-hook>
38
+ <%= submit_tag Spree.t(:empty_cart), :class => 'btn btn-default' %>
39
+ <%= Spree.t(:or) %>
40
+ <%= link_to Spree.t(:continue_shopping), products_path, :class => 'continue' %>
41
+ </p>
42
+ <% end %>
43
+ </div>
44
+
45
+ <% end %>