Merge pull request #639 from differentreality/devise_partials
Move common views to partial
This commit is contained in:
commit
0013a3a814
19 changed files with 180 additions and 138 deletions
|
|
@ -14,8 +14,16 @@ class ConferenceRegistrationsController < ApplicationController
|
||||||
redirect_to root_path, alert: 'You need to sign in or sign up before continuing.'
|
redirect_to root_path, alert: 'You need to sign in or sign up before continuing.'
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# avoid openid sign_in to redirect to register/new when the sign_in user had already a registration
|
||||||
|
if current_user && @conference.user_registered?(current_user)
|
||||||
|
redirect_to edit_conference_conference_registrations_path(@conference.short_title)
|
||||||
|
end
|
||||||
|
|
||||||
@registration = Registration.new
|
@registration = Registration.new
|
||||||
@registration.build_user
|
|
||||||
|
# @user variable needs to be set so that _sign_up_form_embedded works properly
|
||||||
|
@user = @registration.build_user
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
@ -27,9 +35,16 @@ class ConferenceRegistrationsController < ApplicationController
|
||||||
def edit; end
|
def edit; end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@registration = Registration.new(registration_params)
|
@registration = @conference.registrations.new(registration_params)
|
||||||
@registration.conference = @conference
|
|
||||||
@registration.user = current_user if current_user
|
if current_user.nil?
|
||||||
|
# @user variable needs to be set so that _sign_up_form_embedded works properly
|
||||||
|
@user = @registration.build_user(user_params)
|
||||||
|
else
|
||||||
|
@user = current_user
|
||||||
|
end
|
||||||
|
|
||||||
|
@registration.user = @user
|
||||||
|
|
||||||
if @registration.save
|
if @registration.save
|
||||||
# Trigger ahoy event
|
# Trigger ahoy event
|
||||||
|
|
@ -47,7 +62,7 @@ class ConferenceRegistrationsController < ApplicationController
|
||||||
redirect_to conference_conference_registrations_path(@conference.short_title)
|
redirect_to conference_conference_registrations_path(@conference.short_title)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
flash[:error] = "An error prohibited the registration for #{@conference.title}: "\
|
flash[:error] = "Could not create your registration for #{@conference.title}: "\
|
||||||
"#{@registration.errors.full_messages.join('. ')}."
|
"#{@registration.errors.full_messages.join('. ')}."
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
|
|
@ -58,7 +73,7 @@ class ConferenceRegistrationsController < ApplicationController
|
||||||
redirect_to conference_conference_registrations_path(@conference.short_title),
|
redirect_to conference_conference_registrations_path(@conference.short_title),
|
||||||
notice: 'Registration was successfully updated.'
|
notice: 'Registration was successfully updated.'
|
||||||
else
|
else
|
||||||
flash[:error] = "An error prohibited the registration for #{@conference.title}: "\
|
flash[:error] = "Could not update your registration for #{@conference.title}: "\
|
||||||
"#{@registration.errors.full_messages.join('. ')}."
|
"#{@registration.errors.full_messages.join('. ')}."
|
||||||
render :edit
|
render :edit
|
||||||
end
|
end
|
||||||
|
|
@ -70,7 +85,7 @@ class ConferenceRegistrationsController < ApplicationController
|
||||||
notice: "You are not registered for #{@conference.title} anymore!"
|
notice: "You are not registered for #{@conference.title} anymore!"
|
||||||
else
|
else
|
||||||
redirect_to root_path,
|
redirect_to root_path,
|
||||||
error: "An error prohibited deleting the registration for #{@conference.title}: "\
|
error: "Could not update your registration for #{@conference.title}: "\
|
||||||
"#{@registration.errors.full_messages.join('. ')}."
|
"#{@registration.errors.full_messages.join('. ')}."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -85,6 +100,10 @@ class ConferenceRegistrationsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_params
|
||||||
|
params.require(:user).permit(:username, :email, :name, :password, :password_confirmation)
|
||||||
|
end
|
||||||
|
|
||||||
def registration_params
|
def registration_params
|
||||||
params.require(:registration).
|
params.require(:registration).
|
||||||
permit(
|
permit(
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,14 @@
|
||||||
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
|
||||||
|
: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
|
||||||
|
|
||||||
def pluralize_without_count(count, noun, text = nil)
|
def pluralize_without_count(count, noun, text = nil)
|
||||||
if count != 0
|
if count != 0
|
||||||
count == 1 ? "#{noun}#{text}" : "#{noun.pluralize}#{text}"
|
count == 1 ? "#{noun}#{text}" : "#{noun.pluralize}#{text}"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
class Registration < ActiveRecord::Base
|
class Registration < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
validates :user, presence: true
|
|
||||||
accepts_nested_attributes_for :user
|
|
||||||
belongs_to :conference
|
belongs_to :conference
|
||||||
belongs_to :dietary_choice
|
belongs_to :dietary_choice
|
||||||
|
|
||||||
|
|
@ -29,6 +27,8 @@ class Registration < ActiveRecord::Base
|
||||||
|
|
||||||
alias_attribute :other_needs, :other_special_needs
|
alias_attribute :other_needs, :other_special_needs
|
||||||
|
|
||||||
|
validates :user, presence: true
|
||||||
|
|
||||||
validates_uniqueness_of :user_id, scope: :conference_id, message: 'already Registered!'
|
validates_uniqueness_of :user_id, scope: :conference_id, message: 'already Registered!'
|
||||||
|
|
||||||
after_create :set_week, :subscribe_to_conference, :send_registration_mail
|
after_create :set_week, :subscribe_to_conference, :send_registration_mail
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,8 @@
|
||||||
.tab-content
|
.tab-content
|
||||||
.tab-pane.active{role: 'tabpanel', id: 'signup'}
|
.tab-pane.active{role: 'tabpanel', id: 'signup'}
|
||||||
= semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f|
|
= semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f|
|
||||||
- if !current_user
|
= render partial: 'devise/shared/sign_up_form_embedded'
|
||||||
= f.fields_for :user do |u|
|
|
||||||
= render partial: 'devise/shared/sign_up_fields', locals: { u: u}
|
|
||||||
- if @conference.questions.any?
|
- if @conference.questions.any?
|
||||||
= render partial: 'questions', locals: { f: f }
|
= render partial: 'questions', locals: { f: f }
|
||||||
- if @conference.events.workshops.any?
|
- if @conference.events.workshops.any?
|
||||||
|
|
@ -38,29 +37,4 @@
|
||||||
- else
|
- else
|
||||||
=f.action :submit, button_html: { value: 'Register', class: 'btn btn-primary', id: 'register' }
|
=f.action :submit, button_html: { value: 'Register', class: 'btn btn-primary', id: 'register' }
|
||||||
.tab-pane{role: 'tabpanel', id: 'signin'}
|
.tab-pane{role: 'tabpanel', id: 'signin'}
|
||||||
- if !CONFIG['authentication']['ichain']['enabled']
|
= render partial: 'devise/shared/sign_in_form_embedded'
|
||||||
= 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
|
|
||||||
- unless omniauth_configured.empty?
|
|
||||||
.form-group
|
|
||||||
%hr
|
|
||||||
%p.text-center
|
|
||||||
or sign in using
|
|
||||||
.text-center
|
|
||||||
= render 'devise/shared/openid'
|
|
||||||
|
|
|
||||||
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'
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
openID while logged in to OSEM
|
openID while logged in to OSEM
|
||||||
- if User.omniauth_providers.present?
|
- if User.omniauth_providers.present?
|
||||||
#openidlinks
|
#openidlinks
|
||||||
= render 'devise/shared/openid'
|
= render 'devise/shared/openid_links'
|
||||||
= f.inputs name: 'Confirmation' do
|
= f.inputs name: 'Confirmation' do
|
||||||
= f.input :current_password, input_html: {autocomplete: 'off'},
|
= f.input :current_password, input_html: {autocomplete: 'off'},
|
||||||
hint: '(we need your current password to confirm password, email or username changes)'
|
hint: '(we need your current password to confirm password, email or username changes)'
|
||||||
|
|
|
||||||
|
|
@ -7,24 +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|
|
||||||
= render partial: 'devise/shared/sign_up_fields', locals: { u: f}
|
= 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
|
%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' }
|
||||||
- unless omniauth_configured.empty?
|
|
||||||
.row
|
= render partial: 'devise/shared/openid'
|
||||||
.col-md-4
|
= render partial: 'devise/shared/help'
|
||||||
%hr
|
|
||||||
.col-md-4
|
|
||||||
%h4.text-center
|
|
||||||
or sign up using
|
|
||||||
.col-md-4
|
|
||||||
%hr
|
|
||||||
.row
|
|
||||||
.col-md-12
|
|
||||||
#openidlinks
|
|
||||||
= render 'devise/shared/openid'
|
|
||||||
%p.text-right
|
|
||||||
%a.small{"data-toggle" => "collapse", "data-target" => "#devise-help"}
|
|
||||||
Need Help?
|
|
||||||
#devise-help.collapse
|
|
||||||
= render 'devise/shared/links'
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +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
|
||||||
- unless omniauth_configured.empty?
|
= f.action :submit, as: :button, label: 'Sign In', button_html: {class: 'btn btn-success'}
|
||||||
.row
|
= render partial: 'devise/shared/openid'
|
||||||
.col-md-4
|
= render partial: 'devise/shared/help'
|
||||||
%hr
|
|
||||||
.col-md-4
|
|
||||||
%h4.text-center
|
|
||||||
or sign in using
|
|
||||||
.col-md-4
|
|
||||||
%hr
|
|
||||||
.row
|
|
||||||
.col-md-12
|
|
||||||
#openidlinks
|
|
||||||
= render 'devise/shared/openid'
|
|
||||||
%p.text-right
|
|
||||||
%a.small{"data-toggle" => "collapse", "data-target" => "#devise-help"}
|
|
||||||
Need Help?
|
|
||||||
#devise-help.collapse
|
|
||||||
= render 'devise/shared/links'
|
|
||||||
|
|
|
||||||
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.btn-xs{"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)
|
= link_to "Forgot your password?", new_password_path(resource_name)
|
||||||
%br
|
%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)
|
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
|
||||||
%br
|
%br
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
.btn-group.btn-group-lg
|
- unless omniauth_configured.empty?
|
||||||
- omniauth_configured.each do |provider|
|
.row
|
||||||
= link_to user_omniauth_authorize_path(provider),
|
.col-md-4
|
||||||
class: "btn btn-success btn-lg",
|
%hr
|
||||||
id: "omniauth-#{provider}",
|
.col-md-4
|
||||||
title: "Your #{provider} login" do
|
%h4.text-center
|
||||||
%i{:class => "fa fa-#{provider}"}
|
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'
|
||||||
|
|
@ -60,11 +60,12 @@
|
||||||
.divider
|
.divider
|
||||||
%h6.text-center
|
%h6.text-center
|
||||||
or
|
or
|
||||||
= render 'devise/shared/openid'
|
= render 'devise/shared/openid_links'
|
||||||
%p.text-right
|
%p.text-right
|
||||||
%a.small{"data-toggle" => "collapse", "data-target" => "#navbar-devise-help"}
|
%br
|
||||||
|
%a.small.btn.btn-xs.btn-default{"data-toggle" => "collapse", "data-target" => "#navbar-devise-help"}
|
||||||
Need Help?
|
Need Help?
|
||||||
#navbar-devise-help.collapse
|
#navbar-devise-help.collapse
|
||||||
= link_to "Forgot your password?", new_password_path(User.new)
|
= render 'devise/shared/links'
|
||||||
%li.hidden-lg
|
%li.hidden-lg
|
||||||
= link_to('Sign In', new_user_session_path)
|
= link_to('Sign In', new_user_session_path)
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,8 @@
|
||||||
|
|
||||||
= semantic_form_for(@event, url: @url) do |f|
|
= semantic_form_for(@event, url: @url) do |f|
|
||||||
|
|
||||||
- unless current_user
|
= render partial: 'devise/shared/sign_up_form_embedded'
|
||||||
= semantic_fields_for @user do |u|
|
|
||||||
= render partial: 'devise/shared/sign_up_fields', locals: { u: u }
|
|
||||||
= f.inputs name: 'Proposal Information' do
|
= f.inputs name: 'Proposal Information' do
|
||||||
= f.input :title, as: :string, required: true
|
= f.input :title, as: :string, required: true
|
||||||
= f.input :event_type_id, as: :select,
|
= f.input :event_type_id, as: :select,
|
||||||
|
|
@ -64,30 +63,4 @@
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}, label: 'Create Proposal'
|
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}, label: 'Create Proposal'
|
||||||
.tab-pane{role: 'tabpanel', id: 'signin'}
|
.tab-pane{role: 'tabpanel', id: 'signin'}
|
||||||
- if !CONFIG['authentication']['ichain']['enabled']
|
= render partial: 'devise/shared/sign_in_form_embedded'
|
||||||
= 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
|
|
||||||
- unless omniauth_configured.empty?
|
|
||||||
.form-group
|
|
||||||
%hr
|
|
||||||
%p.text-center
|
|
||||||
or sign in using
|
|
||||||
.text-center
|
|
||||||
= render 'devise/shared/openid'
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue