Move common views to partial
This commit is contained in:
parent
b15c1abd2e
commit
969c24c091
16 changed files with 101 additions and 120 deletions
5
app/views/devise/shared/_help.html.haml
Normal file
5
app/views/devise/shared/_help.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%p.text-right
|
||||
%a.small.btn.btn-default{"data-toggle" => "collapse", "data-target" => "#devise-help"}
|
||||
Need Help?
|
||||
#devise-help.collapse
|
||||
= render 'devise/shared/links'
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
= link_to "Forgot your password?", new_password_path(resource_name)
|
||||
%br
|
||||
|
||||
- if devise_mapping.confirmable? && controller_name != 'confirmations' && controller_name == 'passwords'
|
||||
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
||||
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
|
||||
%br
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
.btn-group.btn-group-lg
|
||||
- omniauth_configured.each do |provider|
|
||||
= link_to user_omniauth_authorize_path(provider),
|
||||
class: "btn btn-success btn-lg",
|
||||
id: "omniauth-#{provider}",
|
||||
title: "Your #{provider} login" do
|
||||
%i{:class => "fa fa-#{provider}"}
|
||||
- unless omniauth_configured.empty?
|
||||
.row
|
||||
.col-md-4
|
||||
%hr
|
||||
.col-md-4
|
||||
%h4.text-center
|
||||
or sign in using
|
||||
.col-md-4
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
#openidlinks
|
||||
= render partial: 'devise/shared/openid_links'
|
||||
|
|
|
|||
7
app/views/devise/shared/_openid_links.html.haml
Normal file
7
app/views/devise/shared/_openid_links.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
.text-center
|
||||
.btn-group.btn-group-lg
|
||||
- omniauth_configured.each do |provider|
|
||||
= link_to user_omniauth_authorize_path(provider), class: "btn btn-success btn-lg",
|
||||
id: "omniauth-#{provider}",
|
||||
title: "Your #{provider} login" do
|
||||
%i{:class => "fa fa-#{provider}"}
|
||||
25
app/views/devise/shared/_sign_in_form_embedded.html.haml
Normal file
25
app/views/devise/shared/_sign_in_form_embedded.html.haml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
- if !CONFIG['authentication']['ichain']['enabled']
|
||||
= form_tag(new_user_session_path, class: 'form-horizontal') do
|
||||
%legend
|
||||
%span
|
||||
Sign In
|
||||
.form-group
|
||||
%label{for: "user[login]", class: 'col-sm-2 control-label'}
|
||||
Username
|
||||
.col-sm-10
|
||||
= text_field_tag 'user[login]', nil, placeholder: 'Username', class: 'form-control', required: 'required'
|
||||
.form-group
|
||||
%label{for: "user[password]", class: 'col-sm-2 control-label'}
|
||||
Password
|
||||
.col-sm-10
|
||||
= password_field_tag 'user[password]', nil, placeholder: 'Password', class: 'form-control', required: 'required'
|
||||
.form-group
|
||||
.col-sm-12
|
||||
%button.btn.btn-success.pull-right
|
||||
Sign in
|
||||
= render partial: 'devise/shared/openid'
|
||||
%p.text-right
|
||||
%a.small.btn.btn-default{"data-toggle" => "collapse", "data-target" => "#devise-help-sign-in"}
|
||||
Need Help?
|
||||
#devise-help-sign-in.collapse
|
||||
= render partial: 'devise/shared/links'
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
= u.input :username, input_html: {required: 'required', autocomplete: 'off'}
|
||||
= u.input :email, input_html: {required: 'required', autocomplete: 'off'}
|
||||
= u.input :password, input_html: {required: 'required', autocomplete: 'off', id: 'password_inline'}
|
||||
= u.input :password_confirmation, :required => true, input_html: {required: 'required', autocomplete: 'off'}
|
||||
8
app/views/devise/shared/_sign_up_form_embedded.html.haml
Normal file
8
app/views/devise/shared/_sign_up_form_embedded.html.haml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
- unless current_user
|
||||
= semantic_fields_for @user do |u|
|
||||
= u.input :username, input_html: { required: 'required', autocomplete: 'off' }
|
||||
= u.input :email, input_html: { required: 'required', autocomplete: 'off' }
|
||||
= u.input :password, input_html: { required: 'required', autocomplete: 'off', id: 'password_inline' }
|
||||
= u.input :password_confirmation, input_html: { required: 'required', autocomplete: 'off' }
|
||||
= render partial: 'devise/shared/openid'
|
||||
= render partial: 'devise/shared/help'
|
||||
Loading…
Add table
Add a link
Reference in a new issue