tap/app/views/users/show.html.erb
2015-03-19 14:59:37 +01:00

26 lines
1,010 B
Text

<%= render partial: 'flash' %>
<div class="row">
<div class="user_info">
<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 %> (<%= @user.full_name %>)</h2>
<%= button_to "PLACE ORDER!", new_user_order_path(@user), method: :get if current_user == @user %>
<div class="balance">BALANCE: <%= euro(@user.balance) %></div>
</div>
<% if @orders.any? %>
<div class="stats">
<h4>Total products</h4>
Total: <br/><ul><li><%= @categories.map{|c| pluralize(c.count, c.category)}.join(", ")%></li></ul>
<br/>
Specifics:<br/>
<%= render partial: "products/product_row", collection: @products, as: :product %>
<h4>All orders (<%= @user.orders_count %>)</h4>
<table class="orders"><%= render @orders %></table>
<%= will_paginate @orders %>
</div>
<% end %>
</div>