<% @auctions = spree_current_user.auctions.current_end_datetime_descending.uniq %>

<%= Spree.t(:my_auctions) %>

<% if @auctions.any? %> <% @auctions.each do |auction| %> <% highest_bidder = auction.highest_bidder_id == spree_current_user.id %> <% end %>
<%= Spree.t("title") %> <%= Spree.t("current_price") %> <%= Spree.t("winning?") %> <%= Spree.t("bids") %> <%= Spree.t("current_end_datetime") %> <%= Spree.t("time_remaining") %> <%= Spree.t("order") %>
<%= link_to auction.title, auction %> <% if highest_bidder %> <%= auction.display_current_price %> <% highest_bid = auction.highest_bid %> <% if highest_bid.is_autobid? %> (<%= highest_bid.display_amount %>) <% end %> <% else %> <%= auction.display_current_price %> <% end %> <% if highest_bidder %> <% else %> <% end %> <%= auction.visible_bids.count %> <%= local_time(auction.current_end_datetime) %> <% if auction.complete %> <%= Spree.t("complete") %> <% elsif auction.in_progress? %> <%= render partial: 'spree/shared/ends_in', locals: { auction: auction } %> <% end %> <% if auction.complete && highest_bidder %> <%= render partial: 'spree/shared/auction_order_link', locals: { auction: auction } %> <% elsif auction.complete %> <% else %> <%= Spree.t("na") %> <% end %>
<% else %>

<%= Spree.t(:you_have_not_participated_in_an_auction_yet) %> <%= Spree.t(:check_some_out_here) %>: <%= link_to Spree.t(:auctions), auctions_path %>

<% end %>