From 70142015107b471df3d314699099fcd5d11bc7f5 Mon Sep 17 00:00:00 2001 From: benji Date: Tue, 1 Sep 2015 14:52:20 +0200 Subject: [PATCH 1/3] Change some styling --- ;w | 53 +++++++++++++++++++++++++ app/assets/stylesheets/profile.css.scss | 34 +++++++--------- app/views/users/show.html.erb | 50 +++++++++++++++-------- 3 files changed, 100 insertions(+), 37 deletions(-) create mode 100644 ;w diff --git a/;w b/;w new file mode 100644 index 0000000..a34b525 --- /dev/null +++ b/;w @@ -0,0 +1,53 @@ +<%= render partial: 'flash' %> +
+
+

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

+
    +
  • Orders
  • +
  • Amount<%= @user.orders_count %>
  • +
+
    +
  • + Huidige dagschotel + <%= image_tag @user.dagschotel.avatar %> + <%= link_to "Change dagschotel", user_edit_dagschotel_path(@user), class: "btn btn-default btn-block" %> +
  • +
+
+
+ <% if can? :edit, @user %> +
+
+ <% end %> +
+ <%= link_to "PLACE ORDER!", new_user_order_path(@user) if current_user == @user %> + DEBT: <%= euro(@user.debt) %> +
+ + <% if @orders.any? %> +
+

Total products

+ Total: +
    +
  • + <%= @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 %> + <% end %> + +

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

+ <%= render @orders %>
+ <%= will_paginate @orders %> +
+ <% end %> +
+
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..f69de00 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,35 +1,50 @@ <%= render partial: 'flash' %>
- From 5eb3a65205cc99514e6772bdf1ca294e10a64b7c Mon Sep 17 00:00:00 2001 From: benji Date: Tue, 1 Sep 2015 14:54:59 +0200 Subject: [PATCH 2/3] Oops --- ;w | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 ;w diff --git a/;w b/;w deleted file mode 100644 index a34b525..0000000 --- a/;w +++ /dev/null @@ -1,53 +0,0 @@ -<%= render partial: 'flash' %> -
-
-

- <%= @user.nickname %> - <%= link_to content_tag(:small, content_tag(:span, "", class: "glyphicon glyphicon-cog")), edit_user_path(@user) %> -

-
    -
  • Orders
  • -
  • Amount<%= @user.orders_count %>
  • -
-
    -
  • - Huidige dagschotel - <%= image_tag @user.dagschotel.avatar %> - <%= link_to "Change dagschotel", user_edit_dagschotel_path(@user), class: "btn btn-default btn-block" %> -
  • -
-
-
- <% if can? :edit, @user %> -
-
- <% end %> -
- <%= link_to "PLACE ORDER!", new_user_order_path(@user) if current_user == @user %> - DEBT: <%= euro(@user.debt) %> -
- - <% if @orders.any? %> -
-

Total products

- Total: -
    -
  • - <%= @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 %> - <% end %> - -

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

- <%= render @orders %>
- <%= will_paginate @orders %> -
- <% end %> -
-
From 10d52c806dc20f1519c8729a911c2ca7e6088c80 Mon Sep 17 00:00:00 2001 From: benji Date: Tue, 1 Sep 2015 16:21:43 +0200 Subject: [PATCH 3/3] Use actual value for products count instead of fix number --- app/views/users/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index f69de00..d341219 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -10,7 +10,7 @@
  • Orders
  • Orders placed<%= @user.orders_count %>
  • -
  • Products ordered<%= 17 %>
  • +
  • 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 %>