mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
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
|
||||
# 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
|
||||
:user
|
||||
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
|
||||
@devise_mapping ||= Devise.mappings[:user]
|
||||
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
|
||||
.panel-body
|
||||
= semantic_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
|
||||
= f.input :username, required: true
|
||||
= f.input :email
|
||||
= f.input :name, required: true
|
||||
= f.input :password
|
||||
= f.input :password_confirmation
|
||||
= f.input :username, input_html: { required: true }
|
||||
= f.input :email, input_html: { required: true }
|
||||
= f.input :name, input_html: { required: true }
|
||||
= f.input :password, input_html: { required: true }
|
||||
= f.input :password_confirmation, input_html: { required: true }
|
||||
%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/help'
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
.row
|
||||
.col-md-6.col-md-offset-3
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title
|
||||
Sign In
|
||||
.panel-body
|
||||
= semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
||||
= f.input :login
|
||||
= f.input :password
|
||||
- if devise_mapping.rememberable?
|
||||
%p.text-right.small
|
||||
= f.label 'Remember me'
|
||||
= f.check_box :remember_me
|
||||
%p.text-right
|
||||
= f.action :submit, as: :button, label: 'Sign In', button_html: {class: 'btn btn-success'}
|
||||
= render partial: 'devise/shared/openid'
|
||||
= render partial: 'devise/shared/help'
|
||||
.container
|
||||
.row
|
||||
.col-md-6.col-md-offset-3
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title
|
||||
Sign In
|
||||
.panel-body
|
||||
= semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
||||
= f.input :login
|
||||
= f.input :password
|
||||
- if devise_mapping.rememberable?
|
||||
%p.text-right.small
|
||||
= f.label 'Remember me'
|
||||
= f.check_box :remember_me
|
||||
%p.text-right
|
||||
= f.action :submit, as: :button, label: 'Sign In', button_html: {class: 'btn btn-success'}
|
||||
= render partial: 'devise/shared/openid'
|
||||
= render partial: 'devise/shared/help'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
%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?
|
||||
#devise-help.collapse
|
||||
= render 'devise/shared/links'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue