granule 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +21 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -7
- data/Gemfile +2 -0
- data/README.md +112 -13
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/exe/granule +1 -2
- data/granule.gemspec +2 -0
- data/lib/granule/cli.rb +19 -4
- data/lib/granule/feature/devise_semantic/devise.en.yml +65 -0
- data/lib/granule/feature/devise_semantic/devise.rb +303 -0
- data/lib/granule/feature/devise_semantic/devise_create_users.rb +43 -0
- data/lib/granule/feature/devise_semantic/user.rb +8 -0
- data/lib/granule/feature/devise_semantic/views/users/confirmations/new.html.erb +16 -0
- data/lib/granule/feature/devise_semantic/views/users/mailer/confirmation_instructions.html.erb +5 -0
- data/lib/granule/feature/devise_semantic/views/users/mailer/email_changed.html.erb +7 -0
- data/lib/granule/feature/devise_semantic/views/users/mailer/password_change.html.erb +3 -0
- data/lib/granule/feature/devise_semantic/views/users/mailer/reset_password_instructions.html.erb +8 -0
- data/lib/granule/feature/devise_semantic/views/users/mailer/unlock_instructions.html.erb +7 -0
- data/lib/granule/feature/devise_semantic/views/users/passwords/edit.html.erb +25 -0
- data/lib/granule/feature/devise_semantic/views/users/passwords/new.html.erb +18 -0
- data/lib/granule/feature/devise_semantic/views/users/registrations/edit.html.erb +45 -0
- data/lib/granule/feature/devise_semantic/views/users/registrations/new.html.erb +31 -0
- data/lib/granule/feature/devise_semantic/views/users/sessions/new.html.erb +37 -0
- data/lib/granule/feature/devise_semantic/views/users/shared/_error_messages.html.erb +14 -0
- data/lib/granule/feature/devise_semantic/views/users/shared/_links.html.erb +25 -0
- data/lib/granule/feature/devise_semantic/views/users/show.html.erb +22 -0
- data/lib/granule/feature/devise_semantic/views/users/unlocks/new.html.erb +16 -0
- data/lib/granule/feature/devise_semantic.rb +58 -0
- data/lib/granule/feature/semantic_react/hello_react.jsx +340 -0
- data/lib/granule/feature/semantic_react/homes_controller.rb +5 -0
- data/lib/granule/feature/semantic_react/index.html.erb +0 -0
- data/lib/granule/feature/semantic_react.rb +50 -0
- data/lib/granule/new/base/.dockerignore.tt +5 -0
- data/lib/granule/new/base/.gitignore.tt +33 -0
- data/lib/granule/{templates → new/base}/.rubocop.yml.tt +0 -0
- data/lib/granule/new/base/Dockerfile.dev.tt +34 -0
- data/lib/granule/{templates → new/base}/Gemfile.tt +5 -8
- data/lib/granule/new/base/README.md.tt +21 -0
- data/lib/granule/new/base/database.yml.tt +21 -0
- data/lib/granule/new/base/docker-compose.yml.tt +83 -0
- data/lib/granule/new/base.rb +19 -0
- data/lib/granule/version.rb +4 -2
- data/lib/granule.rb +2 -1
- metadata +38 -8
- data/Gemfile.lock +0 -169
- data/lib/granule/template.rb +0 -10
@@ -0,0 +1,303 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
4
|
+
# Many of these configuration options can be set straight in your model.
|
5
|
+
Devise.setup do |config|
|
6
|
+
# The secret key used by Devise. Devise uses this key to generate
|
7
|
+
# random tokens. Changing this key will render invalid all existing
|
8
|
+
# confirmation, reset password and unlock tokens in the database.
|
9
|
+
# Devise will use the `secret_key_base` as its `secret_key`
|
10
|
+
# by default. You can change it below and use your own secret key.
|
11
|
+
# config.secret_key =
|
12
|
+
# '8bb48b9f9addbf44679765e10965defd52f23744049c41bb888343daf5a5'\
|
13
|
+
# '3285179bef564973e57daf267987c5a6f4164cb352b47d6bf9ed85f99c8e2c7957ce'
|
14
|
+
|
15
|
+
# ==> Controller configuration
|
16
|
+
# Configure the parent class to the devise controllers.
|
17
|
+
# config.parent_controller = 'DeviseController'
|
18
|
+
|
19
|
+
# ==> Mailer Configuration
|
20
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
21
|
+
# note that it will be overwritten if you use your own mailer class
|
22
|
+
# with default "from" parameter.
|
23
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
24
|
+
|
25
|
+
# Configure the class responsible to send e-mails.
|
26
|
+
# config.mailer = 'Devise::Mailer'
|
27
|
+
|
28
|
+
# Configure the parent class responsible to send e-mails.
|
29
|
+
# config.parent_mailer = 'ActionMailer::Base'
|
30
|
+
|
31
|
+
# ==> ORM configuration
|
32
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
33
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
34
|
+
# available as additional gems.
|
35
|
+
require 'devise/orm/active_record'
|
36
|
+
|
37
|
+
# ==> Configuration for any authentication mechanism
|
38
|
+
# Configure which keys are used when authenticating a user. The default is
|
39
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
40
|
+
# authenticating a user, both parameters are required. Remember that those
|
41
|
+
# parameters are used only when authenticating and not when retrieving from
|
42
|
+
# session. If you need permissions, you should implement that in a before filter.
|
43
|
+
# You can also supply a hash where the value is a boolean determining whether
|
44
|
+
# or not authentication should be aborted when the value is not present.
|
45
|
+
# config.authentication_keys = [:email]
|
46
|
+
|
47
|
+
# Configure parameters from the request object used for authentication. Each entry
|
48
|
+
# given should be a request method and it will automatically be passed to the
|
49
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
50
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
51
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
52
|
+
# config.request_keys = []
|
53
|
+
|
54
|
+
# Configure which authentication keys should be case-insensitive.
|
55
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
56
|
+
# to authenticate or find a user. Default is :email.
|
57
|
+
config.case_insensitive_keys = [:email]
|
58
|
+
|
59
|
+
# Configure which authentication keys should have whitespace stripped.
|
60
|
+
# These keys will have whitespace before and after removed upon creating or
|
61
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
62
|
+
config.strip_whitespace_keys = [:email]
|
63
|
+
|
64
|
+
# Tell if authentication through request.params is enabled. True by default.
|
65
|
+
# It can be set to an array that will enable params authentication only for the
|
66
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
67
|
+
# enable it only for database (email + password) authentication.
|
68
|
+
# config.params_authenticatable = true
|
69
|
+
|
70
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
71
|
+
# It can be set to an array that will enable http authentication only for the
|
72
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
73
|
+
# enable it only for database authentication. The supported strategies are:
|
74
|
+
# :database = Support basic authentication with authentication key + password
|
75
|
+
# config.http_authenticatable = false
|
76
|
+
|
77
|
+
# If 401 status code should be returned for AJAX requests. True by default.
|
78
|
+
# config.http_authenticatable_on_xhr = true
|
79
|
+
|
80
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
81
|
+
# config.http_authentication_realm = 'Application'
|
82
|
+
|
83
|
+
# It will change confirmation, password recovery and other workflows
|
84
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
85
|
+
# Does not affect registerable.
|
86
|
+
# config.paranoid = true
|
87
|
+
|
88
|
+
# By default Devise will store the user in session. You can skip storage for
|
89
|
+
# particular strategies by setting this option.
|
90
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
91
|
+
# may want to disable generating routes to Devise's sessions controller by
|
92
|
+
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
93
|
+
config.skip_session_storage = [:http_auth]
|
94
|
+
|
95
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
96
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
97
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
98
|
+
# from the server. You can disable this option at your own risk.
|
99
|
+
# config.clean_up_csrf_token_on_authentication = true
|
100
|
+
|
101
|
+
# When false, Devise will not attempt to reload routes on eager load.
|
102
|
+
# This can reduce the time taken to boot the app but if your application
|
103
|
+
# requires the Devise mappings to be loaded during boot time the application
|
104
|
+
# won't boot properly.
|
105
|
+
# config.reload_routes = true
|
106
|
+
|
107
|
+
# ==> Configuration for :database_authenticatable
|
108
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 11. If
|
109
|
+
# using other algorithms, it sets how many times you want the password to be hashed.
|
110
|
+
#
|
111
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
112
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
113
|
+
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
114
|
+
# algorithm), the cost increases exponentially with the number of stretches (e.g.
|
115
|
+
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
116
|
+
config.stretches = Rails.env.test? ? 1 : 11
|
117
|
+
|
118
|
+
# Set up a pepper to generate the hashed password.
|
119
|
+
# config.pepper =
|
120
|
+
# '4673da1a73e13f31b1ebb85eca1139f8ea0fd789061cf0a2558e275c06'\
|
121
|
+
# 'c0cad9c67f8602bfa8ef42804e25c8f7392e8b57bb16a80c74de39c0c587ed18d999d4'
|
122
|
+
|
123
|
+
# Send a notification to the original email when the user's email is changed.
|
124
|
+
# config.send_email_changed_notification = false
|
125
|
+
|
126
|
+
# Send a notification email when the user's password is changed.
|
127
|
+
# config.send_password_change_notification = false
|
128
|
+
|
129
|
+
# ==> Configuration for :confirmable
|
130
|
+
# A period that the user is allowed to access the website even without
|
131
|
+
# confirming their account. For instance, if set to 2.days, the user will be
|
132
|
+
# able to access the website for two days without confirming their account,
|
133
|
+
# access will be blocked just in the third day.
|
134
|
+
# You can also set it to nil, which will allow the user to access the website
|
135
|
+
# without confirming their account.
|
136
|
+
# Default is 0.days, meaning the user cannot access the website without
|
137
|
+
# confirming their account.
|
138
|
+
# config.allow_unconfirmed_access_for = 2.days
|
139
|
+
|
140
|
+
# A period that the user is allowed to confirm their account before their
|
141
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
142
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
143
|
+
# their account can't be confirmed with the token any more.
|
144
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
145
|
+
# before confirming their account.
|
146
|
+
# config.confirm_within = 3.days
|
147
|
+
|
148
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
149
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
150
|
+
# db field (see migrations). Until confirmed, new email is stored in
|
151
|
+
# unconfirmed_email column, and copied to email column on successful confirmation.
|
152
|
+
config.reconfirmable = true
|
153
|
+
|
154
|
+
# Defines which key will be used when confirming an account
|
155
|
+
# config.confirmation_keys = [:email]
|
156
|
+
|
157
|
+
# ==> Configuration for :rememberable
|
158
|
+
# The time the user will be remembered without asking for credentials again.
|
159
|
+
# config.remember_for = 2.weeks
|
160
|
+
|
161
|
+
# Invalidates all the remember me tokens when the user signs out.
|
162
|
+
config.expire_all_remember_me_on_sign_out = true
|
163
|
+
|
164
|
+
# If true, extends the user's remember period when remembered via cookie.
|
165
|
+
# config.extend_remember_period = false
|
166
|
+
|
167
|
+
# Options to be passed to the created cookie. For instance, you can set
|
168
|
+
# secure: true in order to force SSL only cookies.
|
169
|
+
# config.rememberable_options = {}
|
170
|
+
|
171
|
+
# ==> Configuration for :validatable
|
172
|
+
# Range for password length.
|
173
|
+
config.password_length = 6..128
|
174
|
+
|
175
|
+
# Email regex used to validate email formats. It simply asserts that
|
176
|
+
# one (and only one) @ exists in the given string. This is mainly
|
177
|
+
# to give user feedback and not to assert the e-mail validity.
|
178
|
+
config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
|
179
|
+
|
180
|
+
# ==> Configuration for :timeoutable
|
181
|
+
# The time you want to timeout the user session without activity. After this
|
182
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
183
|
+
# config.timeout_in = 30.minutes
|
184
|
+
|
185
|
+
# ==> Configuration for :lockable
|
186
|
+
# Defines which strategy will be used to lock an account.
|
187
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
188
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
189
|
+
# config.lock_strategy = :failed_attempts
|
190
|
+
|
191
|
+
# Defines which key will be used when locking and unlocking an account
|
192
|
+
# config.unlock_keys = [:email]
|
193
|
+
|
194
|
+
# Defines which strategy will be used to unlock an account.
|
195
|
+
# :email = Sends an unlock link to the user email
|
196
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
197
|
+
# :both = Enables both strategies
|
198
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
199
|
+
# config.unlock_strategy = :both
|
200
|
+
|
201
|
+
# Number of authentication tries before locking an account if lock_strategy
|
202
|
+
# is failed attempts.
|
203
|
+
# config.maximum_attempts = 20
|
204
|
+
|
205
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
206
|
+
# config.unlock_in = 1.hour
|
207
|
+
|
208
|
+
# Warn on the last attempt before the account is locked.
|
209
|
+
# config.last_attempt_warning = true
|
210
|
+
|
211
|
+
# ==> Configuration for :recoverable
|
212
|
+
#
|
213
|
+
# Defines which key will be used when recovering the password for an account
|
214
|
+
# config.reset_password_keys = [:email]
|
215
|
+
|
216
|
+
# Time interval you can reset your password with a reset password key.
|
217
|
+
# Don't put a too small interval or your users won't have the time to
|
218
|
+
# change their passwords.
|
219
|
+
config.reset_password_within = 6.hours
|
220
|
+
|
221
|
+
# When set to false, does not sign a user in automatically after their password is
|
222
|
+
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
223
|
+
# config.sign_in_after_reset_password = true
|
224
|
+
|
225
|
+
# ==> Configuration for :encryptable
|
226
|
+
# Allow you to use another hashing or encryption algorithm besides bcrypt (default).
|
227
|
+
# You can use :sha1, :sha512 or algorithms from others authentication tools as
|
228
|
+
# :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
|
229
|
+
# for default behavior) and :restful_authentication_sha1 (then you should set
|
230
|
+
# stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
|
231
|
+
#
|
232
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
233
|
+
# config.encryptor = :sha512
|
234
|
+
|
235
|
+
# ==> Scopes configuration
|
236
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
237
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
238
|
+
# are using only default views.
|
239
|
+
config.scoped_views = true
|
240
|
+
|
241
|
+
# Configure the default scope given to Warden. By default it's the first
|
242
|
+
# devise role declared in your routes (usually :user).
|
243
|
+
# config.default_scope = :user
|
244
|
+
|
245
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
246
|
+
# only the current scope. By default, Devise signs out all scopes.
|
247
|
+
# config.sign_out_all_scopes = true
|
248
|
+
|
249
|
+
# ==> Navigation configuration
|
250
|
+
# Lists the formats that should be treated as navigational. Formats like
|
251
|
+
# :html, should redirect to the sign in page when the user does not have
|
252
|
+
# access, but formats like :xml or :json, should return 401.
|
253
|
+
#
|
254
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
255
|
+
# should add them to the navigational formats lists.
|
256
|
+
#
|
257
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
258
|
+
# config.navigational_formats = ['*/*', :html]
|
259
|
+
|
260
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
261
|
+
config.sign_out_via = :delete
|
262
|
+
|
263
|
+
# ==> OmniAuth
|
264
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
265
|
+
# up on your models and hooks.
|
266
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
267
|
+
|
268
|
+
# ==> Warden configuration
|
269
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
270
|
+
# change the failure app, you can configure them inside the config.warden block.
|
271
|
+
#
|
272
|
+
# config.warden do |manager|
|
273
|
+
# manager.intercept_401 = false
|
274
|
+
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
275
|
+
# end
|
276
|
+
|
277
|
+
# ==> Mountable engine configurations
|
278
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
279
|
+
# is mountable, there are some extra configurations to be taken into account.
|
280
|
+
# The following options are available, assuming the engine is mounted as:
|
281
|
+
#
|
282
|
+
# mount MyEngine, at: '/my_engine'
|
283
|
+
#
|
284
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
285
|
+
# config.router_name = :my_engine
|
286
|
+
#
|
287
|
+
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
288
|
+
# so you need to do it manually. For the users scope, it would be:
|
289
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
290
|
+
|
291
|
+
# ==> Turbolinks configuration
|
292
|
+
# If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
|
293
|
+
#
|
294
|
+
# ActiveSupport.on_load(:devise_failure_app) do
|
295
|
+
# include Turbolinks::Controller
|
296
|
+
# end
|
297
|
+
|
298
|
+
# ==> Configuration for :registerable
|
299
|
+
|
300
|
+
# When set to false, does not sign a user in automatically after their password is
|
301
|
+
# changed. Defaults to true, so a user is signed in automatically after changing a password.
|
302
|
+
# config.sign_in_after_change_password = true
|
303
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class DeviseCreateUsers < ActiveRecord::Migration[6.0]
|
4
|
+
def change
|
5
|
+
create_table :users do |t|
|
6
|
+
## Database authenticatable
|
7
|
+
t.string :email, null: false, default: ''
|
8
|
+
t.string :encrypted_password, null: false, default: ''
|
9
|
+
|
10
|
+
## Recoverable
|
11
|
+
t.string :reset_password_token
|
12
|
+
t.datetime :reset_password_sent_at
|
13
|
+
|
14
|
+
## Rememberable
|
15
|
+
t.datetime :remember_created_at
|
16
|
+
|
17
|
+
## Trackable
|
18
|
+
# t.integer :sign_in_count, default: 0, null: false
|
19
|
+
# t.datetime :current_sign_in_at
|
20
|
+
# t.datetime :last_sign_in_at
|
21
|
+
# t.inet :current_sign_in_ip
|
22
|
+
# t.inet :last_sign_in_ip
|
23
|
+
|
24
|
+
## Confirmable
|
25
|
+
t.string :confirmation_token
|
26
|
+
t.datetime :confirmed_at
|
27
|
+
t.datetime :confirmation_sent_at
|
28
|
+
t.string :unconfirmed_email # Only if using reconfirmable
|
29
|
+
|
30
|
+
## Lockable
|
31
|
+
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
32
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
33
|
+
# t.datetime :locked_at
|
34
|
+
|
35
|
+
t.timestamps null: false
|
36
|
+
end
|
37
|
+
|
38
|
+
add_index :users, :email, unique: true
|
39
|
+
add_index :users, :reset_password_token, unique: true
|
40
|
+
add_index :users, :confirmation_token, unique: true
|
41
|
+
# add_index :users, :unlock_token, unique: true
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class User < ApplicationRecord
|
4
|
+
# Include default devise modules. Others available are:
|
5
|
+
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
|
6
|
+
devise :database_authenticatable, :registerable,
|
7
|
+
:recoverable, :rememberable, :validatable, :confirmable
|
8
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2>Resend confirmation instructions</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<div class="field">
|
7
|
+
<%= f.label :email %><br />
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="actions">
|
12
|
+
<%= f.submit "Resend confirmation instructions" %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render "users/shared/links" %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p>Hello <%= @email %>!</p>
|
2
|
+
|
3
|
+
<% if @resource.try(:unconfirmed_email?) %>
|
4
|
+
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
|
5
|
+
<% else %>
|
6
|
+
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
|
7
|
+
<% end %>
|
data/lib/granule/feature/devise_semantic/views/users/mailer/reset_password_instructions.html.erb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
4
|
+
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
|
6
|
+
|
7
|
+
<p>If you didn't request this, please ignore this email.</p>
|
8
|
+
<p>Your password won't change until you access the link above and create a new one.</p>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
4
|
+
|
5
|
+
<p>Click the link below to unlock your account:</p>
|
6
|
+
|
7
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<h2>Change your password</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
6
|
+
|
7
|
+
<div class="field">
|
8
|
+
<%= f.label :password, "New password" %><br />
|
9
|
+
<% if @minimum_password_length %>
|
10
|
+
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
|
11
|
+
<% end %>
|
12
|
+
<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="field">
|
16
|
+
<%= f.label :password_confirmation, "Confirm new password" %><br />
|
17
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="actions">
|
21
|
+
<%= f.submit "Change my password" %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<%= render "users/shared/links" %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div class="ui container">
|
2
|
+
<h2>Forgot your password?</h2>
|
3
|
+
|
4
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: {class: "ui form", method: :post}) do |f| %>
|
5
|
+
<%= render "users/shared/error_messages", resource: resource %>
|
6
|
+
|
7
|
+
<div class="field">
|
8
|
+
<%= f.label :email %>
|
9
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="actions">
|
13
|
+
<%= f.submit "Send me reset password instructions", class: 'ui button' %>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<%= render "users/shared/links" %>
|
18
|
+
</div>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<div class="ui container">
|
2
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
3
|
+
|
4
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'ui form' }) do |f| %>
|
5
|
+
<%= render "users/shared/error_messages", resource: resource %>
|
6
|
+
|
7
|
+
<div class="field">
|
8
|
+
<%= f.label :email %>
|
9
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
13
|
+
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<div class="field">
|
17
|
+
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i>
|
18
|
+
<%= f.password_field :password, autocomplete: "new-password" %>
|
19
|
+
<% if @minimum_password_length %>
|
20
|
+
<br />
|
21
|
+
<em><%= @minimum_password_length %> characters minimum</em>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="field">
|
26
|
+
<%= f.label :password_confirmation %>
|
27
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div class="field">
|
31
|
+
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i>
|
32
|
+
<%= f.password_field :current_password, autocomplete: "current-password" %>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="actions">
|
36
|
+
<%= f.submit "Update", class: 'ui button' %>
|
37
|
+
</div>
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
<h3>Cancel my account</h3>
|
41
|
+
|
42
|
+
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, class: 'ui button negative', method: :delete %></p>
|
43
|
+
|
44
|
+
<%= link_to "Back", :back %>
|
45
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div class="ui container">
|
2
|
+
<h2>Sign up</h2>
|
3
|
+
|
4
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {class: "ui form"}) do |f| %>
|
5
|
+
<%= render "users/shared/error_messages", resource: resource %>
|
6
|
+
|
7
|
+
<div class="field">
|
8
|
+
<%= f.label :email %>
|
9
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :password %>
|
14
|
+
<% if @minimum_password_length %>
|
15
|
+
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
16
|
+
<% end %>
|
17
|
+
<%= f.password_field :password, autocomplete: "new-password" %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="field">
|
21
|
+
<%= f.label :password_confirmation %>
|
22
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="actions">
|
26
|
+
<%= f.submit "Sign up", class: 'ui button' %>
|
27
|
+
</div>
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<%= render "users/shared/links" %>
|
31
|
+
</div>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<div class="ui container">
|
2
|
+
<h2>Log in</h2>
|
3
|
+
|
4
|
+
<% if alert %>
|
5
|
+
<div class="ui negative message">
|
6
|
+
<div class="header">Error</div>
|
7
|
+
<p><%= alert %></p>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: "ui form"}) do |f| %>
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :email %>
|
14
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="field">
|
18
|
+
<%= f.label :password %>
|
19
|
+
<%= f.password_field :password, autocomplete: "current-password" %>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<% if devise_mapping.rememberable? %>
|
23
|
+
<div class="field">
|
24
|
+
<div class="ui checkbox">
|
25
|
+
<%= f.check_box :remember_me, class: 'hidden', readonly: '', tabindex: '0' %>
|
26
|
+
<%= f.label :remember_me %>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
<div class="actions">
|
32
|
+
<%= f.submit "Log in", class: 'ui button' %>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<%= render "users/shared/links" %>
|
37
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if resource.errors.any? %>
|
2
|
+
<div class="ui negative message">
|
3
|
+
<div class="header">
|
4
|
+
<%= I18n.t("errors.messages.not_saved",
|
5
|
+
count: resource.errors.count,
|
6
|
+
resource: resource.class.model_name.human.downcase) %>
|
7
|
+
</div>
|
8
|
+
<ul>
|
9
|
+
<% resource.errors.full_messages.each do |message| %>
|
10
|
+
<li><%= message %></li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
2
|
+
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
+
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
10
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
18
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
23
|
+
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="ui container">
|
2
|
+
<div class="ui centered cards">
|
3
|
+
<div class="ui card">
|
4
|
+
<div class="image">
|
5
|
+
<img src="https://react.semantic-ui.com/images/avatar/large/matthew.png" />
|
6
|
+
</div>
|
7
|
+
<div class="content">
|
8
|
+
<div class="header">
|
9
|
+
<%= link_to current_user.email, edit_user_registration_url %>
|
10
|
+
</div>
|
11
|
+
<div class="meta"><span class="date">Joined in <%= current_user.created_at %></span></div>
|
12
|
+
<div class="description">id - <%= current_user.id %></div>
|
13
|
+
</div>
|
14
|
+
<div class="extra content">
|
15
|
+
<a>
|
16
|
+
<i aria-hidden="true" class="user icon"></i>
|
17
|
+
0 Invitees
|
18
|
+
</a>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2>Resend unlock instructions</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<div class="field">
|
7
|
+
<%= f.label :email %><br />
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="actions">
|
12
|
+
<%= f.submit "Resend unlock instructions" %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render "users/shared/links" %>
|