Add styling to passwords and confirmations
This commit is contained in:
parent
28143a8cce
commit
30831ce718
7 changed files with 72 additions and 25 deletions
|
|
@ -1,8 +1,10 @@
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
# Set resource_name for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposal#new)
|
||||||
def resource_name
|
def resource_name
|
||||||
:user
|
:user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Set devise_mapping for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposal#new)
|
||||||
def devise_mapping
|
def devise_mapping
|
||||||
@devise_mapping ||= Devise.mappings[:user]
|
@devise_mapping ||= Devise.mappings[:user]
|
||||||
end
|
end
|
||||||
|
|
|
||||||
14
app/views/devise/confirmations/new.html.haml
Normal file
14
app/views/devise/confirmations/new.html.haml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col-md-6.col-md-offset-3
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title
|
||||||
|
Resend confirmation instructions
|
||||||
|
.panel-body
|
||||||
|
= semantic_form_for(resource, as: resource_name, url: confirmation_path(resource_name), method: :post) do |f|
|
||||||
|
= f.input :email, input_html: { autofocus: true, required: true }
|
||||||
|
%p.text-right
|
||||||
|
= f.action :submit, as: :button, label: 'Submit', button_html: { class: 'btn btn-success' }
|
||||||
|
|
||||||
|
= render partial: 'devise/shared/help'
|
||||||
16
app/views/devise/passwords/edit.html.haml
Normal file
16
app/views/devise/passwords/edit.html.haml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col-md-6.col-md-offset-3
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title
|
||||||
|
Change your password
|
||||||
|
.panel-body
|
||||||
|
= semantic_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
|
||||||
|
= f.hidden_field :reset_password_token
|
||||||
|
= f.input :password, input_html: { autofocus: true, required: true, autocomplete: "off"}, label: 'New password'
|
||||||
|
= f.input :password_confirmation, input_html: { required: true, autocomplete: "off" }, label: 'New password confirmation'
|
||||||
|
%p.text-right
|
||||||
|
= f.action :submit, as: :button, label: 'Change my password', button_html: { class: 'btn btn-success' }
|
||||||
|
|
||||||
|
= render partial: 'devise/shared/help'
|
||||||
14
app/views/devise/passwords/new.html.haml
Normal file
14
app/views/devise/passwords/new.html.haml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col-md-6.col-md-offset-3
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title
|
||||||
|
Forgot your password?
|
||||||
|
.panel-body
|
||||||
|
= semantic_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
|
||||||
|
= f.input :email, input_html: { autofocus: true, required: true}
|
||||||
|
%p.text-right
|
||||||
|
= f.action :submit, as: :button, label: 'Send me reset password instructions', button_html: { class: 'btn btn-success' }
|
||||||
|
|
||||||
|
= render partial: 'devise/shared/help'
|
||||||
|
|
@ -7,13 +7,13 @@
|
||||||
Sign Up
|
Sign Up
|
||||||
.panel-body
|
.panel-body
|
||||||
= semantic_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
|
= semantic_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
|
||||||
= f.input :username, required: true
|
= f.input :username, input_html: { required: true }
|
||||||
= f.input :email
|
= f.input :email, input_html: { required: true }
|
||||||
= f.input :name, required: true
|
= f.input :name, input_html: { required: true }
|
||||||
= f.input :password
|
= f.input :password, input_html: { required: true }
|
||||||
= f.input :password_confirmation
|
= f.input :password_confirmation, input_html: { required: true }
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, as: :button, label: 'Sign Up', button_html: {class: 'btn btn-success' }
|
= f.action :submit, as: :button, label: 'Sign Up', button_html: { class: 'btn btn-success' }
|
||||||
|
|
||||||
= render partial: 'devise/shared/openid'
|
= render partial: 'devise/shared/openid'
|
||||||
= render partial: 'devise/shared/help'
|
= render partial: 'devise/shared/help'
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,19 @@
|
||||||
.row
|
.container
|
||||||
.col-md-6.col-md-offset-3
|
.row
|
||||||
.panel.panel-default
|
.col-md-6.col-md-offset-3
|
||||||
.panel-heading
|
.panel.panel-default
|
||||||
%h3.panel-title
|
.panel-heading
|
||||||
Sign In
|
%h3.panel-title
|
||||||
.panel-body
|
Sign In
|
||||||
= semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
.panel-body
|
||||||
= f.input :login
|
= semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
||||||
= f.input :password
|
= f.input :login
|
||||||
- if devise_mapping.rememberable?
|
= f.input :password
|
||||||
%p.text-right.small
|
- if devise_mapping.rememberable?
|
||||||
= f.label 'Remember me'
|
%p.text-right.small
|
||||||
= f.check_box :remember_me
|
= f.label 'Remember me'
|
||||||
%p.text-right
|
= f.check_box :remember_me
|
||||||
= f.action :submit, as: :button, label: 'Sign In', button_html: {class: 'btn btn-success'}
|
%p.text-right
|
||||||
= render partial: 'devise/shared/openid'
|
= f.action :submit, as: :button, label: 'Sign In', button_html: {class: 'btn btn-success'}
|
||||||
= render partial: 'devise/shared/help'
|
= render partial: 'devise/shared/openid'
|
||||||
|
= render partial: 'devise/shared/help'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
%p.text-right
|
%p.text-right
|
||||||
%a.small.btn.btn-default{"data-toggle" => "collapse", "data-target" => "#devise-help"}
|
%a.small.btn.btn-default.btn-xs{"data-toggle" => "collapse", "data-target" => "#devise-help"}
|
||||||
Need Help?
|
Need Help?
|
||||||
#devise-help.collapse
|
#devise-help.collapse
|
||||||
= render 'devise/shared/links'
|
= render 'devise/shared/links'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue