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

40 lines
1.1 KiB
Text
Raw Normal View History

<%= render partial: 'flash' %>
2014-11-09 22:53:39 +01:00
<div class="row">
<div class="user_info">
<% if can? :edit, @user %>
2015-03-19 18:04:58 +01:00
<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 %>
<h2><%= @user.nickname %></h2>
<div class="actions">
<%= link_to "PLACE ORDER!", new_user_order_path(@user) if current_user == @user %>
<span>DEBT: <%= euro(@user.debt) %></span>
</div>
</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>
Total:
<ul>
<li>
<%= @categories.map{|c| pluralize(c.count, c.category)}.to_sentence %>
</li>
</ul>
2015-03-02 16:10:54 +01:00
Specifics:
<%= content_tag :ul do %>
<% @products.each do |p| %>
<%= content_tag :li, pluralize(p.count, p.name) %>
<% end %>
<% end %>
2015-02-19 15:41:12 +01:00
<h4>All orders (<%= @user.orders_count %>)</h4>
<table class="orders"><%= render @orders %></table>
<%= will_paginate @orders %>
</div>
<% end %>
2014-11-23 21:12:31 +01:00
</div>