2015-01-06 19:33:11 +00:00
|
|
|
<%= render partial: 'flash' %>
|
2014-11-09 21:53:39 +00:00
|
|
|
<div class="row">
|
2015-01-09 18:15:48 +00:00
|
|
|
<div class="user_info">
|
2015-08-31 12:33:15 +00:00
|
|
|
<% if can? :edit, @user %>
|
2015-03-19 17:04:58 +00:00
|
|
|
<h5>
|
|
|
|
<%= link_to "[Edit dagschotel]" , user_edit_dagschotel_path(@user) %>
|
2015-03-20 01:21:56 +00:00
|
|
|
<%= link_to "[Edit profile]" , edit_user_path(@user) %>
|
2015-03-19 17:04:58 +00:00
|
|
|
</h5>
|
|
|
|
<% end %>
|
2015-03-19 16:38:59 +00:00
|
|
|
<h2><%= @user.nickname %></h2>
|
2015-08-31 12:33:15 +00:00
|
|
|
<div class="actions">
|
|
|
|
<%= link_to "PLACE ORDER!", new_user_order_path(@user) if current_user == @user %>
|
|
|
|
<span>DEBT: <%= euro(@user.debt) %></span>
|
|
|
|
</div>
|
2015-01-09 18:15:48 +00:00
|
|
|
</div>
|
2015-03-02 15:10:54 +00:00
|
|
|
|
2015-03-10 10:37:48 +00:00
|
|
|
<% if @orders.any? %>
|
2015-03-02 15:10:54 +00:00
|
|
|
<div class="stats">
|
|
|
|
<h4>Total products</h4>
|
2015-08-31 12:33:15 +00:00
|
|
|
Total:
|
2015-03-19 16:38:59 +00:00
|
|
|
<ul>
|
2015-08-31 12:33:15 +00:00
|
|
|
<li>
|
|
|
|
<%= @categories.map{|c| pluralize(c.count, c.category)}.to_sentence %>
|
|
|
|
</li>
|
2015-03-19 16:38:59 +00:00
|
|
|
</ul>
|
2015-03-02 15:10:54 +00:00
|
|
|
|
2015-08-31 12:33:15 +00:00
|
|
|
Specifics:
|
|
|
|
<%= content_tag :ul do %>
|
|
|
|
<% @products.each do |p| %>
|
|
|
|
<%= content_tag :li, pluralize(p.count, p.name) %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
2015-02-19 14:41:12 +00:00
|
|
|
<h4>All orders (<%= @user.orders_count %>)</h4>
|
2015-03-12 12:25:11 +00:00
|
|
|
<table class="orders"><%= render @orders %></table>
|
2015-02-09 12:23:38 +00:00
|
|
|
<%= will_paginate @orders %>
|
2015-01-09 18:15:48 +00:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2014-11-23 20:12:31 +00:00
|
|
|
</div>
|