2015-09-17 14:05:33 +02:00
|
|
|
.col-sm-3
|
|
|
|
%div
|
2016-02-04 23:28:13 +01:00
|
|
|
%h2.float-right
|
|
|
|
= content_tag :div, image_tag(@user.avatar, class: "img-circle img-thumbnail center"), class: "user_avatar center"
|
|
|
|
%h2.center
|
2015-09-17 14:05:33 +02:00
|
|
|
= @user.name
|
|
|
|
%ul.list-group
|
|
|
|
%li.list-group-item.text-muted Orders
|
|
|
|
%li.list-group-item
|
|
|
|
%strong Orders placed
|
|
|
|
%span.badge= @user.orders_count
|
|
|
|
%li.list-group-item
|
|
|
|
%strong Products ordered
|
|
|
|
%span.badge= @user.products_group_by_id.map(&:count).sum
|
2016-02-29 11:27:05 +01:00
|
|
|
-# - if can? :create, @user.orders.build
|
2016-03-02 18:51:04 +01:00
|
|
|
%li.list-group-item
|
|
|
|
= link_to "Place new order", new_user_order_path(@user), class: "btn btn-default btn-block"
|
|
|
|
- if @user.dagschotel
|
2016-03-02 18:56:27 +01:00
|
|
|
%p.center
|
|
|
|
%b or
|
2016-03-03 00:10:34 +01:00
|
|
|
-#%button.btn.btn-default.product{ data: { product: @user.dagschotel} }
|
2016-03-03 22:30:23 +01:00
|
|
|
= link_to quickpay_user_path(@user), id: "dagschotel_quickpay", class: "btn btn-default btn-block" do
|
2016-03-02 18:51:04 +01:00
|
|
|
%p.center Order dagschotel
|
|
|
|
= image_tag @user.dagschotel.avatar, title: "Huidige dagschotel"
|
2016-02-05 09:16:02 +01:00
|
|
|
= render 'errors', object: @user
|
2015-09-17 14:05:33 +02:00
|
|
|
- if can? :edit, @user
|
|
|
|
%ul.list-group
|
|
|
|
%li.list-group-item.text-muted
|
|
|
|
- if @user.dagschotel
|
|
|
|
\#{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"
|
2016-02-04 23:28:13 +01:00
|
|
|
%li.list-group-item.text-muted
|
|
|
|
%p Orders can be placed on koelkast for every public account. Private accounts can only order products by logging in here.
|
2016-02-09 00:12:54 +01:00
|
|
|
= f_form_for @user, remote: true do |f|
|
|
|
|
.center
|
|
|
|
= f.check_box :private, skip_label: true, data: { switch: true }
|
2016-02-04 23:28:13 +01:00
|
|
|
%li.list-group-item.text-muted
|
|
|
|
= f_form_for @user do |f|
|
2016-02-09 00:29:51 +01:00
|
|
|
= f.file_field :avatar, skip_label: true
|
2016-02-04 23:28:13 +01:00
|
|
|
= f.submit "Change avatar", class: "btn btn-default btn-block"
|