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