mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Moving User Account to darkswarm
This commit is contained in:
3
app/controllers/spree/users_controller_decorator.rb
Normal file
3
app/controllers/spree/users_controller_decorator.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
Spree::UsersController.class_eval do
|
||||
layout 'darkswarm'
|
||||
end
|
||||
8
app/views/spree/users/edit.html.haml
Normal file
8
app/views/spree/users/edit.html.haml
Normal file
@@ -0,0 +1,8 @@
|
||||
.darkswarm
|
||||
.row
|
||||
= render :partial => 'spree/shared/error_messages', :locals => { :target => @user }
|
||||
%h1= t(:editing_user)
|
||||
= form_for Spree::User.new, :as => @user, :url => spree.user_path(@user), :method => :put do |f|
|
||||
= render :partial => 'spree/shared/user_form', :locals => { :f => f }
|
||||
%p
|
||||
= f.submit t(:update), :class => 'button primary'
|
||||
33
app/views/spree/users/show.html.haml
Normal file
33
app/views/spree/users/show.html.haml
Normal file
@@ -0,0 +1,33 @@
|
||||
.darkswarm
|
||||
.row
|
||||
%h1= accurate_title
|
||||
.account-summary{"data-hook" => "account_summary"}
|
||||
%dl#user-info
|
||||
%dt= t(:email)
|
||||
%dd
|
||||
= @user.email
|
||||
(#{link_to t(:edit), spree.edit_account_path})
|
||||
.account-my-orders{"data-hook" => "account_my_orders"}
|
||||
%h3= t(:my_orders)
|
||||
- if @orders.present?
|
||||
%table.order-summary
|
||||
%thead
|
||||
%tr
|
||||
%th.order-number= t(:order_number)
|
||||
%th.order-date= t(:order_date)
|
||||
%th.order-status= t(:status)
|
||||
%th.order-payment-state= t(:payment_state)
|
||||
%th.order-shipment-state= t(:shipment_state)
|
||||
%th.order-total= t(:total)
|
||||
%tbody
|
||||
- @orders.each do |order|
|
||||
%tr{class: cycle('even', 'odd')}
|
||||
%td.order-number= link_to order.number, order_url(order)
|
||||
%td.order-date= l order.completed_at.to_date
|
||||
%td.order-status= t(order.state).titleize
|
||||
%td.order-payment-state= t("payment_states.#{order.payment_state}") if order.payment_state
|
||||
%td.order-shipment-state= t("shipment_states.#{order.shipment_state}") if order.shipment_state
|
||||
%td.order-total= money order.total
|
||||
- else
|
||||
%p= t(:you_have_no_orders_yet)
|
||||
%br/
|
||||
Reference in New Issue
Block a user