cybele 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +16 -2
- data/dump.rdb +1 -0
- data/lib/cybele/app_builder.rb +213 -220
- data/lib/cybele/generators/app_generator.rb +31 -20
- data/lib/cybele/version.rb +2 -2
- data/templates/.env.local.erb +11 -0
- data/templates/.env.production.erb +11 -0
- data/templates/.env.staging.erb +11 -0
- data/templates/README.md.erb +22 -0
- data/templates/app/assets/javascripts/application.js.coffee +63 -1
- data/templates/app/assets/javascripts/hq/application.js.coffee +93 -0
- data/templates/app/assets/stylesheets/application.css.sass +15 -4
- data/templates/app/assets/stylesheets/hq/application.css.sass +92 -0
- data/templates/app/controllers/application_controller.rb.erb +48 -0
- data/templates/app/controllers/concerns/basic_authentication.rb +18 -0
- data/templates/app/controllers/hq/admins_controller.rb +64 -0
- data/templates/app/controllers/hq/application_controller.rb +11 -0
- data/templates/app/controllers/hq/audits_controller.rb +16 -0
- data/templates/app/controllers/hq/cities_controller.rb +54 -0
- data/templates/app/controllers/hq/countries_controller.rb +54 -0
- data/templates/app/controllers/hq/dashboard_controller.rb +4 -1
- data/templates/app/controllers/hq/passwords_controller.rb +10 -0
- data/templates/app/controllers/hq/registrations_controller.rb +21 -0
- data/templates/app/controllers/hq/sessions_controller.rb +1 -1
- data/templates/app/controllers/hq/users_controller.rb +64 -0
- data/templates/app/controllers/user/dashboard_controller.rb +8 -0
- data/templates/app/controllers/user/passwords_controller.rb +10 -0
- data/templates/app/controllers/user/profiles_controller.rb +34 -0
- data/templates/app/controllers/user/registrations_controller.rb +20 -0
- data/templates/app/controllers/user/sessions_controller.rb +16 -0
- data/templates/app/controllers/user/user_application_controller.rb +20 -0
- data/templates/app/helpers/application_helper.rb.erb +27 -0
- data/templates/app/mailers/admin_mailer.rb +10 -0
- data/templates/app/mailers/base_mailer.rb +4 -0
- data/templates/app/mailers/user_mailer.rb +10 -0
- data/templates/app/models/admin.rb +51 -0
- data/templates/app/models/audit.rb +3 -0
- data/templates/app/models/city.rb +12 -0
- data/templates/app/models/country.rb +12 -0
- data/templates/app/models/user.rb +54 -0
- data/templates/app/views/admin_mailer/login_info.html.haml +13 -0
- data/templates/app/views/devise/confirmations/new.html.haml +6 -5
- data/templates/app/views/devise/mailer/confirmation_instructions.html.haml +5 -3
- data/templates/app/views/devise/mailer/reset_password_instructions.html.haml +2 -2
- data/templates/app/views/devise/passwords/edit.html.haml +3 -3
- data/templates/app/views/devise/passwords/new.html.haml +3 -3
- data/templates/app/views/devise/registrations/edit.html.haml +5 -11
- data/templates/app/views/devise/registrations/new.html.haml +18 -6
- data/templates/app/views/devise/sessions/new.html.haml +1 -1
- data/templates/app/views/devise/shared/_links.haml +3 -1
- data/templates/app/views/devise/unlocks/new.html.haml +4 -4
- data/templates/app/views/hq/admins/_admin.html.haml +21 -0
- data/templates/app/views/hq/admins/_blank.html.haml +9 -0
- data/templates/app/views/hq/admins/_filters.html.haml +20 -0
- data/templates/app/views/hq/admins/_form.html.haml +17 -0
- data/templates/app/views/hq/admins/_list.html.haml +15 -0
- data/templates/app/views/hq/admins/edit.html.haml +3 -0
- data/templates/app/views/hq/admins/index.html.haml +18 -0
- data/templates/app/views/hq/admins/new.html.haml +5 -0
- data/templates/app/views/hq/admins/show.html.haml +19 -0
- data/templates/app/views/hq/audits/_filters.html.haml +32 -0
- data/templates/app/views/hq/audits/_list.html.haml +37 -0
- data/templates/app/views/hq/audits/index.html.haml +5 -0
- data/templates/app/views/hq/audits/show.html.haml +5 -0
- data/templates/app/views/hq/cities/_blank.html.haml +9 -0
- data/templates/app/views/hq/cities/_city.html.haml +12 -0
- data/templates/app/views/hq/cities/_filters.html.haml +15 -0
- data/templates/app/views/hq/cities/_form.html.haml +15 -0
- data/templates/app/views/hq/cities/_list.html.haml +13 -0
- data/templates/app/views/hq/cities/edit.html.haml +3 -0
- data/templates/app/views/hq/cities/index.html.haml +18 -0
- data/templates/app/views/hq/cities/new.html.haml +3 -0
- data/templates/app/views/hq/cities/show.html.haml +13 -0
- data/templates/app/views/hq/countries/_blank.html.haml +9 -0
- data/templates/app/views/hq/countries/_country.html.haml +11 -0
- data/templates/app/views/hq/countries/_filters.html.haml +14 -0
- data/templates/app/views/hq/countries/_form.html.haml +14 -0
- data/templates/app/views/hq/countries/_list.html.haml +12 -0
- data/templates/app/views/hq/countries/edit.html.haml +3 -0
- data/templates/app/views/hq/countries/index.html.haml +18 -0
- data/templates/app/views/hq/countries/new.html.haml +3 -0
- data/templates/app/views/hq/countries/show.html.haml +14 -0
- data/templates/app/views/hq/dashboard/index.html.haml +8 -0
- data/templates/app/views/hq/passwords/edit.html.haml +12 -0
- data/templates/app/views/hq/passwords/new.html.haml +9 -0
- data/templates/app/views/hq/registrations/edit.html.haml +19 -0
- data/templates/app/views/hq/sessions/new.html.haml +7 -5
- data/templates/app/views/hq/users/_blank.html.haml +9 -0
- data/templates/app/views/hq/users/_filters.html.haml +20 -0
- data/templates/app/views/hq/users/_form.html.haml +18 -0
- data/templates/app/views/hq/users/_list.html.haml +15 -0
- data/templates/app/views/hq/users/_user.html.haml +20 -0
- data/templates/app/views/hq/users/edit.html.haml +3 -0
- data/templates/app/views/hq/users/index.html.haml +18 -0
- data/templates/app/views/hq/users/new.html.haml +5 -0
- data/templates/app/views/hq/users/show.html.haml +20 -0
- data/templates/app/views/layouts/application.html.haml.erb +16 -8
- data/templates/app/views/layouts/hq/application.html.haml.erb +55 -0
- data/templates/app/views/layouts/hq/login.html.haml.erb +35 -0
- data/templates/app/views/layouts/hq/partials/_dock.html.haml.erb +36 -0
- data/templates/app/views/layouts/hq/partials/_footer.html.haml.erb +0 -0
- data/templates/app/views/layouts/hq/partials/_navbar.html.haml.erb +22 -0
- data/templates/app/views/layouts/hq/partials/_trackers.html.haml.erb +0 -0
- data/templates/app/views/layouts/mailer.html.haml.erb +321 -0
- data/templates/app/views/layouts/mailer.text.haml +1 -0
- data/templates/app/views/layouts/partials/_footer.html.haml.erb +0 -0
- data/templates/app/views/layouts/partials/_trackers.html.haml.erb +0 -0
- data/templates/app/views/layouts/partials/_warnings.html.haml.erb +3 -0
- data/templates/app/views/user/dashboard/index.html.haml +8 -0
- data/templates/app/views/user/passwords/edit.html.haml +12 -0
- data/templates/app/views/user/passwords/new.html.haml +10 -0
- data/templates/app/views/{user_profiles → user/profiles}/_form.html.haml +4 -5
- data/templates/app/views/user/profiles/edit.html.haml +3 -0
- data/templates/app/views/user/profiles/show.html.haml +15 -0
- data/templates/app/views/user/registrations/edit.html.haml +19 -0
- data/templates/app/views/user/sessions/new.html.haml +11 -0
- data/templates/app/views/user_mailer/login_info.html.haml +13 -0
- data/templates/app/views/welcome/index.html.haml.erb +4 -4
- data/templates/config/initializers/devise_async.rb +6 -0
- data/templates/config/initializers/sidekiq.rb +13 -0
- data/templates/config/locales/email.tr.yml +28 -0
- data/templates/config/locales/models.tr.yml +72 -41
- data/templates/config/locales/responders.tr.yml +4 -1
- data/templates/config/locales/show_for.tr.yml +1 -3
- data/templates/config/locales/simple_form.tr.yml +8 -22
- data/templates/config/locales/tr.yml +33 -2
- data/templates/config/locales/view.tr.yml +64 -18
- data/templates/config/routes.erb +51 -0
- data/templates/config/schedule.yml +16 -0
- data/templates/config/settings/production.yml +0 -17
- data/templates/config/settings/staging.yml +0 -17
- data/templates/config/sidekiq.yml +13 -0
- data/templates/cybele_Gemfile +42 -5
- data/templates/cybele_gitignore +3 -1
- data/templates/cybele_version.txt +1 -0
- data/templates/env.sample.erb +11 -0
- data/templates/lib/data/cities.yml +163 -0
- data/templates/lib/tasks/dev.rake +29 -5
- data/templates/lib/tasks/sidekiq.rake +26 -0
- data/templates/lib/templates/rails/responders_controller/controller.rb +27 -22
- data/templates/public/images/favicon.png +0 -0
- data/templates/public/images/mail-logo.png +0 -0
- data/templates/public/images/missing_cover.png +0 -0
- data/templates/public/images/missing_cover@2x.png +0 -0
- data/templates/public/images/missing_logo.png +0 -0
- data/templates/public/images/missing_logo@2x.png +0 -0
- data/templates/public/images/sprite.png +0 -0
- data/templates/ruby-version +1 -1
- data/templates/vendor/assets/javascripts/jquery.datetimepicker.js +1871 -0
- data/templates/vendor/assets/javascripts/jquery.maskedinput.min.js +7 -0
- data/templates/vendor/assets/javascripts/nprogress.js +491 -0
- data/templates/vendor/assets/javascripts/trix.js +25 -0
- data/templates/vendor/assets/stylesheets/jquery.datetimepicker.css +418 -0
- data/templates/vendor/assets/stylesheets/nprogress.css +74 -0
- data/templates/vendor/assets/stylesheets/trix.css +209 -0
- metadata +125 -24
- data/templates/app/controllers/application_controller.rb +0 -19
- data/templates/app/controllers/hq/admin_profiles_controller.rb +0 -56
- data/templates/app/controllers/user_profiles_controller.rb +0 -56
- data/templates/app/views/hq/admin_profiles/_form.html.haml +0 -15
- data/templates/app/views/hq/admin_profiles/edit.html.haml +0 -3
- data/templates/app/views/hq/admin_profiles/new.html.haml +0 -3
- data/templates/app/views/hq/admin_profiles/show.html.haml +0 -13
- data/templates/app/views/hq/dashboard/index.html.haml.erb +0 -3
- data/templates/app/views/user_profiles/edit.html.haml +0 -3
- data/templates/app/views/user_profiles/new.html.haml +0 -3
- data/templates/app/views/user_profiles/show.html.haml +0 -13
- data/templates/config/locales/en.yml +0 -2
- data/templates/config/locales/models.en.yml +0 -54
- data/templates/config/locales/responders.en.yml +0 -10
- data/templates/config/locales/show_for.en.yml +0 -7
- data/templates/config/locales/simple_form.en.yml +0 -30
- data/templates/config/locales/view.en.yml +0 -51
@@ -0,0 +1,20 @@
|
|
1
|
+
class User::RegistrationsController < Devise::RegistrationsController
|
2
|
+
# layout 'user/application'
|
3
|
+
before_action :authenticate_user!, except: [:new, :create]
|
4
|
+
before_action :redirect_user, only: [:destroy]
|
5
|
+
add_breadcrumb I18n.t('activerecord.models.user'), :user_root_path
|
6
|
+
|
7
|
+
def edit
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def redirect_user
|
13
|
+
redirect_to user_root_path
|
14
|
+
end
|
15
|
+
|
16
|
+
def after_update_path_for(resource)
|
17
|
+
user_root_path
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class User::SessionsController < Devise::SessionsController
|
2
|
+
# layout 'user/login'
|
3
|
+
|
4
|
+
private
|
5
|
+
|
6
|
+
# Overwriting the sign_out redirect path method
|
7
|
+
def after_sign_in_path_for(resource_or_scope)
|
8
|
+
user_root_path
|
9
|
+
end
|
10
|
+
|
11
|
+
# Overwriting the sign_out redirect path method
|
12
|
+
def after_sign_out_path_for(resource_or_scope)
|
13
|
+
new_user_session_path
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'application_responder'
|
2
|
+
|
3
|
+
class User::UserApplicationController < ActionController::Base
|
4
|
+
|
5
|
+
# layout 'user/application'
|
6
|
+
layout 'application'
|
7
|
+
before_filter :set_audit_user
|
8
|
+
before_action :authenticate_user!
|
9
|
+
|
10
|
+
self.responder = ApplicationResponder
|
11
|
+
respond_to :html, :json
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def set_audit_user
|
16
|
+
# Set audit current user
|
17
|
+
Audited.current_user_method = :current_user
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module ApplicationHelper
|
2
|
+
|
3
|
+
def get_countries
|
4
|
+
Country.all.map{|c| ["#{c.name}", c.id] }
|
5
|
+
end
|
6
|
+
|
7
|
+
def get_cities
|
8
|
+
City.all.map{|c| ["#{c.name}", c.id] }
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_active_users
|
12
|
+
User.active.map{|c| ["#{c.email} - #{c.full_name}", c.id] }
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_users
|
16
|
+
User.all.map{|c| ["#{c.email} - #{c.full_name}", c.id] }
|
17
|
+
end
|
18
|
+
|
19
|
+
def get_admins
|
20
|
+
Admin.all.map{|c| ["#{c.email} - #{c.full_name}", c.id] }
|
21
|
+
end
|
22
|
+
|
23
|
+
def get_audit_users
|
24
|
+
[[t('activerecord.models.admin'), 'Admin'], [t('activerecord.models.user'), 'User']]
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
class Admin < ActiveRecord::Base
|
2
|
+
# Virtual attributes
|
3
|
+
attr_accessor :is_generated_password
|
4
|
+
|
5
|
+
# Include default devise modules. Others available are:
|
6
|
+
# :confirmable, :lockable, :timeoutable and :omniauthable
|
7
|
+
devise :database_authenticatable,
|
8
|
+
:async,
|
9
|
+
:recoverable,
|
10
|
+
:rememberable,
|
11
|
+
:trackable,
|
12
|
+
:validatable
|
13
|
+
|
14
|
+
# Helpers
|
15
|
+
audited except: [:password]
|
16
|
+
|
17
|
+
# Validations
|
18
|
+
validates_presence_of :name, :email, :surname
|
19
|
+
validates :email, uniqueness: true
|
20
|
+
|
21
|
+
# Callbacks
|
22
|
+
after_commit :send_login_info, on: :create
|
23
|
+
before_validation :create_password, on: :create
|
24
|
+
after_initialize do |obj|
|
25
|
+
obj.is_generated_password = false
|
26
|
+
end
|
27
|
+
|
28
|
+
def active_for_authentication?
|
29
|
+
super && self.is_active
|
30
|
+
end
|
31
|
+
|
32
|
+
def full_name
|
33
|
+
"#{self.name} #{self.surname}"
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def create_password
|
39
|
+
if self.password.nil?
|
40
|
+
password = Devise.friendly_token.first(8)
|
41
|
+
self.password = password
|
42
|
+
self.password_confirmation = password
|
43
|
+
self.is_generated_password = true
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def send_login_info
|
48
|
+
AdminMailer.login_info(self.id, self.password).deliver_later! if self.is_generated_password
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
class User < ActiveRecord::Base
|
2
|
+
# Virtual attributes
|
3
|
+
attr_accessor :is_generated_password
|
4
|
+
|
5
|
+
# Scopes
|
6
|
+
scope :active, -> { where(is_active: true) }
|
7
|
+
|
8
|
+
# Include default devise modules. Others available are:
|
9
|
+
# :confirmable, :lockable, :timeoutable and :omniauthable
|
10
|
+
devise :database_authenticatable,
|
11
|
+
:registerable,
|
12
|
+
:async,
|
13
|
+
:recoverable,
|
14
|
+
:rememberable,
|
15
|
+
:trackable,
|
16
|
+
:validatable
|
17
|
+
|
18
|
+
# Helpers
|
19
|
+
audited except: [:password]
|
20
|
+
|
21
|
+
# Validations
|
22
|
+
validates_presence_of :name, :email, :surname
|
23
|
+
validates :email, uniqueness: true
|
24
|
+
|
25
|
+
# Callbacks
|
26
|
+
after_commit :send_login_info, on: :create
|
27
|
+
before_validation :create_password, on: :create
|
28
|
+
after_initialize do |obj|
|
29
|
+
obj.is_generated_password = false
|
30
|
+
end
|
31
|
+
|
32
|
+
def active_for_authentication?
|
33
|
+
super && self.is_active
|
34
|
+
end
|
35
|
+
|
36
|
+
def full_name
|
37
|
+
"#{self.name} #{self.surname}"
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def create_password
|
43
|
+
if self.password.nil?
|
44
|
+
password = Devise.friendly_token.first(8)
|
45
|
+
self.password = password
|
46
|
+
self.password_confirmation = password
|
47
|
+
self.is_generated_password = true
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def send_login_info
|
52
|
+
UserMailer.login_info(self.id, self.password).deliver_later! if self.is_generated_password
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
%h2= t('email.hello')
|
2
|
+
|
3
|
+
%p= t('email.admin.login_info.first_info')
|
4
|
+
%p= "#{t('email.admin.login_info.second_info')} :"
|
5
|
+
%p
|
6
|
+
%strong= "#{t('activerecord.attributes.admin.email')} :"
|
7
|
+
= @admin.email
|
8
|
+
%p
|
9
|
+
%strong= "#{t('activerecord.attributes.admin.password')} :"
|
10
|
+
= @password
|
11
|
+
%p= link_to t('email.admin.login_info.btn_login'), new_admin_session_url
|
12
|
+
|
13
|
+
%p= t('email.admin.login_info.last_info', link: new_admin_session_url ).html_safe
|
@@ -1,9 +1,10 @@
|
|
1
|
-
%h2
|
2
|
-
=
|
1
|
+
%h2
|
2
|
+
= t('devise.confirmation.new.title')
|
3
|
+
= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
|
3
4
|
= f.error_notification
|
4
5
|
= f.full_error :confirmation_token
|
5
6
|
.form-inputs
|
6
|
-
= f.input :email, :
|
7
|
+
= f.input :email, required: true, autofocus: true
|
7
8
|
.form-actions
|
8
|
-
= f.button :submit,
|
9
|
-
= render
|
9
|
+
= f.button :submit, t('devise.confirmation.btn.resend'), class: 'btn btn-primary'
|
10
|
+
= render 'devise/shared/links'
|
@@ -1,4 +1,6 @@
|
|
1
1
|
%p
|
2
|
-
|
3
|
-
%p
|
4
|
-
|
2
|
+
= t( 'email.salut', user: @resource.email )
|
3
|
+
%p
|
4
|
+
= "#{t( 'email.devise.confirmation_instruction.desc1')} :"
|
5
|
+
%p
|
6
|
+
= link_to t( 'email.devise.confirmation_instruction.btn_confirm'), confirmation_url(@resource, confirmation_token: @token)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
%p
|
2
|
-
= t( 'email.salut',
|
2
|
+
= t( 'email.salut', user: @resource.email )
|
3
3
|
%p
|
4
4
|
= t( 'email.devise.reset_password.desc1')
|
5
|
-
%p= link_to t( 'email.devise.reset_password.change'), edit_password_url(@resource, :
|
5
|
+
%p= link_to t( 'email.devise.reset_password.change'), edit_password_url(@resource, reset_password_token: @token)
|
6
6
|
%p
|
7
7
|
= t( 'email.devise.reset_password.desc2')
|
8
8
|
%p
|
@@ -1,11 +1,11 @@
|
|
1
1
|
%h2= t('devise.password.edit.title')
|
2
|
-
= simple_form_for(resource, :
|
2
|
+
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
|
3
3
|
= f.error_notification
|
4
|
-
= f.input :reset_password_token, :
|
4
|
+
= f.input :reset_password_token, as: :hidden
|
5
5
|
= f.full_error :reset_password_token
|
6
6
|
.form-inputs
|
7
7
|
= f.input :password, label: t('devise.password.edit.new_password'), required: true, autofocus: true
|
8
8
|
= f.input :password_confirmation, label: t('devise.password.edit.confirmation'), required: true
|
9
9
|
.form-actions
|
10
10
|
= f.button :submit, t('devise.password.edit.button'), class: 'btn btn-primary'
|
11
|
-
= render
|
11
|
+
= render 'devise/shared/links'
|
@@ -1,9 +1,9 @@
|
|
1
1
|
%h2= t('devise.password.reset.title')
|
2
|
-
= simple_form_for(resource, :
|
2
|
+
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
|
3
3
|
= f.error_notification
|
4
4
|
.form-inputs
|
5
|
-
= f.input :email, :
|
5
|
+
= f.input :email, required: true, autofocus: true
|
6
6
|
.form-actions
|
7
7
|
= f.button :submit, t('devise.password.reset.instructions'), class: 'btn btn-primary'
|
8
8
|
%br
|
9
|
-
= render
|
9
|
+
= render 'devise/shared/links'
|
@@ -1,18 +1,12 @@
|
|
1
1
|
%h2
|
2
2
|
= t('devise.registration.title', model: resource.class.model_name.human )
|
3
|
-
= simple_form_for(resource, :
|
3
|
+
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
|
4
4
|
= f.error_notification
|
5
5
|
.form-inputs
|
6
|
-
= f.input :email, :
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
= f.input :password, :autocomplete => "off", hint: t('devise.registration.hint_password'), :required => false
|
11
|
-
= f.input :password_confirmation, :required => false
|
12
|
-
= f.input :current_password, hint: t('devise.registration.hint_current_password'), :required => true
|
6
|
+
= f.input :email, required: true, autofocus: true
|
7
|
+
= f.input :password, autocomplete: 'off', hint: t('devise.registration.hint_password'), required: false
|
8
|
+
= f.input :password_confirmation, required: false
|
9
|
+
= f.input :current_password, hint: t('devise.registration.hint_current_password'), required: true
|
13
10
|
.form-actions
|
14
11
|
= f.button :submit, t('btn.update'), class: 'btn btn-primary'
|
15
|
-
%h3 Cancel my account
|
16
|
-
%p
|
17
|
-
Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete}
|
18
12
|
= link_to t('btn.back'), :back
|
@@ -1,12 +1,24 @@
|
|
1
1
|
%h2
|
2
2
|
= t('devise.registration.new.title', model: resource.class.model_name.human)
|
3
|
-
|
3
|
+
%hr/
|
4
|
+
- if devise_mapping.omniauthable?
|
5
|
+
- resource_class.omniauth_providers.each do |provider|
|
6
|
+
= link_to omniauth_authorize_path(resource_name, provider), class: 'btn btn-lg btn-primary btn-block' do
|
7
|
+
%i.fa.fa-facebook
|
8
|
+
= t('devise.shared.links.signup_with', name: provider.to_s.titleize)
|
9
|
+
%hr/
|
10
|
+
%h3.text-center
|
11
|
+
= t('view.or')
|
12
|
+
%hr/
|
13
|
+
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
|
4
14
|
= f.error_notification
|
5
15
|
.form-inputs
|
6
|
-
= f.input :
|
7
|
-
= f.input :
|
8
|
-
= f.input :
|
9
|
-
= f.input :
|
16
|
+
= f.input :email
|
17
|
+
= f.input :password
|
18
|
+
= f.input :password_confirmation
|
19
|
+
= f.input :name
|
20
|
+
= f.input :surname
|
21
|
+
= f.input :time_zone, input_html: { class: 'chosen-select'}, include_blank: t('view.select')
|
10
22
|
.form-actions
|
11
23
|
= f.button :submit, t('devise.registration.new.button'), class: 'btn btn-primary'
|
12
|
-
= render
|
24
|
+
= render 'devise/shared/links'
|
@@ -17,4 +17,6 @@
|
|
17
17
|
- if devise_mapping.omniauthable?
|
18
18
|
- resource_class.omniauth_providers.each do |provider|
|
19
19
|
= link_to t('devise.shared.links.signin_with', name: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider)
|
20
|
-
%br/
|
20
|
+
%br/
|
21
|
+
= link_to t('navbar.home_page'), root_path
|
22
|
+
%br/
|
@@ -1,9 +1,9 @@
|
|
1
1
|
%h2 Resend unlock instructions
|
2
|
-
= simple_form_for(resource, :
|
2
|
+
= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
|
3
3
|
= f.error_notification
|
4
4
|
= f.full_error :unlock_token
|
5
5
|
.form-inputs
|
6
|
-
= f.input :email, :
|
6
|
+
= f.input :email, required: true, autofocus: true
|
7
7
|
.form-actions
|
8
|
-
= f.button :submit,
|
9
|
-
= render
|
8
|
+
= f.button :submit, 'Resend unlock instructions'
|
9
|
+
= render 'devise/shared/links'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
%tr{class: admin.is_active ? 'active' : 'passive'}
|
2
|
+
%td= admin.id
|
3
|
+
%td= admin.full_name
|
4
|
+
%td= mail_to admin.email, admin.email
|
5
|
+
%td=l admin.current_sign_in_at if admin.current_sign_in_at.present?
|
6
|
+
%td=l admin.last_sign_in_at if admin.last_sign_in_at.present?
|
7
|
+
%td= admin.is_active ? t('view.active') : t('view.passive')
|
8
|
+
%td.action
|
9
|
+
= link_to([:hq, admin], class: 'btn btn-success', data: { toggle: :tooltip}, title: t('tooltips.zoom')) do
|
10
|
+
%i.icon-zoom-in
|
11
|
+
= link_to(edit_hq_admin_path(admin) , class: 'btn btn-info', data: { toggle: :tooltip }, title: t('tooltips.edit')) do
|
12
|
+
%i.icon-edit
|
13
|
+
- if admin.id != current_admin.id
|
14
|
+
= link_to([:hq, admin], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure'), toggle: :tooltip }, title: t('tooltips.delete')) do
|
15
|
+
%i.icon-trash
|
16
|
+
- if admin.is_active
|
17
|
+
= link_to(toggle_is_active_hq_admin_path(admin), class: 'btn btn-danger', method: :post, data: { toggle: :tooltip}, title: t('view.make_passive') ) do
|
18
|
+
%i.icon-ban-circle
|
19
|
+
- else
|
20
|
+
= link_to(toggle_is_active_hq_admin_path(admin), class: 'btn btn-info', method: :post, data: { toggle: :tooltip}, title: t('view.make_active')) do
|
21
|
+
%i.icon-check
|