diff options
-rw-r--r-- | app/assets/stylesheets/userdata/layout.scss | 21 | ||||
-rw-r--r-- | app/controllers/users/passwords_controller.rb | 1 | ||||
-rw-r--r-- | app/views/devise/passwords/edit.html.erb | 25 | ||||
-rw-r--r-- | app/views/devise/passwords/new.html.erb | 16 | ||||
-rw-r--r-- | app/views/users/passwords/edit.html.haml | 16 | ||||
-rw-r--r-- | app/views/users/passwords/new.html.haml | 11 | ||||
-rw-r--r-- | config/routes.rb | 6 |
7 files changed, 51 insertions, 45 deletions
diff --git a/app/assets/stylesheets/userdata/layout.scss b/app/assets/stylesheets/userdata/layout.scss index 9e4906e..6b99d46 100644 --- a/app/assets/stylesheets/userdata/layout.scss +++ b/app/assets/stylesheets/userdata/layout.scss | |||
@@ -27,7 +27,7 @@ body { | |||
27 | } | 27 | } |
28 | } | 28 | } |
29 | 29 | ||
30 | input[type=text], input[type=password] { | 30 | input[type=text], input[type=password], input[type=email] { |
31 | font-size: 24px; | 31 | font-size: 24px; |
32 | padding: 3px; | 32 | padding: 3px; |
33 | width: 100%; | 33 | width: 100%; |
@@ -69,7 +69,7 @@ body { | |||
69 | font-size: .75em; | 69 | font-size: .75em; |
70 | } | 70 | } |
71 | 71 | ||
72 | #flash { | 72 | #flash, #error_explanation li { |
73 | color: black; | 73 | color: black; |
74 | background-color: white; | 74 | background-color: white; |
75 | padding: .75em; | 75 | padding: .75em; |
@@ -80,7 +80,7 @@ body { | |||
80 | box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75); | 80 | box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.75); |
81 | } | 81 | } |
82 | 82 | ||
83 | .flash-alert { | 83 | .flash-alert, #error_explanation li { |
84 | border-left: 5px solid red; | 84 | border-left: 5px solid red; |
85 | } | 85 | } |
86 | 86 | ||
@@ -91,3 +91,18 @@ body { | |||
91 | .flash-tag { | 91 | .flash-tag { |
92 | font-weight: bold; | 92 | font-weight: bold; |
93 | } | 93 | } |
94 | |||
95 | #error_explanation { | ||
96 | h2 { | ||
97 | display: none; | ||
98 | } | ||
99 | |||
100 | ul { | ||
101 | margin-top: 0; | ||
102 | padding: 0; | ||
103 | } | ||
104 | |||
105 | li { | ||
106 | list-style-type: none; | ||
107 | } | ||
108 | } | ||
diff --git a/app/controllers/users/passwords_controller.rb b/app/controllers/users/passwords_controller.rb index 53cc34e..56ef149 100644 --- a/app/controllers/users/passwords_controller.rb +++ b/app/controllers/users/passwords_controller.rb | |||
@@ -1,4 +1,5 @@ | |||
1 | class Users::PasswordsController < Devise::PasswordsController | 1 | class Users::PasswordsController < Devise::PasswordsController |
2 | layout "userdata" | ||
2 | # GET /resource/password/new | 3 | # GET /resource/password/new |
3 | # def new | 4 | # def new |
4 | # super | 5 | # super |
diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb deleted file mode 100644 index 6a796b0..0000000 --- a/app/views/devise/passwords/edit.html.erb +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
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 | <%= devise_error_messages! %> | ||
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: "off" %> | ||
13 | </div> | ||
14 | |||
15 | <div class="field"> | ||
16 | <%= f.label :password_confirmation, "Confirm new password" %><br /> | ||
17 | <%= f.password_field :password_confirmation, autocomplete: "off" %> | ||
18 | </div> | ||
19 | |||
20 | <div class="actions"> | ||
21 | <%= f.submit "Change my password" %> | ||
22 | </div> | ||
23 | <% end %> | ||
24 | |||
25 | <%= render "devise/shared/links" %> | ||
diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb deleted file mode 100644 index 3d6d11a..0000000 --- a/app/views/devise/passwords/new.html.erb +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | <h2>Forgot your password?</h2> | ||
2 | |||
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> | ||
4 | <%= devise_error_messages! %> | ||
5 | |||
6 | <div class="field"> | ||
7 | <%= f.label :email %><br /> | ||
8 | <%= f.email_field :email, autofocus: true %> | ||
9 | </div> | ||
10 | |||
11 | <div class="actions"> | ||
12 | <%= f.submit "Send me reset password instructions" %> | ||
13 | </div> | ||
14 | <% end %> | ||
15 | |||
16 | <%= render "devise/shared/links" %> | ||
diff --git a/app/views/users/passwords/edit.html.haml b/app/views/users/passwords/edit.html.haml new file mode 100644 index 0000000..3d2d9ee --- /dev/null +++ b/app/views/users/passwords/edit.html.haml | |||
@@ -0,0 +1,16 @@ | |||
1 | %h2 Change your password | ||
2 | = devise_error_messages! | ||
3 | #principal | ||
4 | = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| | ||
5 | = f.hidden_field :reset_password_token | ||
6 | .field | ||
7 | = f.label :password, "New password" | ||
8 | - if @minimum_password_length | ||
9 | %em= "(#{@minimum_password_length} characters minimum)" | ||
10 | = f.password_field :password, autofocus: true, autocomplete: "off" | ||
11 | .field | ||
12 | = f.label :password_confirmation, "Confirm new password" | ||
13 | = f.password_field :password_confirmation, autocomplete: "off" | ||
14 | .submit-field | ||
15 | = f.submit "Change my password" | ||
16 | .navigation= link_to "← Back to thoughts", root_url | ||
diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml new file mode 100644 index 0000000..03d3854 --- /dev/null +++ b/app/views/users/passwords/new.html.haml | |||
@@ -0,0 +1,11 @@ | |||
1 | %h2 Forgot your password? | ||
2 | = devise_error_messages! | ||
3 | #principal | ||
4 | = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| | ||
5 | .field | ||
6 | = f.label :email | ||
7 | = f.email_field :email, autofocus: true | ||
8 | .submit-field | ||
9 | = f.submit "Submit" | ||
10 | .navigation= link_to "Log in", new_session_path(resource_name) | ||
11 | .navigation= link_to "← Back to thoughts", root_url | ||
diff --git a/config/routes.rb b/config/routes.rb index 449cda1..1003a8b 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
@@ -6,7 +6,11 @@ Rails.application.routes.draw do | |||
6 | end | 6 | end |
7 | 7 | ||
8 | mount Ckeditor::Engine => '/ckeditor' | 8 | mount Ckeditor::Engine => '/ckeditor' |
9 | devise_for :users, controllers: { sessions: 'users/sessions' } | 9 | |
10 | devise_for :users, controllers: { | ||
11 | sessions: 'users/sessions', | ||
12 | passwords: 'users/passwords' | ||
13 | } | ||
10 | 14 | ||
11 | root "records#index" | 15 | root "records#index" |
12 | 16 | ||