2015-01-06 20:33:11 +01:00
|
|
|
<%= render partial: 'flash' %>
|
2014-11-09 22:53:39 +01:00
|
|
|
<div class="row">
|
2015-09-01 17:40:18 +02:00
|
|
|
<%= render 'sidebar' %>
|
2015-09-01 14:52:20 +02:00
|
|
|
<div id="user_info" class="col-sm-9">
|
2015-09-14 20:26:16 +02:00
|
|
|
<% if (all_orders = @user.all_orders(params[:page])).any? %>
|
2015-09-01 14:52:20 +02:00
|
|
|
<h4>Previously ordered</h4>
|
2015-08-31 14:33:15 +02:00
|
|
|
Total:
|
2015-03-19 17:38:59 +01:00
|
|
|
<ul>
|
2015-08-31 14:33:15 +02:00
|
|
|
<li>
|
2015-09-14 20:26:16 +02:00
|
|
|
<%= @user.products_group_by_category.map{|c| pluralize(c.count, c.category)}.to_sentence %>
|
2015-08-31 14:33:15 +02:00
|
|
|
</li>
|
2015-03-19 17:38:59 +01:00
|
|
|
</ul>
|
2015-03-02 16:10:54 +01:00
|
|
|
|
2015-08-31 14:33:15 +02:00
|
|
|
Specifics:
|
|
|
|
<%= content_tag :ul do %>
|
2015-09-14 20:26:16 +02:00
|
|
|
<% @user.products_group_by_id.each do |p| %>
|
2015-09-01 14:52:20 +02:00
|
|
|
<%= content_tag :li, pluralize(p.count, p.name) %>
|
2015-08-31 14:33:15 +02:00
|
|
|
<% end %>
|
2015-09-01 14:52:20 +02:00
|
|
|
<% end %>
|
2015-08-31 14:33:15 +02:00
|
|
|
|
2015-02-19 15:41:12 +01:00
|
|
|
<h4>All orders (<%= @user.orders_count %>)</h4>
|
2015-09-14 20:26:16 +02:00
|
|
|
<table class="orders"><%= render all_orders %></table>
|
|
|
|
<%= will_paginate all_orders %>
|
2015-01-09 19:15:48 +01:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2014-11-23 21:12:31 +01:00
|
|
|
</div>
|
2015-09-01 14:52:20 +02:00
|
|
|
</div>
|