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

26 lines
756 B
Text

<%= render partial: 'flash' %>
<div class="row">
<div class="user_info">
<h2>
<%= @user.full_name %> - <%= @user.nickname %>
<%= link_to "edit" , edit_user_registration_path %>
</h2>
<h4>Balance: <%= euro(@user.balance) %></h4>
</div>
<% if @user.orders.any? %>
<div class="col-md-6">
<h3>Orders (<%= @user.orders_count %>)</h3>
<% @orders.each do |k,v| %>
<%= render 'orders/order', order: v.first, products: v %>
<% end %>
</div>
<% end %>
<div class="col-md-6">
<h3>Products</h3>
<%= render partial: "products/product_row", collection: @products, as: :product %>
<h4>Categories</h4>
<%= render partial: "products/category", collection: @categories %>
</div>
</div>