cybele 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/README.md +16 -2
  4. data/dump.rdb +1 -0
  5. data/lib/cybele/app_builder.rb +213 -220
  6. data/lib/cybele/generators/app_generator.rb +31 -20
  7. data/lib/cybele/version.rb +2 -2
  8. data/templates/.env.local.erb +11 -0
  9. data/templates/.env.production.erb +11 -0
  10. data/templates/.env.staging.erb +11 -0
  11. data/templates/README.md.erb +22 -0
  12. data/templates/app/assets/javascripts/application.js.coffee +63 -1
  13. data/templates/app/assets/javascripts/hq/application.js.coffee +93 -0
  14. data/templates/app/assets/stylesheets/application.css.sass +15 -4
  15. data/templates/app/assets/stylesheets/hq/application.css.sass +92 -0
  16. data/templates/app/controllers/application_controller.rb.erb +48 -0
  17. data/templates/app/controllers/concerns/basic_authentication.rb +18 -0
  18. data/templates/app/controllers/hq/admins_controller.rb +64 -0
  19. data/templates/app/controllers/hq/application_controller.rb +11 -0
  20. data/templates/app/controllers/hq/audits_controller.rb +16 -0
  21. data/templates/app/controllers/hq/cities_controller.rb +54 -0
  22. data/templates/app/controllers/hq/countries_controller.rb +54 -0
  23. data/templates/app/controllers/hq/dashboard_controller.rb +4 -1
  24. data/templates/app/controllers/hq/passwords_controller.rb +10 -0
  25. data/templates/app/controllers/hq/registrations_controller.rb +21 -0
  26. data/templates/app/controllers/hq/sessions_controller.rb +1 -1
  27. data/templates/app/controllers/hq/users_controller.rb +64 -0
  28. data/templates/app/controllers/user/dashboard_controller.rb +8 -0
  29. data/templates/app/controllers/user/passwords_controller.rb +10 -0
  30. data/templates/app/controllers/user/profiles_controller.rb +34 -0
  31. data/templates/app/controllers/user/registrations_controller.rb +20 -0
  32. data/templates/app/controllers/user/sessions_controller.rb +16 -0
  33. data/templates/app/controllers/user/user_application_controller.rb +20 -0
  34. data/templates/app/helpers/application_helper.rb.erb +27 -0
  35. data/templates/app/mailers/admin_mailer.rb +10 -0
  36. data/templates/app/mailers/base_mailer.rb +4 -0
  37. data/templates/app/mailers/user_mailer.rb +10 -0
  38. data/templates/app/models/admin.rb +51 -0
  39. data/templates/app/models/audit.rb +3 -0
  40. data/templates/app/models/city.rb +12 -0
  41. data/templates/app/models/country.rb +12 -0
  42. data/templates/app/models/user.rb +54 -0
  43. data/templates/app/views/admin_mailer/login_info.html.haml +13 -0
  44. data/templates/app/views/devise/confirmations/new.html.haml +6 -5
  45. data/templates/app/views/devise/mailer/confirmation_instructions.html.haml +5 -3
  46. data/templates/app/views/devise/mailer/reset_password_instructions.html.haml +2 -2
  47. data/templates/app/views/devise/passwords/edit.html.haml +3 -3
  48. data/templates/app/views/devise/passwords/new.html.haml +3 -3
  49. data/templates/app/views/devise/registrations/edit.html.haml +5 -11
  50. data/templates/app/views/devise/registrations/new.html.haml +18 -6
  51. data/templates/app/views/devise/sessions/new.html.haml +1 -1
  52. data/templates/app/views/devise/shared/_links.haml +3 -1
  53. data/templates/app/views/devise/unlocks/new.html.haml +4 -4
  54. data/templates/app/views/hq/admins/_admin.html.haml +21 -0
  55. data/templates/app/views/hq/admins/_blank.html.haml +9 -0
  56. data/templates/app/views/hq/admins/_filters.html.haml +20 -0
  57. data/templates/app/views/hq/admins/_form.html.haml +17 -0
  58. data/templates/app/views/hq/admins/_list.html.haml +15 -0
  59. data/templates/app/views/hq/admins/edit.html.haml +3 -0
  60. data/templates/app/views/hq/admins/index.html.haml +18 -0
  61. data/templates/app/views/hq/admins/new.html.haml +5 -0
  62. data/templates/app/views/hq/admins/show.html.haml +19 -0
  63. data/templates/app/views/hq/audits/_filters.html.haml +32 -0
  64. data/templates/app/views/hq/audits/_list.html.haml +37 -0
  65. data/templates/app/views/hq/audits/index.html.haml +5 -0
  66. data/templates/app/views/hq/audits/show.html.haml +5 -0
  67. data/templates/app/views/hq/cities/_blank.html.haml +9 -0
  68. data/templates/app/views/hq/cities/_city.html.haml +12 -0
  69. data/templates/app/views/hq/cities/_filters.html.haml +15 -0
  70. data/templates/app/views/hq/cities/_form.html.haml +15 -0
  71. data/templates/app/views/hq/cities/_list.html.haml +13 -0
  72. data/templates/app/views/hq/cities/edit.html.haml +3 -0
  73. data/templates/app/views/hq/cities/index.html.haml +18 -0
  74. data/templates/app/views/hq/cities/new.html.haml +3 -0
  75. data/templates/app/views/hq/cities/show.html.haml +13 -0
  76. data/templates/app/views/hq/countries/_blank.html.haml +9 -0
  77. data/templates/app/views/hq/countries/_country.html.haml +11 -0
  78. data/templates/app/views/hq/countries/_filters.html.haml +14 -0
  79. data/templates/app/views/hq/countries/_form.html.haml +14 -0
  80. data/templates/app/views/hq/countries/_list.html.haml +12 -0
  81. data/templates/app/views/hq/countries/edit.html.haml +3 -0
  82. data/templates/app/views/hq/countries/index.html.haml +18 -0
  83. data/templates/app/views/hq/countries/new.html.haml +3 -0
  84. data/templates/app/views/hq/countries/show.html.haml +14 -0
  85. data/templates/app/views/hq/dashboard/index.html.haml +8 -0
  86. data/templates/app/views/hq/passwords/edit.html.haml +12 -0
  87. data/templates/app/views/hq/passwords/new.html.haml +9 -0
  88. data/templates/app/views/hq/registrations/edit.html.haml +19 -0
  89. data/templates/app/views/hq/sessions/new.html.haml +7 -5
  90. data/templates/app/views/hq/users/_blank.html.haml +9 -0
  91. data/templates/app/views/hq/users/_filters.html.haml +20 -0
  92. data/templates/app/views/hq/users/_form.html.haml +18 -0
  93. data/templates/app/views/hq/users/_list.html.haml +15 -0
  94. data/templates/app/views/hq/users/_user.html.haml +20 -0
  95. data/templates/app/views/hq/users/edit.html.haml +3 -0
  96. data/templates/app/views/hq/users/index.html.haml +18 -0
  97. data/templates/app/views/hq/users/new.html.haml +5 -0
  98. data/templates/app/views/hq/users/show.html.haml +20 -0
  99. data/templates/app/views/layouts/application.html.haml.erb +16 -8
  100. data/templates/app/views/layouts/hq/application.html.haml.erb +55 -0
  101. data/templates/app/views/layouts/hq/login.html.haml.erb +35 -0
  102. data/templates/app/views/layouts/hq/partials/_dock.html.haml.erb +36 -0
  103. data/templates/app/views/layouts/hq/partials/_footer.html.haml.erb +0 -0
  104. data/templates/app/views/layouts/hq/partials/_navbar.html.haml.erb +22 -0
  105. data/templates/app/views/layouts/hq/partials/_trackers.html.haml.erb +0 -0
  106. data/templates/app/views/layouts/mailer.html.haml.erb +321 -0
  107. data/templates/app/views/layouts/mailer.text.haml +1 -0
  108. data/templates/app/views/layouts/partials/_footer.html.haml.erb +0 -0
  109. data/templates/app/views/layouts/partials/_trackers.html.haml.erb +0 -0
  110. data/templates/app/views/layouts/partials/_warnings.html.haml.erb +3 -0
  111. data/templates/app/views/user/dashboard/index.html.haml +8 -0
  112. data/templates/app/views/user/passwords/edit.html.haml +12 -0
  113. data/templates/app/views/user/passwords/new.html.haml +10 -0
  114. data/templates/app/views/{user_profiles → user/profiles}/_form.html.haml +4 -5
  115. data/templates/app/views/user/profiles/edit.html.haml +3 -0
  116. data/templates/app/views/user/profiles/show.html.haml +15 -0
  117. data/templates/app/views/user/registrations/edit.html.haml +19 -0
  118. data/templates/app/views/user/sessions/new.html.haml +11 -0
  119. data/templates/app/views/user_mailer/login_info.html.haml +13 -0
  120. data/templates/app/views/welcome/index.html.haml.erb +4 -4
  121. data/templates/config/initializers/devise_async.rb +6 -0
  122. data/templates/config/initializers/sidekiq.rb +13 -0
  123. data/templates/config/locales/email.tr.yml +28 -0
  124. data/templates/config/locales/models.tr.yml +72 -41
  125. data/templates/config/locales/responders.tr.yml +4 -1
  126. data/templates/config/locales/show_for.tr.yml +1 -3
  127. data/templates/config/locales/simple_form.tr.yml +8 -22
  128. data/templates/config/locales/tr.yml +33 -2
  129. data/templates/config/locales/view.tr.yml +64 -18
  130. data/templates/config/routes.erb +51 -0
  131. data/templates/config/schedule.yml +16 -0
  132. data/templates/config/settings/production.yml +0 -17
  133. data/templates/config/settings/staging.yml +0 -17
  134. data/templates/config/sidekiq.yml +13 -0
  135. data/templates/cybele_Gemfile +42 -5
  136. data/templates/cybele_gitignore +3 -1
  137. data/templates/cybele_version.txt +1 -0
  138. data/templates/env.sample.erb +11 -0
  139. data/templates/lib/data/cities.yml +163 -0
  140. data/templates/lib/tasks/dev.rake +29 -5
  141. data/templates/lib/tasks/sidekiq.rake +26 -0
  142. data/templates/lib/templates/rails/responders_controller/controller.rb +27 -22
  143. data/templates/public/images/favicon.png +0 -0
  144. data/templates/public/images/mail-logo.png +0 -0
  145. data/templates/public/images/missing_cover.png +0 -0
  146. data/templates/public/images/missing_cover@2x.png +0 -0
  147. data/templates/public/images/missing_logo.png +0 -0
  148. data/templates/public/images/missing_logo@2x.png +0 -0
  149. data/templates/public/images/sprite.png +0 -0
  150. data/templates/ruby-version +1 -1
  151. data/templates/vendor/assets/javascripts/jquery.datetimepicker.js +1871 -0
  152. data/templates/vendor/assets/javascripts/jquery.maskedinput.min.js +7 -0
  153. data/templates/vendor/assets/javascripts/nprogress.js +491 -0
  154. data/templates/vendor/assets/javascripts/trix.js +25 -0
  155. data/templates/vendor/assets/stylesheets/jquery.datetimepicker.css +418 -0
  156. data/templates/vendor/assets/stylesheets/nprogress.css +74 -0
  157. data/templates/vendor/assets/stylesheets/trix.css +209 -0
  158. metadata +125 -24
  159. data/templates/app/controllers/application_controller.rb +0 -19
  160. data/templates/app/controllers/hq/admin_profiles_controller.rb +0 -56
  161. data/templates/app/controllers/user_profiles_controller.rb +0 -56
  162. data/templates/app/views/hq/admin_profiles/_form.html.haml +0 -15
  163. data/templates/app/views/hq/admin_profiles/edit.html.haml +0 -3
  164. data/templates/app/views/hq/admin_profiles/new.html.haml +0 -3
  165. data/templates/app/views/hq/admin_profiles/show.html.haml +0 -13
  166. data/templates/app/views/hq/dashboard/index.html.haml.erb +0 -3
  167. data/templates/app/views/user_profiles/edit.html.haml +0 -3
  168. data/templates/app/views/user_profiles/new.html.haml +0 -3
  169. data/templates/app/views/user_profiles/show.html.haml +0 -13
  170. data/templates/config/locales/en.yml +0 -2
  171. data/templates/config/locales/models.en.yml +0 -54
  172. data/templates/config/locales/responders.en.yml +0 -10
  173. data/templates/config/locales/show_for.en.yml +0 -7
  174. data/templates/config/locales/simple_form.en.yml +0 -30
  175. 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,10 @@
1
+ class AdminMailer < BaseMailer
2
+
3
+ def login_info(admin_id, password)
4
+ @admin = Admin.find admin_id
5
+ @password = password
6
+ @subject = t('email.admin.login_info.title')
7
+ mail(to: @admin.email, subject: @subject)
8
+ end
9
+
10
+ end
@@ -0,0 +1,4 @@
1
+ class BaseMailer < ActionMailer::Base
2
+ default from: Settings.email.noreply
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,10 @@
1
+ class UserMailer < BaseMailer
2
+
3
+ def login_info(user_id, password)
4
+ @user = User.find user_id
5
+ @password = password
6
+ @subject = t('email.user.login_info.title')
7
+ mail(to: @user.email, subject: @subject)
8
+ end
9
+
10
+ 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,3 @@
1
+ class Audit < Audited::Adapters::ActiveRecord::Audit
2
+
3
+ end
@@ -0,0 +1,12 @@
1
+ class City < ActiveRecord::Base
2
+
3
+ # Helpers
4
+ audited
5
+
6
+ # Relations
7
+ belongs_to :country
8
+
9
+ # Validations
10
+ validates_presence_of :name, :country_id
11
+
12
+ end
@@ -0,0 +1,12 @@
1
+ class Country < ActiveRecord::Base
2
+
3
+ # Helpers
4
+ audited
5
+
6
+ # Relations
7
+ has_many :cities, dependent: :restrict_with_error
8
+
9
+ # Validations
10
+ validates_presence_of :name
11
+
12
+ 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 Resend confirmation instructions
2
- = simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f|
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, :required => true, :autofocus => true
7
+ = f.input :email, required: true, autofocus: true
7
8
  .form-actions
8
- = f.button :submit, "Resend confirmation instructions"
9
- = render "devise/shared/links"
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
- Welcome #{@email}!
3
- %p You can confirm your account email through the link below:
4
- %p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)
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', email: @resource.email )
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, :reset_password_token => @token)
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, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f|
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, :as => :hidden
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 "devise/shared/links"
11
+ = render 'devise/shared/links'
@@ -1,9 +1,9 @@
1
1
  %h2= t('devise.password.reset.title')
2
- = simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f|
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, :required => true, :autofocus => true
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 "devise/shared/links"
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, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
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, :required => true, :autofocus => true
7
- - if devise_mapping.confirmable? && resource.pending_reconfirmation?
8
- %p
9
- Currently waiting confirmation for: #{resource.unconfirmed_email}
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
- = simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
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 :name, :autofocus => true
7
- = f.input :email, :required => true
8
- = f.input :password, :required => true
9
- = f.input :password_confirmation, :required => true
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 "devise/shared/links"
24
+ = render 'devise/shared/links'
@@ -7,4 +7,4 @@
7
7
  = f.input :remember_me, label: t('devise.session.remember_me'), as: :boolean if devise_mapping.rememberable?
8
8
  .form-actions
9
9
  = f.button :submit, t('devise.session.button'), class: 'btn btn-primary'
10
- = render "devise/shared/links"
10
+ = 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, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f|
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, :required => true, :autofocus => true
6
+ = f.input :email, required: true, autofocus: true
7
7
  .form-actions
8
- = f.button :submit, "Resend unlock instructions"
9
- = render "devise/shared/links"
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