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

29 lines
1,012 B
Plaintext
Raw Normal View History

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