32 lines
1.4 KiB
Text
32 lines
1.4 KiB
Text
<div class="col-sm-3">
|
|
<div>
|
|
<h2>
|
|
<%= @user.name %>
|
|
<% if can? :edit, @user %>
|
|
<%= link_to content_tag(:small, content_tag(:span, "", class: "glyphicon glyphicon-cog")), edit_user_path(@user) %>
|
|
<% end %>
|
|
</h2>
|
|
</div>
|
|
<%= content_tag :div, image_tag(@user.avatar, class: "img-circle img-thumbnail center"), class: "user_avatar center" %>
|
|
<ul class="list-group">
|
|
<li class="list-group-item text-muted">Orders</li>
|
|
<li class="list-group-item"><strong>Orders placed</strong><span class="badge"><%= @user.orders_count %></span></li>
|
|
<li class="list-group-item"><strong>Products ordered</strong><span class="badge"><%= @user.products_group_by_id.map(&:count).sum %></span></li>
|
|
<% if can? :create, @user.orders.build %>
|
|
<li class="list-group-item"><%= link_to "Place new order", new_user_order_path(@user), class: "btn btn-default btn-block" %></li>
|
|
<% end %>
|
|
</ul>
|
|
<% if can? :edit, @user %>
|
|
<ul class="list-group">
|
|
<li class="list-group-item text-muted">
|
|
<% if @user.dagschotel %>
|
|
Huidige dagschotel
|
|
<%= image_tag @user.dagschotel.avatar %>
|
|
<%= link_to "Change dagschotel", edit_dagschotel_user_path(@user), class: "btn btn-default btn-block" %>
|
|
<% else %>
|
|
<%= link_to "Set dagschotel", edit_dagschotel_user_path(@user), class: "btn btn-default btn-block" %>
|
|
<% end %>
|
|
</li>
|
|
</ul>
|
|
<% end %>
|
|
</div>
|