nippo_core 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +37 -0
- data/app/assets/config/nippo_core_manifest.js +2 -0
- data/app/assets/javascripts/nippo_core/application.js +13 -0
- data/app/assets/stylesheets/nippo_core/application.css +15 -0
- data/app/controllers/nippo_core/application_controller.rb +5 -0
- data/app/controllers/nippo_core/groups_controller.rb +26 -0
- data/app/controllers/nippo_core/home_controller.rb +6 -0
- data/app/controllers/nippo_core/reports_controller.rb +39 -0
- data/app/controllers/nippo_core/users/confirmations_controller.rb +28 -0
- data/app/controllers/nippo_core/users/omniauth_callbacks_controller.rb +28 -0
- data/app/controllers/nippo_core/users/passwords_controller.rb +32 -0
- data/app/controllers/nippo_core/users/registrations_controller.rb +60 -0
- data/app/controllers/nippo_core/users/sessions_controller.rb +25 -0
- data/app/controllers/nippo_core/users/unlocks_controller.rb +28 -0
- data/app/decorators/nippo_core/report_decorator.rb +21 -0
- data/app/helpers/nippo_core/application_helper.rb +4 -0
- data/app/jobs/nippo_core/application_job.rb +4 -0
- data/app/mailers/nippo_core/application_mailer.rb +6 -0
- data/app/models/nippo_core/application_record.rb +5 -0
- data/app/models/nippo_core/group.rb +9 -0
- data/app/models/nippo_core/report.rb +11 -0
- data/app/models/nippo_core/user.rb +15 -0
- data/app/views/layouts/nippo_core/application.slim +10 -0
- data/app/views/nippo_core/groups/new.slim +8 -0
- data/app/views/nippo_core/home/index.slim +2 -0
- data/app/views/nippo_core/reports/index.slim +4 -0
- data/app/views/nippo_core/reports/new.slim +8 -0
- data/app/views/nippo_core/reports/show.slim +4 -0
- data/app/views/nippo_core/users/confirmations/new.slim +11 -0
- data/app/views/nippo_core/users/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/nippo_core/users/mailer/email_changed.html.erb +7 -0
- data/app/views/nippo_core/users/mailer/password_change.html.erb +3 -0
- data/app/views/nippo_core/users/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/nippo_core/users/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/nippo_core/users/passwords/edit.slim +22 -0
- data/app/views/nippo_core/users/passwords/new.slim +11 -0
- data/app/views/nippo_core/users/registrations/edit.slim +42 -0
- data/app/views/nippo_core/users/registrations/new.slim +32 -0
- data/app/views/nippo_core/users/sessions/new.slim +18 -0
- data/app/views/nippo_core/users/shared/_links.slim +19 -0
- data/app/views/nippo_core/users/unlocks/new.slim +11 -0
- data/config/initializers/devise.rb +277 -0
- data/config/locales/devise.en.yml +64 -0
- data/config/routes.rb +7 -0
- data/db/migrate/20170420094814_devise_create_nippo_core_users.rb +45 -0
- data/db/migrate/20170420102455_create_nippo_core_groups.rb +12 -0
- data/db/migrate/20170420110055_create_nippo_core_reports.rb +14 -0
- data/lib/nippo_core/engine.rb +10 -0
- data/lib/nippo_core/version.rb +3 -0
- data/lib/nippo_core.rb +5 -0
- data/lib/tasks/nippo_core_tasks.rake +4 -0
- metadata +223 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a0aa1b3448f7789130ad93f6ac442789127212ad
|
4
|
+
data.tar.gz: 6fbf71e01497eb263b368f55a6bdc4728dba0ae1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ae01bc7c0e318937bdfdf0f5046b6590633093dcc9c895debeeb5e7adcb046908db40983bccfc9191463a0579d98db67128d3111b3c53384ac4dccd5c1f3ff27
|
7
|
+
data.tar.gz: c38d24ced09548ef912ae67c74d1a2749fab46ec93bc7c814cf8363f5b1ff3d561764da8017424d8c491c9011e6690b4f308b817c5e9f7b9d0bff2f4eceb760b
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2017 TODO: Write your name
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# NippoCore
|
2
|
+
日報システム **(製作中)**
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
メインのシステムにマウントしてください
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'nippo_core'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install nippo_core
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'NippoCore'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
require 'bundler/gem_tasks'
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.libs << 'test'
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
task default: :test
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module NippoCore
|
2
|
+
class GroupsController < ApplicationController
|
3
|
+
before_action :authenticate_user!
|
4
|
+
before_action :initialize_group, only: [:new, :create]
|
5
|
+
|
6
|
+
def new
|
7
|
+
end
|
8
|
+
|
9
|
+
def create
|
10
|
+
if @group.save
|
11
|
+
redirect_to root_path
|
12
|
+
else
|
13
|
+
render 'new', status: 400
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
def initialize_group
|
19
|
+
@group = NippoCore::Group.new(group_params.merge(creator: current_user))
|
20
|
+
end
|
21
|
+
|
22
|
+
def group_params
|
23
|
+
params.fetch(:group, {}).permit(:name, :description)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module NippoCore
|
2
|
+
class ReportsController < ApplicationController
|
3
|
+
before_action :authenticate_user!
|
4
|
+
before_action :find_group
|
5
|
+
before_action :initialize_report, except: :index
|
6
|
+
|
7
|
+
def index
|
8
|
+
@reports = @group.reports
|
9
|
+
end
|
10
|
+
|
11
|
+
def show
|
12
|
+
end
|
13
|
+
|
14
|
+
def new
|
15
|
+
end
|
16
|
+
|
17
|
+
def create
|
18
|
+
if @report.save
|
19
|
+
redirect_to group_reports_path(group_id: @group.id)
|
20
|
+
else
|
21
|
+
render 'new', status: 400
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
def find_group
|
27
|
+
@group = NippoCore::Group.find(params[:group_id])
|
28
|
+
end
|
29
|
+
|
30
|
+
def initialize_report
|
31
|
+
# TODO: selectable reported_at
|
32
|
+
@report = @group.reports.find_by(id: params[:id]) || @group.reports.new(report_params.merge(reported_at: Date.today, user: current_user))
|
33
|
+
end
|
34
|
+
|
35
|
+
def report_params
|
36
|
+
params.fetch(:report, {}).permit(:body)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class NippoCore::Users::ConfirmationsController < Devise::ConfirmationsController
|
2
|
+
# GET /resource/confirmation/new
|
3
|
+
# def new
|
4
|
+
# super
|
5
|
+
# end
|
6
|
+
|
7
|
+
# POST /resource/confirmation
|
8
|
+
# def create
|
9
|
+
# super
|
10
|
+
# end
|
11
|
+
|
12
|
+
# GET /resource/confirmation?confirmation_token=abcdef
|
13
|
+
# def show
|
14
|
+
# super
|
15
|
+
# end
|
16
|
+
|
17
|
+
# protected
|
18
|
+
|
19
|
+
# The path used after resending confirmation instructions.
|
20
|
+
# def after_resending_confirmation_instructions_path_for(resource_name)
|
21
|
+
# super(resource_name)
|
22
|
+
# end
|
23
|
+
|
24
|
+
# The path used after confirmation.
|
25
|
+
# def after_confirmation_path_for(resource_name, resource)
|
26
|
+
# super(resource_name, resource)
|
27
|
+
# end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class NippoCore::Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
2
|
+
# You should configure your model like this:
|
3
|
+
# devise :omniauthable, omniauth_providers: [:twitter]
|
4
|
+
|
5
|
+
# You should also create an action method in this controller like this:
|
6
|
+
# def twitter
|
7
|
+
# end
|
8
|
+
|
9
|
+
# More info at:
|
10
|
+
# https://github.com/plataformatec/devise#omniauth
|
11
|
+
|
12
|
+
# GET|POST /resource/auth/twitter
|
13
|
+
# def passthru
|
14
|
+
# super
|
15
|
+
# end
|
16
|
+
|
17
|
+
# GET|POST /users/auth/twitter/callback
|
18
|
+
# def failure
|
19
|
+
# super
|
20
|
+
# end
|
21
|
+
|
22
|
+
# protected
|
23
|
+
|
24
|
+
# The path used when OmniAuth fails
|
25
|
+
# def after_omniauth_failure_path_for(scope)
|
26
|
+
# super(scope)
|
27
|
+
# end
|
28
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class NippoCore::Users::PasswordsController < Devise::PasswordsController
|
2
|
+
# GET /resource/password/new
|
3
|
+
# def new
|
4
|
+
# super
|
5
|
+
# end
|
6
|
+
|
7
|
+
# POST /resource/password
|
8
|
+
# def create
|
9
|
+
# super
|
10
|
+
# end
|
11
|
+
|
12
|
+
# GET /resource/password/edit?reset_password_token=abcdef
|
13
|
+
# def edit
|
14
|
+
# super
|
15
|
+
# end
|
16
|
+
|
17
|
+
# PUT /resource/password
|
18
|
+
# def update
|
19
|
+
# super
|
20
|
+
# end
|
21
|
+
|
22
|
+
# protected
|
23
|
+
|
24
|
+
# def after_resetting_password_path_for(resource)
|
25
|
+
# super(resource)
|
26
|
+
# end
|
27
|
+
|
28
|
+
# The path used after sending reset password instructions
|
29
|
+
# def after_sending_reset_password_instructions_path_for(resource_name)
|
30
|
+
# super(resource_name)
|
31
|
+
# end
|
32
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
class NippoCore::Users::RegistrationsController < Devise::RegistrationsController
|
2
|
+
before_action :configure_sign_up_params, only: [:create]
|
3
|
+
# before_action :configure_account_update_params, only: [:update]
|
4
|
+
|
5
|
+
# GET /resource/sign_up
|
6
|
+
# def new
|
7
|
+
# super
|
8
|
+
# end
|
9
|
+
|
10
|
+
# POST /resource
|
11
|
+
# def create
|
12
|
+
# super
|
13
|
+
# end
|
14
|
+
|
15
|
+
# GET /resource/edit
|
16
|
+
# def edit
|
17
|
+
# super
|
18
|
+
# end
|
19
|
+
|
20
|
+
# PUT /resource
|
21
|
+
# def update
|
22
|
+
# super
|
23
|
+
# end
|
24
|
+
|
25
|
+
# DELETE /resource
|
26
|
+
# def destroy
|
27
|
+
# super
|
28
|
+
# end
|
29
|
+
|
30
|
+
# GET /resource/cancel
|
31
|
+
# Forces the session data which is usually expired after sign
|
32
|
+
# in to be expired now. This is useful if the user wants to
|
33
|
+
# cancel oauth signing in/up in the middle of the process,
|
34
|
+
# removing all OAuth session data.
|
35
|
+
# def cancel
|
36
|
+
# super
|
37
|
+
# end
|
38
|
+
|
39
|
+
# protected
|
40
|
+
|
41
|
+
# If you have extra params to permit, append them to the sanitizer.
|
42
|
+
def configure_sign_up_params
|
43
|
+
devise_parameter_sanitizer.permit(:sign_up, keys: [:last_name, :first_name, :nickname])
|
44
|
+
end
|
45
|
+
|
46
|
+
# If you have extra params to permit, append them to the sanitizer.
|
47
|
+
# def configure_account_update_params
|
48
|
+
# devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
|
49
|
+
# end
|
50
|
+
|
51
|
+
# The path used after sign up.
|
52
|
+
# def after_sign_up_path_for(resource)
|
53
|
+
# super(resource)
|
54
|
+
# end
|
55
|
+
|
56
|
+
# The path used after sign up for inactive accounts.
|
57
|
+
# def after_inactive_sign_up_path_for(resource)
|
58
|
+
# super(resource)
|
59
|
+
# end
|
60
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class NippoCore::Users::SessionsController < Devise::SessionsController
|
2
|
+
# before_action :configure_sign_in_params, only: [:create]
|
3
|
+
|
4
|
+
# GET /resource/sign_in
|
5
|
+
# def new
|
6
|
+
# super
|
7
|
+
# end
|
8
|
+
|
9
|
+
# POST /resource/sign_in
|
10
|
+
# def create
|
11
|
+
# super
|
12
|
+
# end
|
13
|
+
|
14
|
+
# DELETE /resource/sign_out
|
15
|
+
# def destroy
|
16
|
+
# super
|
17
|
+
# end
|
18
|
+
|
19
|
+
# protected
|
20
|
+
|
21
|
+
# If you have extra params to permit, append them to the sanitizer.
|
22
|
+
# def configure_sign_in_params
|
23
|
+
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
|
24
|
+
# end
|
25
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class NippoCore::Users::UnlocksController < Devise::UnlocksController
|
2
|
+
# GET /resource/unlock/new
|
3
|
+
# def new
|
4
|
+
# super
|
5
|
+
# end
|
6
|
+
|
7
|
+
# POST /resource/unlock
|
8
|
+
# def create
|
9
|
+
# super
|
10
|
+
# end
|
11
|
+
|
12
|
+
# GET /resource/unlock?unlock_token=abcdef
|
13
|
+
# def show
|
14
|
+
# super
|
15
|
+
# end
|
16
|
+
|
17
|
+
# protected
|
18
|
+
|
19
|
+
# The path used after sending unlock password instructions
|
20
|
+
# def after_sending_unlock_instructions_path_for(resource)
|
21
|
+
# super(resource)
|
22
|
+
# end
|
23
|
+
|
24
|
+
# The path used after unlocking the resource
|
25
|
+
# def after_unlock_path_for(resource)
|
26
|
+
# super(resource)
|
27
|
+
# end
|
28
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module NippoCore
|
2
|
+
module ReportDecorator
|
3
|
+
def title
|
4
|
+
"#{reported_at} #{user.nickname}"
|
5
|
+
end
|
6
|
+
|
7
|
+
def markdowned_body
|
8
|
+
options = {
|
9
|
+
autolink: true,
|
10
|
+
space_after_headers: true,
|
11
|
+
fenced_code_blocks: true,
|
12
|
+
tables: true,
|
13
|
+
hard_wrap: true,
|
14
|
+
strikethrough: true,
|
15
|
+
filter_html: true
|
16
|
+
}
|
17
|
+
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, options)
|
18
|
+
markdown.render(body)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module NippoCore
|
2
|
+
class User < ApplicationRecord
|
3
|
+
# Include default devise modules. Others available are:
|
4
|
+
# :confirmable, :lockable, :timeoutable and :omniauthable
|
5
|
+
devise :database_authenticatable, :registerable,
|
6
|
+
:recoverable, :rememberable, :trackable, :validatable
|
7
|
+
|
8
|
+
has_many :created_groups, class_name: 'NippoCore::Group', foreign_key: 'creator_id', dependent: :destroy
|
9
|
+
has_many :reports, dependent: :destroy
|
10
|
+
|
11
|
+
validates :last_name, presence: true
|
12
|
+
validates :first_name, presence: true
|
13
|
+
validates :nickname, presence: true
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
h2
|
2
|
+
| Resend confirmation instructions
|
3
|
+
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
|
4
|
+
= devise_error_messages!
|
5
|
+
.field
|
6
|
+
= f.label :email
|
7
|
+
br
|
8
|
+
= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email)
|
9
|
+
.actions
|
10
|
+
= f.submit "Resend confirmation instructions"
|
11
|
+
= render "nippo_core/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 %>
|
@@ -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,22 @@
|
|
1
|
+
h2
|
2
|
+
| Change your password
|
3
|
+
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
|
4
|
+
= devise_error_messages!
|
5
|
+
= f.hidden_field :reset_password_token
|
6
|
+
.field
|
7
|
+
= f.label :password, "New password"
|
8
|
+
br
|
9
|
+
- if @minimum_password_length
|
10
|
+
em
|
11
|
+
| (
|
12
|
+
= @minimum_password_length
|
13
|
+
| characters minimum)
|
14
|
+
br
|
15
|
+
= f.password_field :password, autofocus: true, autocomplete: "off"
|
16
|
+
.field
|
17
|
+
= f.label :password_confirmation, "Confirm new password"
|
18
|
+
br
|
19
|
+
= f.password_field :password_confirmation, autocomplete: "off"
|
20
|
+
.actions
|
21
|
+
= f.submit "Change my password"
|
22
|
+
= render "nippo_core/users/shared/links"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
h2
|
2
|
+
| Forgot your password?
|
3
|
+
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
|
4
|
+
= devise_error_messages!
|
5
|
+
.field
|
6
|
+
= f.label :email
|
7
|
+
br
|
8
|
+
= f.email_field :email, autofocus: true
|
9
|
+
.actions
|
10
|
+
= f.submit "Send me reset password instructions"
|
11
|
+
= render "nippo_core/users/shared/links"
|