solidus_auction 0.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 (122) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +26 -0
  3. data/README.md +57 -0
  4. data/Rakefile +30 -0
  5. data/app/assets/javascripts/auctions.js +2 -0
  6. data/app/assets/javascripts/countdown.js +20 -0
  7. data/app/assets/javascripts/local-time.js +1 -0
  8. data/app/assets/javascripts/spree/backend/product_autocomplete.js +50 -0
  9. data/app/assets/javascripts/spree/backend/solidus_auction.js +7 -0
  10. data/app/assets/javascripts/spree/ends_in.js +31 -0
  11. data/app/assets/javascripts/spree/frontend/solidus_auction.js +8 -0
  12. data/app/assets/javascripts/spree/frontend/starts_in.js +32 -0
  13. data/app/assets/javascripts/spree/frontend/votes.js +83 -0
  14. data/app/assets/stylesheets/spree/backend/solidus_auction.css +16 -0
  15. data/app/assets/stylesheets/spree/frontend/solidus_auction.css +24 -0
  16. data/app/controllers/spree/admin/auction_settings_controller.rb +16 -0
  17. data/app/controllers/spree/admin/auctions_controller.rb +46 -0
  18. data/app/controllers/spree/admin/bids_controller.rb +2 -0
  19. data/app/controllers/spree/admin/resource_controller_decorator.rb +9 -0
  20. data/app/controllers/spree/auctions_controller.rb +52 -0
  21. data/app/controllers/spree/bids_controller.rb +48 -0
  22. data/app/controllers/spree/helpers/local_time_helper.rb +77 -0
  23. data/app/controllers/spree/users_controller_decorator.rb +5 -0
  24. data/app/controllers/spree/votes_controller.rb +5 -0
  25. data/app/helpers/spree/strong_params_decorator.rb +8 -0
  26. data/app/models/spree/auction.rb +291 -0
  27. data/app/models/spree/auction_ability.rb +13 -0
  28. data/app/models/spree/bid.rb +19 -0
  29. data/app/models/spree/product_decorator.rb +3 -0
  30. data/app/models/spree/user_decorator.rb +5 -0
  31. data/app/models/spree/variant_decorator.rb +3 -0
  32. data/app/overrides/add_auction_links_to_order_info.rb +6 -0
  33. data/app/overrides/add_auction_settings_tab.rb +8 -0
  34. data/app/overrides/add_auctions_tab_to_admin.rb +8 -0
  35. data/app/overrides/add_auctions_table_to_user_show.rb +6 -0
  36. data/app/overrides/add_auctions_to_main_nav.rb +6 -0
  37. data/app/overrides/add_timezone_to_admin.rb +8 -0
  38. data/app/overrides/change_line_item_delete_button.rb +6 -0
  39. data/app/overrides/change_line_item_link_to.rb +6 -0
  40. data/app/overrides/change_line_item_number_field_disabled.rb +6 -0
  41. data/app/overrides/change_order_item_description.rb +6 -0
  42. data/app/overrides/change_stock_item_name.rb +6 -0
  43. data/app/overrides/change_variant_row_show.rb +6 -0
  44. data/app/overrides/change_variant_stock_item_show.rb +6 -0
  45. data/app/validators/in_future_validator.rb +10 -0
  46. data/app/views/spree/admin/active_shipping_settings/edit.html.erb +108 -0
  47. data/app/views/spree/admin/auction_settings/edit.html.erb +45 -0
  48. data/app/views/spree/admin/auctions/_form.html.erb +189 -0
  49. data/app/views/spree/admin/auctions/edit.html.erb +18 -0
  50. data/app/views/spree/admin/auctions/index.html.erb +89 -0
  51. data/app/views/spree/admin/auctions/new.html.erb +14 -0
  52. data/app/views/spree/admin/shared/_auction_links_to_order_info.html.erb +18 -0
  53. data/app/views/spree/admin/shared/_auction_settings_button.html.erb +3 -0
  54. data/app/views/spree/admin/shared/_auctions_tab.html.erb +3 -0
  55. data/app/views/spree/admin/shared/_time_zone_field.html.erb +5 -0
  56. data/app/views/spree/auctions/_bid_form.html.erb +81 -0
  57. data/app/views/spree/auctions/_bids.html.erb +52 -0
  58. data/app/views/spree/auctions/_image.html.erb +5 -0
  59. data/app/views/spree/auctions/_promotions.html.erb +19 -0
  60. data/app/views/spree/auctions/_properties.html.erb +15 -0
  61. data/app/views/spree/auctions/_taxons.html.erb +14 -0
  62. data/app/views/spree/auctions/_thumbnails.html.erb +19 -0
  63. data/app/views/spree/auctions/index.html.erb +3 -0
  64. data/app/views/spree/auctions/show.html.erb +58 -0
  65. data/app/views/spree/bids/index.html.erb +0 -0
  66. data/app/views/spree/bids/new.html.erb +0 -0
  67. data/app/views/spree/products/_cart_form.html.erb +65 -0
  68. data/app/views/spree/products/_promotions.html.erb +19 -0
  69. data/app/views/spree/products/_properties.html.erb +15 -0
  70. data/app/views/spree/products/_taxons.html.erb +14 -0
  71. data/app/views/spree/products/_thumbnails.html.erb +19 -0
  72. data/app/views/spree/products/index.html.erb +15 -0
  73. data/app/views/spree/products/show.html.erb +51 -0
  74. data/app/views/spree/shared/_auction_order_link.html.erb +9 -0
  75. data/app/views/spree/shared/_auctions.html.erb +39 -0
  76. data/app/views/spree/shared/_auctions_link.html.erb +7 -0
  77. data/app/views/spree/shared/_auctions_table_show.html.erb +93 -0
  78. data/app/views/spree/shared/_ends_in.html.erb +14 -0
  79. data/app/views/spree/shared/_image.html.erb +12 -0
  80. data/app/views/spree/shared/_line_item_delete.html.erb +5 -0
  81. data/app/views/spree/shared/_line_item_link_to.erb +22 -0
  82. data/app/views/spree/shared/_line_item_number_field_disabled.erb +9 -0
  83. data/app/views/spree/shared/_order_item_description.html.erb +15 -0
  84. data/app/views/spree/shared/_starts_in.html.erb +14 -0
  85. data/app/views/spree/shared/_stock_item_name.html.erb +5 -0
  86. data/app/views/spree/shared/_time_in_words_display.html.erb +11 -0
  87. data/app/views/spree/shared/_variant_row_disable.html.erb +21 -0
  88. data/app/views/spree/shared/_variant_stock_item_disable.html.erb +62 -0
  89. data/app/views/spree/shared/_votes.html.erb +12 -0
  90. data/app/views/spree/votes/index.html.erb +13 -0
  91. data/config/locales/en.yml +76 -0
  92. data/config/routes.rb +17 -0
  93. data/db/migrate/20180225234309_create_auctions.rb +25 -0
  94. data/db/migrate/20180225235226_create_bids.rb +13 -0
  95. data/db/migrate/20180316051158_add_deleted_to_spree_auction.rb +5 -0
  96. data/db/migrate/20180320010358_change_auction_reserve_price_column_to_big_decimal.rb +8 -0
  97. data/db/migrate/20180321203019_add_time_zone_to_spree_user.rb +5 -0
  98. data/db/migrate/20180322014713_add_default_to_datetimes.rb +7 -0
  99. data/db/migrate/20180328233438_add_variant_id_to_auction.rb +5 -0
  100. data/db/migrate/20180410025053_acts_as_votable_migration.rb +22 -0
  101. data/db/migrate/20180410031333_add_cached_votes_to_spree_auctions.rb +13 -0
  102. data/lib/assets/javascripts/src/local-time/calendar_date.coffee +37 -0
  103. data/lib/assets/javascripts/src/local-time/config/i18n.coffee +74 -0
  104. data/lib/assets/javascripts/src/local-time/config/locale.coffee +2 -0
  105. data/lib/assets/javascripts/src/local-time/config/timer.coffee +1 -0
  106. data/lib/assets/javascripts/src/local-time/controller.coffee +59 -0
  107. data/lib/assets/javascripts/src/local-time/helpers/date_parse.coffee +15 -0
  108. data/lib/assets/javascripts/src/local-time/helpers/dom.coffee +11 -0
  109. data/lib/assets/javascripts/src/local-time/helpers/i18n.coffee +24 -0
  110. data/lib/assets/javascripts/src/local-time/helpers/strftime.coffee +55 -0
  111. data/lib/assets/javascripts/src/local-time/index.coffee +20 -0
  112. data/lib/assets/javascripts/src/local-time/page_observer.coffee +43 -0
  113. data/lib/assets/javascripts/src/local-time/relative_time.coffee +72 -0
  114. data/lib/assets/javascripts/src/local-time/start.coffee +25 -0
  115. data/lib/generators/solidus_auction/install/install_generator.rb +30 -0
  116. data/lib/local_time.rb +0 -0
  117. data/lib/solidus_auction.rb +3 -0
  118. data/lib/solidus_auction/configuration.rb +8 -0
  119. data/lib/solidus_auction/engine.rb +29 -0
  120. data/lib/solidus_auction/factories.rb +19 -0
  121. data/lib/solidus_auction/version.rb +3 -0
  122. metadata +388 -0
@@ -0,0 +1,18 @@
1
+ <% content_for :page_actions do %>
2
+ <% if can?(:create, Spree::Auction) %>
3
+ <li id="new_product_link">
4
+ <%= link_to t('spree.new_auction'), new_object_url, id: 'admin_new_auction', class: 'btn btn-primary' %>
5
+ </li>
6
+ <% end %>
7
+ <% end %>
8
+
9
+ <%= render partial: 'spree/shared/error_messages', locals: { target: @auction } %>
10
+
11
+ <%= form_for [:admin, @auction], html: { multipart: true } do |f| %>
12
+ <fieldset class="no-border-top">
13
+ <%= render partial: 'form', locals: { f: f, auction: @auction } %>
14
+ <% if can?(:update, @auction) %>
15
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
16
+ <% end %>
17
+ </fieldset>
18
+ <% end %>
@@ -0,0 +1,89 @@
1
+ <% admin_layout "full-width" %>
2
+
3
+ <% admin_breadcrumb(plural_resource_name(Spree::Auction)) %>
4
+
5
+ <% content_for :page_actions do %>
6
+ <li>
7
+ <%= link_to t('spree.new_auction'), new_object_url, class: 'btn btn-primary' %>
8
+ </li>
9
+ <% end if can?(:create, Spree::Auction) %>
10
+
11
+ <div id="new_auction_wrapper" data-hook></div>
12
+
13
+
14
+ <% if @collection.count > 0 %>
15
+ <table class="index" id="listing_auctions">
16
+ <colgroup>
17
+ <col style="width: 15%;">
18
+ <col style="width: 10%;">
19
+ <col style="width: 10%;">
20
+ <col style="width: 5%;">
21
+ <col style="width: 20%;">
22
+ <col style="width: 20%;">
23
+ <col style="width: 20%;">
24
+ <col style="width: 5%;">
25
+ </colgroup>
26
+ <thead>
27
+ <tr data-hook="admin_auctions_index_headers">
28
+ <th><%= Spree.t("title") %></th>
29
+ <th><%= Spree.t("starting_price") %></th>
30
+ <th><%= Spree.t("current_price") %></th>
31
+ <th><%= Spree.t("bids") %></th>
32
+ <th><%= Spree.t("starting_datetime") %></th>
33
+ <th><%= Spree.t("current_end_datetime") %></th>
34
+ <th><%= Spree.t("ends_in") %></th>
35
+ <th></th>
36
+ </tr>
37
+ </thead>
38
+ <tbody>
39
+ <% @collection.each do |auction| %>
40
+ <tr <%== "style='color: red;'" if auction.deleted? %> id="<%= spree_dom_id auction %>" data-hook="admin_auctions_index_rows">
41
+ <td>
42
+ <span class="bold">
43
+ <%= auction.title %>
44
+ </span>
45
+ </td>
46
+ <td><%= auction.display_starting_price %></td>
47
+ <td>
48
+ <span class="green">
49
+ <%= auction.display_current_price %>
50
+ </span>
51
+ </td>
52
+ <td>
53
+ <span class="bold">
54
+ <%= auction.visible_bids.count %>
55
+ </span>
56
+ </td>
57
+ <td><%= local_time(auction.starting_datetime) %></td>
58
+ <td><%= local_time(auction.current_end_datetime) %></td>
59
+ <td>
60
+ <% if auction.complete %>
61
+ <span class="pill pill-complete">
62
+ <%= Spree.t("complete") %>
63
+ </span>
64
+ <% elsif auction.started? %>
65
+ <%= render partial: 'spree/shared/ends_in', locals: { auction: auction } %>
66
+ <% else %>
67
+ <span class="pill pill-pending">
68
+ <%= Spree.t("waiting_to_start") %>
69
+ </span>
70
+ <% end %>
71
+ </td>
72
+ <td class="actions" data-hook="admin_auctions_index_row_actions">
73
+ <%= link_to_edit auction, no_text: true, class: 'edit' if can?(:edit, auction) && !auction.deleted? %>
74
+ &nbsp;
75
+ <% if !auction.complete %>
76
+ <%= link_to_delete auction, no_text: true if can?(:delete, auction) && !auction.deleted? %>
77
+ <% end %>
78
+ </td>
79
+ </tr>
80
+ <% end %>
81
+ </tbody>
82
+ </table>
83
+ <% else %>
84
+ <div class="no-objects-found">
85
+ <%= render 'spree/admin/shared/no_objects_found',
86
+ resource: Spree::Auction,
87
+ new_resource_url: new_object_url %>
88
+ </div>
89
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <% admin_breadcrumb link_to(plural_resource_name(Spree::Auction), spree.admin_auctions_path) %>
2
+ <% admin_breadcrumb t('spree.new_auction') %>
3
+
4
+ <%= render partial: 'spree/shared/error_messages', locals: { target: @auction } %>
5
+
6
+ <%= form_for [:admin, @auction], method: :post, url: admin_auctions_path, html: { multipart: true } do |f| %>
7
+ <fieldset data-hook="new_product">
8
+ <legend align="center"><%= t('spree.new_auction') %></legend>
9
+
10
+ <%= render partial: 'form', locals: { f: f, auction: @auction} %>
11
+
12
+ <%= render partial: 'spree/admin/shared/new_resource_links' %>
13
+ </fieldset>
14
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <%
2
+ auctions = []
3
+ @order.variants.each do |variant|
4
+ if auction = variant.auction
5
+ auctions << auction
6
+ end
7
+ end
8
+ %>
9
+ <% if !auctions.empty? %>
10
+ <dt data-hook='admin_order_tab_auctions_title'><%= Spree.t(:auctions) %>:</dt>
11
+ <dd id='auction_links'>
12
+ <% auctions.each do |auction| %>
13
+ <p>
14
+ <%= link_to auction.title, admin_auction_path(auction) %>
15
+ </p>
16
+ <% end %>
17
+ </dd>
18
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <li>
2
+ <%= link_to Spree.t(:auction), edit_admin_auction_settings_path %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <% if can? :create, Spree::Auction %>
2
+ <%= tab :auctions, icon: 'gavel' %>
3
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= f.field_container :time_zone do %>
2
+ <%= f.label :time_zone %>
3
+ <%= f.time_zone_select :time_zone, nil, {}, { class: "custom-select", default: "Pacific Time (US & Canada)" } %>
4
+ <%= f.error_message_on :time_zone %>
5
+ <% end %>
@@ -0,0 +1,81 @@
1
+ <% min_bid = @auction.current_price + @auction.bid_increment %>
2
+
3
+ <%= form_for :bid, url: bids_path do |f| %>
4
+ <div id="inside-product-cart-form" data-hook="inside_product_cart_form" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
5
+ <div data-hook="product_price" class="columns five alpha">
6
+
7
+ <div id="product-price">
8
+ <% if @auction.complete %>
9
+ <h6 class="product-section-title"><%= t('spree.winning_bid') %></h6>
10
+ <% else %>
11
+ <h6 class="product-section-title"><%= t('spree.current_price') %></h6>
12
+ <% end %>
13
+ <div>
14
+ <span class="price selling" itemprop="price" content="<%= @auction.current_price.to_d %>">
15
+ <%= @auction.display_current_price %>
16
+ </span>
17
+ </div>
18
+ <% if @auction.reserve_price > 0 %>
19
+ <div>
20
+ <% if @auction.reserve_met? %>
21
+ <span class="green">
22
+ <i class="fa fa-check-circle" aria-hidden="true"></i>
23
+ <%= t("spree.reserve_met") %>
24
+ </span>
25
+ <% else %>
26
+ <span class="red">
27
+ <i class="fa fa-exclamation-circle" aria-hidden="true"></i>
28
+ <%= t("spree.reserve_not_met") %>
29
+ </span>
30
+ <% end %>
31
+ </div>
32
+ <% end %>
33
+ <div>
34
+ <span class="bold">
35
+ <%= bid_count = @auction.visible_bids.count %>
36
+ <% if bid_count == 1 %>
37
+ <%= Spree.t("spree.bid") %>
38
+ <% else %>
39
+ <%= Spree.t("spree.bids") %>
40
+ <% end %>
41
+ </span>
42
+ </div>
43
+ <%= render partial: 'spree/shared/votes', locals: { auction: @auction } %>
44
+ <div>
45
+ <span>
46
+ <%= t("spree.min_bid") %>:
47
+ </span>
48
+ <span>
49
+ <%= number_to_currency(min_bid, :unit => "$") %>
50
+ </span>
51
+ </div>
52
+ </div>
53
+ <% if spree_current_user %>
54
+ <% highest_bidder = @auction.highest_bidder_id == spree_current_user.id %>
55
+ <% else %>
56
+ <% highest_bidder = false %>
57
+ <% end %>
58
+ <% if @auction.complete %>
59
+ <% if highest_bidder %>
60
+ <h6 class="product-section-title green">
61
+ <%= Spree.t("you_have_won_this_auction") %>
62
+ </h6>
63
+ <h6 class="product-section-title">
64
+ <%= Spree.t("view_order_or_checkout") %>:
65
+ </h6>
66
+ <%= render partial: 'spree/shared/auction_order_link', locals: { auction: @auction } %>
67
+ <% end %>
68
+ <% else %>
69
+
70
+ <%= hidden_field_tag :auction_id, @auction.id %>
71
+ <div class="add-to-cart">
72
+ <%= number_field_tag :amount, min_bid, class: 'title', min: min_bid, step: 0.01, disabled: !@auction.in_progress? %>
73
+ <%= button_tag class: 'large primary', id: 'add-to-cart-button', disabled: !@auction.in_progress?, data: { confirm: Spree.t("bid_confirmation_message") }, type: :submit do %>
74
+ <%= t('spree.bid') %>
75
+ <% end %>
76
+ </div>
77
+ <% end %>
78
+ </div>
79
+ <%= render partial: 'bids' %>
80
+ </div>
81
+ <% end %>
@@ -0,0 +1,52 @@
1
+ <% @bids = @auction.visible_bids_in_chron_order.limit(Spree::AuctionSettings::Config.number_of_bids_to_show) %>
2
+ <% if @bids.any? %>
3
+ <div id="bids" class="columns five alpha" data-hook="bids">
4
+ <table data-hook="visible-bids-table">
5
+ <thead>
6
+ <tr>
7
+ <th>
8
+ <%= Spree.t("bidder") %>
9
+ </th>
10
+ <th>
11
+ <%= Spree.t("amount") %>
12
+ </th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <% @bids.each_with_index do |bid, i| %>
17
+ <% if i == 0 %>
18
+ <tr class="odd">
19
+ <td>
20
+ <%= bid.bidder_display_name %>
21
+ </td>
22
+ <% if spree_current_user && @auction.highest_bidder_id == spree_current_user.id %>
23
+ <td>
24
+ <%= bid.display_amount %>
25
+ <span class="green">
26
+ <% highest_bid = @auction.highest_bid %>
27
+ <% if highest_bid.is_autobid? %>
28
+ (<%= highest_bid.display_amount %>)
29
+ <% end %>
30
+ </span>
31
+ </td>
32
+ <% else %>
33
+ <td>
34
+ <%= bid.display_amount %>
35
+ </td>
36
+ <% end %>
37
+ </tr>
38
+ <% else %>
39
+ <tr>
40
+ <td>
41
+ <%= bid.bidder_display_name %>
42
+ </td>
43
+ <td>
44
+ <%= bid.display_amount %>
45
+ </td>
46
+ </tr>
47
+ <% end %>
48
+ <% end %>
49
+ </tbody>
50
+ </table>
51
+ </div>
52
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <% if defined?(image) && image %>
2
+ <%= render 'spree/shared/image', image: image, size: :product, itemprop: "image" %>
3
+ <% else %>
4
+ <%= render 'spree/shared/image', image: @product.display_image, size: :product, itemprop: "image" %>
5
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <% promotions = @product.possible_promotions %>
2
+ <% if promotions.any? %>
3
+ <div id="promotions">
4
+ <h3><%= t('spree.promotions') %></h3>
5
+ <% promotions.each do |promotion| %>
6
+ <div>
7
+ <h4><%= promotion.name %></h4>
8
+ <p><%= promotion.description %></p>
9
+ <% if promotion.products.any? %>
10
+ <ul>
11
+ <% promotion.products.each do |product| %>
12
+ <li><%= link_to product.name, product_path(product) %></li>
13
+ <% end %>
14
+ </ul>
15
+ <% end %>
16
+ </div>
17
+ <% end %>
18
+ </div>
19
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <% unless @product_properties.empty? %>
2
+ <h6 class="product-section-title"><%= t('spree.properties')%></h6>
3
+ <table id="product-properties" class="table-display" data-hook>
4
+ <tbody>
5
+ <% @product_properties.each do |product_property| %>
6
+ <% css_class = cycle('even', 'odd', name: "properties") %>
7
+ <tr class="<%= css_class %>">
8
+ <td><strong><%= product_property.property.presentation %></strong></td>
9
+ <td><%= product_property.value %></td>
10
+ </tr>
11
+ <% end %>
12
+ <% reset_cycle('properties') %>
13
+ </tbody>
14
+ </table>
15
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <% if !@product.taxons.blank? %>
2
+ <div id="taxon-crumbs" data-hook class="alpha columns five omega">
3
+ <h6 class="product-section-title"><%= t('spree.look_for_similar_items') %></h6>
4
+
5
+ <div data-hook="product_taxons">
6
+ <ul id="similar_items_by_taxon" data-hook>
7
+ <% @product.taxons.each do |taxon| %>
8
+ <li><%= link_to taxon.name, seo_url(taxon) %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+
13
+ </div>
14
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <%# no need for thumbnails unless there is more than one image %>
2
+ <% if (@product.images + @product.variant_images).uniq.size > 1 %>
3
+ <ul id="product-thumbnails" class="thumbnails inline" data-hook>
4
+ <% @product.images.each do |i| %>
5
+ <li class='tmb-all tmb-<%= i.viewable.id %>'>
6
+ <%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product)) %>
7
+ </li>
8
+ <% end %>
9
+
10
+ <% if @product.has_variants? %>
11
+ <% @product.variant_images.each do |i| %>
12
+ <% next if @product.images.include?(i) %>
13
+ <li class='vtmb tmb-<%= i.viewable.id %>'>
14
+ <%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product)) %>
15
+ </li>
16
+ <% end %>
17
+ <% end %>
18
+ </ul>
19
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <div data-hook="homepage_auctions">
2
+ <%= render partial: 'spree/shared/auctions', locals: { auctions: @auctions } %>
3
+ </div>
@@ -0,0 +1,58 @@
1
+ <h1>
2
+ <%= @auction.title %>
3
+ </h1>
4
+ <div>
5
+ <%= render partial: 'spree/shared/time_in_words_display', locals: { auction: @auction } %>
6
+ </div>
7
+ <div>
8
+ <%= Spree.t("ends_at") %>
9
+ <span class="bold">
10
+ <%= local_time(@auction.current_end_datetime, "%l:%M%p on %A, %B %e") %>
11
+ </span>
12
+ </div>
13
+ <p>
14
+ <%= @auction.description %>
15
+ </p>
16
+ <div data-hook="product_show" itemscope itemtype="http://schema.org/Product">
17
+ <% @body_id = 'product-details' %>
18
+
19
+ <div class="columns six alpha" data-hook="product_left_part">
20
+ <div class="row" data-hook="product_left_part_wrap">
21
+
22
+ <div id="product-images" data-hook="product_images">
23
+ <div id="main-image" data-hook>
24
+ <%= render partial: 'image' %>
25
+ </div>
26
+ <div id="thumbnails" data-hook>
27
+ <%= render partial: 'thumbnails' %>
28
+ </div>
29
+ </div>
30
+
31
+ <div data-hook="product_properties">
32
+ <%= render partial: 'properties' %>
33
+ </div>
34
+
35
+ <div data-hook="promotions">
36
+ <%= render partial: 'promotions' %>
37
+ </div>
38
+
39
+ </div>
40
+ </div>
41
+
42
+ <div class="columns ten omega" data-hook="product_right_part">
43
+ <div class="row" data-hook="product_right_part_wrap">
44
+
45
+ <div id="product-description" data-hook="product_description">
46
+
47
+ <h1 class="product-title" itemprop="name"><%= @product.name %></h1>
48
+
49
+ <div itemprop="description" data-hook="description">
50
+ <%= product_description(@product) rescue t('spree.product_has_no_description') %>
51
+ </div>
52
+
53
+ <div id="bid-form" data-hook="bid_form">
54
+ <%= render partial: 'bid_form' %>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </div>
File without changes
File without changes
@@ -0,0 +1,65 @@
1
+ <%= form_for :order, url: populate_orders_path do |f| %>
2
+ <div id="inside-product-cart-form" data-hook="inside_product_cart_form" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
3
+
4
+ <% if @product.variants_and_option_values_for(current_pricing_options).any? %>
5
+ <div id="product-variants" class="columns five alpha">
6
+ <h6 class="product-section-title"><%= t('spree.variants') %></h6>
7
+ <ul>
8
+ <% @product.variants_and_option_values_for(current_pricing_options).each_with_index do |variant, index| %>
9
+ <li>
10
+ <%= radio_button_tag "variant_id", variant.id, index == 0, 'data-price' => variant.price_for(current_pricing_options) %>
11
+ <%= label_tag "variant_id_#{ variant.id }" do %>
12
+ <span class="variant-description">
13
+ <%= variant_options variant %>
14
+ </span>
15
+ <% if variant_price variant %>
16
+ <span class="price diff"><%= variant_price variant %></span>
17
+ <% end %>
18
+
19
+ <% unless variant.can_supply? %>
20
+ <span class="out-of-stock"><%= t('spree.out_of_stock') %></span>
21
+ <% end %>
22
+ <% end %>
23
+ </li>
24
+ <% end %>
25
+ </ul>
26
+ </div>
27
+ <% else %>
28
+ <%= hidden_field_tag "variant_id", @product.master.id %>
29
+ <% end %>
30
+
31
+ <% if @product.price_for(current_pricing_options) and !@product.price.nil? %>
32
+ <div data-hook="product_price" class="columns five <%= !@product.has_variants? ? 'alpha' : 'omega' %>">
33
+
34
+ <div id="product-price">
35
+ <h6 class="product-section-title"><%= t('spree.price') %></h6>
36
+ <div>
37
+ <span class="price selling" itemprop="price" content="<%= @product.price_for(current_pricing_options).to_d %>">
38
+ <%= display_price(@product) %>
39
+ </span>
40
+ <span itemprop="priceCurrency" content="<%= current_pricing_options.currency %>"></span>
41
+ </div>
42
+
43
+ <% if @product.master.can_supply? %>
44
+ <link itemprop="availability" href="http://schema.org/InStock" />
45
+ <% elsif @product.variants.empty? %>
46
+ <br />
47
+ <span class="out-of-stock"><%= t('spree.out_of_stock') %></span>
48
+ <% end %>
49
+ </div>
50
+
51
+ <div class="add-to-cart">
52
+ <%= number_field_tag :quantity, 1, class: 'title', min: 1 %>
53
+ <%= button_tag class: 'large primary', id: 'add-to-cart-button', type: :submit do %>
54
+ <%= t('spree.add_to_cart') %>
55
+ <% end %>
56
+ </div>
57
+ </div>
58
+ <% else %>
59
+ <div id="product-price">
60
+ <br>
61
+ <div><span class="price selling" itemprop="price"><%= t('spree.product_not_available_in_this_currency') %></span></div>
62
+ </div>
63
+ <% end %>
64
+ </div>
65
+ <% end %>