spree_auth_devise 1.3.1 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree_auth_devise might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +3 -0
- data/.travis.yml +11 -0
- data/Gemfile +5 -0
- data/{LICENSE → LICENSE.md} +1 -1
- data/README.md +86 -10
- data/Rakefile +15 -0
- data/Versionfile +5 -0
- data/app/controllers/metal_decorator.rb +6 -0
- data/app/mailers/spree/user_mailer.rb +12 -5
- data/app/models/spree/auth_configuration.rb +1 -0
- data/app/models/spree/user.rb +17 -50
- data/app/overrides/spree/admin/shared/_header/auth_admin_login_navigation_bar.html.erb.deface +4 -0
- data/bin/rails +7 -0
- data/circle.yml +11 -0
- data/config.ru +4 -0
- data/config/initializers/devise.rb +3 -8
- data/config/initializers/warden.rb +14 -0
- data/config/locales/de.yml +40 -37
- data/config/locales/en.yml +48 -39
- data/config/locales/es.yml +49 -0
- data/config/locales/fr.yml +49 -0
- data/config/locales/it.yml +76 -0
- data/config/locales/nl.yml +41 -46
- data/config/locales/pt-BR.yml +51 -0
- data/config/locales/tr.yml +49 -0
- data/config/routes.rb +32 -15
- data/db/default/users.rb +13 -6
- data/db/migrate/20140904000425_add_deleted_at_to_users.rb +6 -0
- data/db/migrate/20141002154641_add_confirmable_to_users.rb +7 -0
- data/lib/assets/javascripts/spree/backend/spree_auth.js.erb +1 -0
- data/lib/assets/javascripts/spree/frontend/spree_auth.js.erb +1 -0
- data/lib/assets/stylesheets/spree/backend/spree_auth.css.erb +3 -0
- data/lib/assets/stylesheets/spree/frontend/spree_auth.css.erb +3 -0
- data/lib/controllers/backend/spree/admin/admin_controller_decorator.rb +26 -0
- data/lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb +20 -0
- data/{app/controllers → lib/controllers/backend}/spree/admin/admin_resource_controller_decorator.rb +0 -0
- data/{app/controllers/spree/admin/admin_orders_controller_decorator.rb → lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb} +3 -2
- data/lib/controllers/backend/spree/admin/user_passwords_controller.rb +42 -0
- data/lib/controllers/backend/spree/admin/user_sessions_controller.rb +53 -0
- data/{app/controllers → lib/controllers/frontend}/spree/checkout_controller_decorator.rb +8 -15
- data/lib/controllers/frontend/spree/user_confirmations_controller.rb +14 -0
- data/{app/controllers → lib/controllers/frontend}/spree/user_passwords_controller.rb +10 -9
- data/{app/controllers → lib/controllers/frontend}/spree/user_registrations_controller.rb +18 -15
- data/lib/controllers/frontend/spree/user_sessions_controller.rb +46 -0
- data/{app/controllers → lib/controllers/frontend}/spree/users_controller.rb +13 -9
- data/lib/generators/spree/auth/install/install_generator.rb +26 -0
- data/lib/generators/spree/auth/install/templates/config/initializers/devise.rb +1 -0
- data/lib/spree/auth.rb +2 -1
- data/lib/spree/auth/devise.rb +7 -0
- data/lib/spree/auth/engine.rb +57 -2
- data/lib/spree/authentication_helpers.rb +1 -1
- data/lib/spree_auth_devise.rb +3 -0
- data/lib/views/backend/spree/admin/user_passwords/edit.html.erb +15 -0
- data/lib/views/backend/spree/admin/user_passwords/new.html.erb +17 -0
- data/lib/views/backend/spree/admin/user_sessions/authorization_failure.html.erb +4 -0
- data/lib/views/backend/spree/admin/user_sessions/new.html.erb +38 -0
- data/lib/views/backend/spree/layouts/admin/_login_nav.html.erb +33 -0
- data/lib/views/backend/spree/layouts/login.html.erb +25 -0
- data/lib/views/frontend/spree/checkout/_new_user.html.erb +20 -0
- data/lib/views/frontend/spree/checkout/registration.html.erb +27 -0
- data/{app/views → lib/views/frontend}/spree/shared/_flashes.html.erb +0 -0
- data/lib/views/frontend/spree/shared/_login.html.erb +18 -0
- data/lib/views/frontend/spree/shared/_login_bar.html.erb +6 -0
- data/lib/views/frontend/spree/shared/_user_form.html.erb +13 -0
- data/lib/views/frontend/spree/user_mailer/confirmation_instructions.text.erb +5 -0
- data/lib/views/frontend/spree/user_mailer/reset_password_instructions.text.erb +10 -0
- data/lib/views/frontend/spree/user_passwords/edit.html.erb +22 -0
- data/lib/views/frontend/spree/user_passwords/new.html.erb +21 -0
- data/lib/views/frontend/spree/user_registrations/new.html.erb +22 -0
- data/lib/views/frontend/spree/user_sessions/new.html.erb +20 -0
- data/lib/views/frontend/spree/users/edit.html.erb +17 -0
- data/lib/views/frontend/spree/users/show.html.erb +43 -0
- data/spec/controllers/spree/admin/orders_controller_spec.rb +14 -0
- data/spec/controllers/spree/checkout_controller_spec.rb +141 -0
- data/spec/controllers/spree/products_controller_spec.rb +21 -0
- data/spec/controllers/spree/user_passwords_controller_spec.rb +44 -0
- data/spec/controllers/spree/user_registrations_controller_spec.rb +13 -0
- data/spec/controllers/spree/user_sessions_controller_spec.rb +56 -0
- data/spec/controllers/spree/users_controller_spec.rb +38 -0
- data/spec/factories/confirmed_user.rb +7 -0
- data/spec/features/account_spec.rb +58 -0
- data/spec/features/admin/orders_spec.rb +28 -0
- data/spec/features/admin/password_reset_spec.rb +24 -0
- data/spec/features/admin/products_spec.rb +9 -0
- data/spec/features/admin/sign_in_spec.rb +45 -0
- data/spec/features/admin/sign_out_spec.rb +22 -0
- data/spec/features/admin_permissions_spec.rb +46 -0
- data/spec/features/change_email_spec.rb +24 -0
- data/spec/features/checkout_spec.rb +160 -0
- data/spec/features/confirmation_spec.rb +28 -0
- data/spec/features/order_spec.rb +62 -0
- data/spec/features/password_reset_spec.rb +24 -0
- data/spec/features/sign_in_spec.rb +54 -0
- data/spec/features/sign_out_spec.rb +25 -0
- data/spec/features/sign_up_spec.rb +30 -0
- data/spec/mailers/user_mailer_spec.rb +46 -0
- data/spec/models/order_spec.rb +26 -0
- data/spec/models/user_spec.rb +58 -0
- data/spec/spec_helper.rb +24 -0
- data/spec/support/ability.rb +15 -0
- data/spec/support/authentication_helpers.rb +14 -0
- data/spec/support/capybara.rb +7 -0
- data/spec/support/confirm_helpers.rb +11 -0
- data/spec/support/database_cleaner.rb +18 -0
- data/spec/support/email.rb +5 -0
- data/spec/support/factory_girl.rb +5 -0
- data/spec/support/spree.rb +26 -0
- data/spree_auth_devise.gemspec +48 -0
- metadata +441 -79
- data/app/assets/javascripts/admin/spree_auth.js +0 -1
- data/app/assets/javascripts/store/spree_auth.js +0 -1
- data/app/assets/stylesheets/admin/spree_auth.css +0 -3
- data/app/assets/stylesheets/store/spree_auth.css +0 -3
- data/app/controllers/spree/admin/admin_controller_decorator.rb +0 -7
- data/app/controllers/spree/admin/admin_users_controller_decorator.rb +0 -21
- data/app/controllers/spree/admin/users_controller.rb +0 -77
- data/app/controllers/spree/base_controller_decorator.rb +0 -18
- data/app/controllers/spree/orders_controller_decorator.rb +0 -15
- data/app/controllers/spree/user_sessions_controller.rb +0 -54
- data/app/helpers/spree/users_helper.rb +0 -15
- data/app/models/spree/current_order_decorator.rb +0 -12
- data/app/overrides/admin_tab.rb +0 -6
- data/app/overrides/auth_admin_login_navigation_bar.rb +0 -5
- data/app/overrides/auth_user_login_form.rb +0 -6
- data/app/views/spree/admin/users/_form.html.erb +0 -37
- data/app/views/spree/admin/users/edit.html.erb +0 -28
- data/app/views/spree/admin/users/index.html.erb +0 -53
- data/app/views/spree/admin/users/new.html.erb +0 -23
- data/app/views/spree/admin/users/show.html.erb +0 -21
- data/app/views/spree/layouts/admin/_login_nav.html.erb +0 -8
- data/app/views/spree/shared/_login.html.erb +0 -20
- data/app/views/spree/shared/_login_bar.html.erb +0 -6
- data/app/views/spree/shared/_user_form.html.erb +0 -17
- data/app/views/spree/user_mailer/reset_password_instructions.text.erb +0 -10
- data/app/views/spree/user_passwords/edit.html.erb +0 -15
- data/app/views/spree/user_passwords/new.html.erb +0 -15
- data/app/views/spree/user_registrations/new.html.erb +0 -22
- data/app/views/spree/user_sessions/authorization_failure.html.erb +0 -4
- data/app/views/spree/user_sessions/new.html.erb +0 -13
- data/app/views/spree/users/edit.html.erb +0 -11
- data/app/views/spree/users/show.html.erb +0 -43
- data/config/initializers/spree.rb +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
//= require admin/spree_core
|
@@ -1 +0,0 @@
|
|
1
|
-
//= require store/spree_core
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require File.expand_path('../../base_controller_decorator', __FILE__)
|
2
|
-
Spree::Admin::UsersController.class_eval do
|
3
|
-
rescue_from Spree::User::DestroyWithOrdersError, :with => :user_destroy_with_orders_error
|
4
|
-
|
5
|
-
update.after :sign_in_if_change_own_password
|
6
|
-
|
7
|
-
before_filter :load_roles, :only => [:edit, :new, :update, :create]
|
8
|
-
|
9
|
-
private
|
10
|
-
|
11
|
-
def sign_in_if_change_own_password
|
12
|
-
if spree_current_user == @user && @user.password.present?
|
13
|
-
sign_in(@user, :event => :authentication, :bypass => true)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def load_roles
|
18
|
-
@roles = Spree::Role.scoped
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
@@ -1,77 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
module Admin
|
3
|
-
class UsersController < ResourceController
|
4
|
-
|
5
|
-
# http://spreecommerce.com/blog/2010/11/02/json-hijacking-vulnerability/
|
6
|
-
before_filter :check_json_authenticity, :only => :index
|
7
|
-
before_filter :load_roles, :only => [:edit, :new, :update, :create, :generate_api_key, :clear_api_key]
|
8
|
-
|
9
|
-
def index
|
10
|
-
respond_with(@collection) do |format|
|
11
|
-
format.html
|
12
|
-
format.json { render :json => json_data }
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def generate_api_key
|
17
|
-
if @user.generate_spree_api_key!
|
18
|
-
flash.notice = t('key_generated', :scope => 'spree.api')
|
19
|
-
end
|
20
|
-
redirect_to edit_admin_user_path(@user)
|
21
|
-
end
|
22
|
-
|
23
|
-
def clear_api_key
|
24
|
-
if @user.clear_spree_api_key!
|
25
|
-
flash.notice = t('key_cleared', :scope => 'spree.api')
|
26
|
-
end
|
27
|
-
redirect_to edit_admin_user_path(@user)
|
28
|
-
end
|
29
|
-
|
30
|
-
|
31
|
-
protected
|
32
|
-
|
33
|
-
def collection
|
34
|
-
return @collection if @collection.present?
|
35
|
-
unless request.xhr?
|
36
|
-
@search = Spree::User.registered.ransack(params[:q])
|
37
|
-
@collection = @search.result.page(params[:page]).per(Spree::Config[:admin_products_per_page])
|
38
|
-
else
|
39
|
-
#disabling proper nested include here due to rails 3.1 bug
|
40
|
-
#@collection = User.includes(:bill_address => [:state, :country], :ship_address => [:state, :country]).
|
41
|
-
@collection = Spree::User.includes(:bill_address, :ship_address).
|
42
|
-
where("spree_users.email #{LIKE} :search
|
43
|
-
OR (spree_addresses.firstname #{LIKE} :search AND spree_addresses.id = spree_users.bill_address_id)
|
44
|
-
OR (spree_addresses.lastname #{LIKE} :search AND spree_addresses.id = spree_users.bill_address_id)
|
45
|
-
OR (spree_addresses.firstname #{LIKE} :search AND spree_addresses.id = spree_users.ship_address_id)
|
46
|
-
OR (spree_addresses.lastname #{LIKE} :search AND spree_addresses.id = spree_users.ship_address_id)",
|
47
|
-
{ :search => "#{params[:q].strip}%" }).
|
48
|
-
limit(params[:limit] || 100)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
|
54
|
-
# handling raise from Spree::Admin::ResourceController#destroy
|
55
|
-
def user_destroy_with_orders_error
|
56
|
-
invoke_callbacks(:destroy, :fails)
|
57
|
-
render :status => :forbidden, :text => t(:error_user_destroy_with_orders)
|
58
|
-
end
|
59
|
-
|
60
|
-
# Allow different formats of json data to suit different ajax calls
|
61
|
-
def json_data
|
62
|
-
json_format = params[:json_format] or 'default'
|
63
|
-
case json_format
|
64
|
-
when 'basic'
|
65
|
-
collection.map { |u| { 'id' => u.id, 'name' => u.email } }.to_json
|
66
|
-
else
|
67
|
-
address_fields = [:firstname, :lastname, :address1, :address2, :city, :zipcode, :phone, :state_name, :state_id, :country_id]
|
68
|
-
includes = { :only => address_fields , :include => { :state => { :only => :name }, :country => { :only => :name } } }
|
69
|
-
|
70
|
-
collection.to_json(:only => [:id, :email], :include =>
|
71
|
-
{ :bill_address => includes, :ship_address => includes })
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
Spree::BaseController.class_eval do
|
2
|
-
def spree_login_path
|
3
|
-
spree.login_path
|
4
|
-
end
|
5
|
-
|
6
|
-
def spree_signup_path
|
7
|
-
spree.signup_path
|
8
|
-
end
|
9
|
-
|
10
|
-
def spree_logout_path
|
11
|
-
spree.destroy_user_session_path
|
12
|
-
end
|
13
|
-
|
14
|
-
def spree_current_user
|
15
|
-
current_user
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
@@ -1,15 +0,0 @@
|
|
1
|
-
Spree::OrdersController.class_eval do
|
2
|
-
before_filter :check_authorization
|
3
|
-
|
4
|
-
private
|
5
|
-
def check_authorization
|
6
|
-
session[:access_token] ||= params[:token]
|
7
|
-
order = Spree::Order.find_by_number(params[:id]) || current_order
|
8
|
-
|
9
|
-
if order
|
10
|
-
authorize! :edit, order, session[:access_token]
|
11
|
-
else
|
12
|
-
authorize! :create, Spree::Order.new
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
class Spree::UserSessionsController < Devise::SessionsController
|
2
|
-
include SslRequirement
|
3
|
-
helper 'spree/users', 'spree/base'
|
4
|
-
if defined?(Spree::Dash)
|
5
|
-
helper 'spree/analytics'
|
6
|
-
end
|
7
|
-
|
8
|
-
include Spree::Core::ControllerHelpers::Auth
|
9
|
-
include Spree::Core::ControllerHelpers::Common
|
10
|
-
include Spree::Core::ControllerHelpers::Order
|
11
|
-
|
12
|
-
ssl_required :new, :create, :destroy, :update
|
13
|
-
ssl_allowed :login_bar
|
14
|
-
|
15
|
-
def create
|
16
|
-
authenticate_user!
|
17
|
-
|
18
|
-
if user_signed_in?
|
19
|
-
respond_to do |format|
|
20
|
-
format.html {
|
21
|
-
flash[:success] = t(:logged_in_succesfully)
|
22
|
-
redirect_back_or_default(root_path)
|
23
|
-
}
|
24
|
-
format.js {
|
25
|
-
user = resource.record
|
26
|
-
render :json => {:ship_address => user.ship_address, :bill_address => user.bill_address}.to_json
|
27
|
-
}
|
28
|
-
end
|
29
|
-
else
|
30
|
-
flash.now[:error] = t('devise.failure.invalid')
|
31
|
-
render :new
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def destroy
|
36
|
-
cookies.clear
|
37
|
-
session.clear
|
38
|
-
super
|
39
|
-
end
|
40
|
-
|
41
|
-
def nav_bar
|
42
|
-
render :partial => 'spree/shared/nav_bar'
|
43
|
-
end
|
44
|
-
|
45
|
-
private
|
46
|
-
def accurate_title
|
47
|
-
t(:login)
|
48
|
-
end
|
49
|
-
|
50
|
-
def redirect_back_or_default(default)
|
51
|
-
redirect_to(session["user_return_to"] || default)
|
52
|
-
session["user_return_to"] = nil
|
53
|
-
end
|
54
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
module UsersHelper
|
3
|
-
def password_style(user)
|
4
|
-
ActiveSupport::Deprecation.warn '[SPREE] Password style has be depreciated due to the removal of OpenID from the Auth Gem. '
|
5
|
-
'Please install the spree_social gem to regain this functionality and more.'
|
6
|
-
''
|
7
|
-
end
|
8
|
-
|
9
|
-
def openid_style(user)
|
10
|
-
ActiveSupport::Deprecation.warn '[SPREE] Password style has be depreciated due to the removal of OpenID from the Auth Gem. '
|
11
|
-
'Please install the spree_social gem to regain this functionality and more.'
|
12
|
-
'display:none'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
Spree::Core::ControllerHelpers::Order.module_eval do
|
2
|
-
# Associate the new order with the currently authenticated user before saving
|
3
|
-
def before_save_new_order
|
4
|
-
@current_order.user ||= try_spree_current_user
|
5
|
-
end
|
6
|
-
|
7
|
-
def after_save_new_order
|
8
|
-
# make sure the user has permission to access the order (if they are a guest)
|
9
|
-
return if spree_current_user
|
10
|
-
session[:access_token] = @current_order.token
|
11
|
-
end
|
12
|
-
end
|
data/app/overrides/admin_tab.rb
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
Deface::Override.new(:virtual_path => "spree/layouts/admin",
|
2
|
-
:name => "user_admin_tabs",
|
3
|
-
:insert_bottom => "[data-hook='admin_tabs'], #admin_tabs[data-hook]",
|
4
|
-
:text => "<%= tab(:users, :url => spree.admin_users_path, :icon => 'icon-user') %>",
|
5
|
-
:disabled => false)
|
6
|
-
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Deface::Override.new(:virtual_path => "spree/layouts/admin",
|
2
|
-
:name => "auth_admin_login_navigation_bar",
|
3
|
-
:insert_top => "[data-hook='admin_login_navigation_bar'], #admin_login_navigation_bar[data-hook]",
|
4
|
-
:partial => "spree/layouts/admin/login_nav",
|
5
|
-
:original => '0a5476d4d5db90ec8dd200ebaa0109a6a54ec6bc' )
|
@@ -1,6 +0,0 @@
|
|
1
|
-
Deface::Override.new(:virtual_path => "spree/checkout/registration",
|
2
|
-
:name => "auth_user_login_form",
|
3
|
-
:replace_contents => "[data-hook='registration'] #account, #registration[data-hook] #account",
|
4
|
-
:template => "spree/user_sessions/new",
|
5
|
-
:disabled => false,
|
6
|
-
:original => 'ab20ac9e90baa11b847b30040aef863d2e1af17a')
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<div data-hook="admin_user_form_fields" class="row">
|
2
|
-
<div class="alpha five columns">
|
3
|
-
<%= f.field_container :email do %>
|
4
|
-
<%= f.label :email, t(:email) %>
|
5
|
-
<%= f.email_field :email, :class => 'fullwidth' %>
|
6
|
-
<%= error_message_on :user, :email %>
|
7
|
-
<% end %>
|
8
|
-
|
9
|
-
<div data-hook="admin_user_form_roles" class="field">
|
10
|
-
<%= label_tag nil, t(:roles) %>
|
11
|
-
<ul>
|
12
|
-
<% @roles.each do |role| %>
|
13
|
-
<li>
|
14
|
-
<%= check_box_tag 'user[spree_role_ids][]', role.id, @user.spree_roles.include?(role), :id => "user_spree_role_#{role.name}" %>
|
15
|
-
<%= label_tag role.name %>
|
16
|
-
</li>
|
17
|
-
<% end %>
|
18
|
-
</ul>
|
19
|
-
<%= hidden_field_tag 'user[spree_role_ids][]', '' %>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
</div>
|
23
|
-
|
24
|
-
<div class="omega five columns">
|
25
|
-
<%= f.field_container :password do %>
|
26
|
-
<%= f.label :password, t(:password) %>
|
27
|
-
<%= f.password_field :password, :class => 'fullwidth' %>
|
28
|
-
<%= f.error_message_on :password %>
|
29
|
-
<% end %>
|
30
|
-
|
31
|
-
<%= f.field_container :password do %>
|
32
|
-
<%= f.label :password_confirmation, t(:confirm_password) %>
|
33
|
-
<%= f.password_field :password_confirmation, :class => 'fullwidth' %>
|
34
|
-
<%= f.error_message_on :password_confirmation %>
|
35
|
-
<% end %>
|
36
|
-
</div>
|
37
|
-
</div>
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<% content_for :page_title do %>
|
2
|
-
<%= t(:editing_user) %>
|
3
|
-
<% end %>
|
4
|
-
|
5
|
-
<% content_for :page_actions do %>
|
6
|
-
<li>
|
7
|
-
<%= button_link_to t(:back_to_users_list), spree.admin_users_path, :icon => 'icon-arrow-left' %>
|
8
|
-
</li>
|
9
|
-
<% end %>
|
10
|
-
|
11
|
-
<fieldset data-hook="admin_user_edit_general_settings" class="alpha ten columns">
|
12
|
-
<legend><%= t(:general_settings) %></legend>
|
13
|
-
|
14
|
-
<div data-hook="admin_user_edit_form_header">
|
15
|
-
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div data-hook="admin_user_edit_form">
|
19
|
-
<%= form_for [:admin, @user] do |f| %>
|
20
|
-
<%= render :partial => 'form', :locals => { :f => f } %>
|
21
|
-
|
22
|
-
<div data-hook="admin_user_edit_form_button">
|
23
|
-
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
|
24
|
-
</div>
|
25
|
-
<% end %>
|
26
|
-
</div>
|
27
|
-
|
28
|
-
</fieldset>
|
@@ -1,53 +0,0 @@
|
|
1
|
-
<% content_for :page_title do %>
|
2
|
-
<%= t(:listing_users) %>
|
3
|
-
<% end %>
|
4
|
-
|
5
|
-
<% content_for :page_actions do %>
|
6
|
-
<li>
|
7
|
-
<%= button_link_to t(:new_user), new_object_url, :icon => 'icon-plus', :id => 'admin_new_user_link' %>
|
8
|
-
</li>
|
9
|
-
<% end %>
|
10
|
-
|
11
|
-
<table class="index" id="listing_users" data-hook>
|
12
|
-
<colgroup>
|
13
|
-
<col style="width: 85%">
|
14
|
-
<col style="width: 15%">
|
15
|
-
</colgroup>
|
16
|
-
<thead>
|
17
|
-
<tr data-hook="admin_users_index_headers">
|
18
|
-
<th><%= sort_link @search,:email, t(:user), {}, {:title => 'users_email_title'} %></th>
|
19
|
-
<th data-hook="admin_users_index_header_actions" class="actions"></th>
|
20
|
-
</tr>
|
21
|
-
</thead>
|
22
|
-
<tbody>
|
23
|
-
<% @users.each do |user|%>
|
24
|
-
<tr id="<%= spree_dom_id user %>" data-hook="admin_users_index_rows" class="<%= cycle('odd', 'even')%>">
|
25
|
-
<td class='user_email'><%=link_to user.email, object_url(user) %></td>
|
26
|
-
<td data-hook="admin_users_index_row_actions" class="actions">
|
27
|
-
<%= link_to_edit user, :no_text => true %>
|
28
|
-
<%= link_to_delete user, :no_text => true %>
|
29
|
-
</td>
|
30
|
-
</tr>
|
31
|
-
<% end %>
|
32
|
-
</tbody>
|
33
|
-
</table>
|
34
|
-
|
35
|
-
<%= paginate @users %>
|
36
|
-
|
37
|
-
<% content_for :sidebar_title do %>
|
38
|
-
<%= t(:search) %>
|
39
|
-
<% end %>
|
40
|
-
|
41
|
-
<% content_for :sidebar do %>
|
42
|
-
<div class="box align-center" data-hook="admin_users_index_search">
|
43
|
-
<%= search_form_for [:admin, @search] do |f| %>
|
44
|
-
<div class="field">
|
45
|
-
<%= f.label t(:email) %> <br>
|
46
|
-
<%= f.text_field :email_cont, :class => 'fullwidth' %>
|
47
|
-
</div>
|
48
|
-
<div data-hook="admin_users_index_search_buttons">
|
49
|
-
<%= button t(:search), 'icon-search' %>
|
50
|
-
</div>
|
51
|
-
<% end %>
|
52
|
-
</div>
|
53
|
-
<% end %>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<% content_for :page_title do %>
|
2
|
-
<%= t(:new_user) %>
|
3
|
-
<% end %>
|
4
|
-
|
5
|
-
<% content_for :page_actions do %>
|
6
|
-
<li>
|
7
|
-
<%= button_link_to t(:back_to_users_list), spree.admin_users_path, :icon => 'icon-arrow-left' %>
|
8
|
-
</li>
|
9
|
-
<% end %>
|
10
|
-
|
11
|
-
<div data-hook="admin_user_new_form_header">
|
12
|
-
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
<div data-hook="admin_user_new_form">
|
16
|
-
<%= form_for [:admin, @user] do |f| %>
|
17
|
-
<%= render :partial => 'form', :locals => { :f => f } %>
|
18
|
-
|
19
|
-
<div data-hook="admin_user_new_form_buttons">
|
20
|
-
<%= render :partial => 'spree/admin/shared/new_resource_links' %>
|
21
|
-
</div>
|
22
|
-
<% end %>
|
23
|
-
</div>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<h1><%= t(:user_account) %></h1>
|
2
|
-
|
3
|
-
<table>
|
4
|
-
<tr data-hook="email">
|
5
|
-
<th><%= t(:email) %></th>
|
6
|
-
<td>
|
7
|
-
<%= @user.email %>
|
8
|
-
</td>
|
9
|
-
</tr>
|
10
|
-
<tr data-hook="roles">
|
11
|
-
<th><%= t(:roles) %></th>
|
12
|
-
<td>
|
13
|
-
<%= @user.spree_roles.pluck(:name).join(', ') %>
|
14
|
-
</td>
|
15
|
-
</tr>
|
16
|
-
</table>
|
17
|
-
|
18
|
-
<p>
|
19
|
-
<%= link_to_edit @user, :class => 'edit_user' %> <%= t(:or) %>
|
20
|
-
<%= link_to t(:back), collection_url %>
|
21
|
-
</p>
|