tap/app/views/users/show.html.erb

28 lines
761 B
Plaintext
Raw Normal View History

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