54 lines
1.6 KiB
Plaintext
54 lines
1.6 KiB
Plaintext
|
<%= render partial: 'flash' %>
|
||
|
<div class="row">
|
||
|
<div class="col-sm-3">
|
||
|
<h2>
|
||
|
<%= @user.nickname %>
|
||
|
<%= link_to content_tag(:small, content_tag(:span, "", class: "glyphicon glyphicon-cog")), edit_user_path(@user) %>
|
||
|
</h2>
|
||
|
<ul class="list-group">
|
||
|
<li class="list-group-item text-muted">Orders</li>
|
||
|
<li class="list-group-item"><strong>Amount</strong><span class="badge"><%= @user.orders_count %></span></li>
|
||
|
</ul>
|
||
|
<ul class="list-group">
|
||
|
<li class="list-group-item text-muted">
|
||
|
Huidige dagschotel
|
||
|
<%= image_tag @user.dagschotel.avatar %>
|
||
|
<%= link_to "Change dagschotel", user_edit_dagschotel_path(@user), class: "btn btn-default btn-block" %>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="col-sm-9">
|
||
|
<% if can? :edit, @user %>
|
||
|
<h5>
|
||
|
</h5>
|
||
|
<% end %>
|
||
|
<div class="actions">
|
||
|
<%= link_to "PLACE ORDER!", new_user_order_path(@user) if current_user == @user %>
|
||
|
<span>DEBT: <%= euro(@user.debt) %></span>
|
||
|
</div>
|
||
|
|
||
|
<% if @orders.any? %>
|
||
|
<div class="stats">
|
||
|
<h4>Total products</h4>
|
||
|
Total:
|
||
|
<ul>
|
||
|
<li>
|
||
|
<%= @categories.map{|c| pluralize(c.count, c.category)}.to_sentence %>
|
||
|
</li>
|
||
|
</ul>
|
||
|
|
||
|
Specifics:
|
||
|
<%= content_tag :ul do %>
|
||
|
<% @products.each do |p| %>
|
||
|
<%= content_tag :li, pluralize(p.count, p.name) %>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
|
||
|
<h4>All orders (<%= @user.orders_count %>)</h4>
|
||
|
<table class="orders"><%= render @orders %></table>
|
||
|
<%= will_paginate @orders %>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
</div>
|