diff --git a/app/assets/stylesheets/profile.css.scss b/app/assets/stylesheets/profile.css.scss index 35f034c..74bb6a7 100644 --- a/app/assets/stylesheets/profile.css.scss +++ b/app/assets/stylesheets/profile.css.scss @@ -58,25 +58,19 @@ } } -.stats{ - width: 60%; - margin: auto; -} +#user_info { + h4 { + text-transform: uppercase; + font-family: monospace; + background-color: #333; + color: white; + padding: 5px 10px; + margin-top: 15px; + } -.stats h4 { - text-transform: uppercase; - font-family: monospace; - background-color: #333; - color: white; - padding: 5px 10px; - margin-top: 15px; -} - -.stats ul { - list-style-type: none; - padding: 0 0 0 15px; - margin: 0px; -} - -.stats li { + ul { + list-style-type: none; + padding: 0 0 0 15px; + margin: 0px; + } } diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 215d424..d341219 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,35 +1,50 @@ <%= render partial: 'flash' %>
-
+
+

+ <%= @user.nickname %> + <% if can? :edit, @user %> + <%= link_to content_tag(:small, content_tag(:span, "", class: "glyphicon glyphicon-cog")), edit_user_path(@user) %> + <% end %> +

+
    +
  • Orders
  • +
  • Orders placed<%= @user.orders_count %>
  • +
  • Products ordered<%= @products.map(&:count).sum %>
  • + <% if can? :create, @user.orders.build %> +
  • <%= link_to "Place new order", new_user_order_path(@user), class: "btn btn-default btn-block" %>
  • + <% end %> +
<% if can? :edit, @user %> -
- <%= link_to "[Edit dagschotel]" , user_edit_dagschotel_path(@user) %> - <%= link_to "[Edit profile]" , edit_user_path(@user) %> -
+
    +
  • + <% if @user.dagschotel %> + Huidige dagschotel + <%= image_tag @user.dagschotel.avatar %> + <%= link_to "Change dagschotel", user_edit_dagschotel_path(@user), class: "btn btn-default btn-block" %> + <% else %> + <%= link_to "Set dagschotel", user_edit_dagschotel_path(@user), class: "btn btn-default btn-block" %> + <% end %> +
  • +
<% end %> -

<%= @user.nickname %>

-
- <%= link_to "PLACE ORDER!", new_user_order_path(@user) if current_user == @user %> - DEBT: <%= euro(@user.debt) %> -
- - <% if @orders.any? %> -
-

Total products

+
+ <% if @orders.any? %> +

Previously ordered

Total:
  • - <%= @categories.map{|c| pluralize(c.count, c.category)}.to_sentence %> + <%= @categories.map{|c| pluralize(c.count, c.category)}.to_sentence %>
Specifics: <%= content_tag :ul do %> <% @products.each do |p| %> - <%= content_tag :li, pluralize(p.count, p.name) %> - <% end %> + <%= content_tag :li, pluralize(p.count, p.name) %> <% end %> + <% end %>

All orders (<%= @user.orders_count %>)

<%= render @orders %>
@@ -37,3 +52,4 @@
<% end %>
+