Merge acbc7df96a into e2a7e396a2
This commit is contained in:
commit
ea52b0622b
6 changed files with 12 additions and 13 deletions
|
|
@ -54,6 +54,7 @@ class User < ActiveRecord::Base
|
||||||
scope :admin, -> { where(is_admin: true) }
|
scope :admin, -> { where(is_admin: true) }
|
||||||
|
|
||||||
validates :email, presence: true
|
validates :email, presence: true
|
||||||
|
validates :password, :password_confirmation, presence: true, on: :create
|
||||||
|
|
||||||
validates :username,
|
validates :username,
|
||||||
uniqueness: {
|
uniqueness: {
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,8 @@
|
||||||
= f.input :url, as: :hidden, input_html: { value: @back_url }
|
= f.input :url, as: :hidden, input_html: { value: @back_url }
|
||||||
= f.input :context, as: :hidden, input_html: { value: @context }
|
= f.input :context, as: :hidden, input_html: { value: @context }
|
||||||
= f.input :proxypath, as: :hidden, input_html: { value: @proxypath }
|
= f.input :proxypath, as: :hidden, input_html: { value: @proxypath }
|
||||||
|
|
||||||
= f.input :username, input_html: { autofocus: true }
|
= f.input :username, input_html: { autofocus: true }
|
||||||
= f.input :password, as: :password
|
= f.input :password, as: :password
|
||||||
|
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, as: :button, label: 'Sign In', button_html: { class: 'btn btn-success' }
|
= f.action :submit, as: :button, label: 'Sign In', button_html: { class: 'btn btn-success' }
|
||||||
|
|
||||||
= render partial: 'devise/shared/help'
|
= render partial: 'devise/shared/help'
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,22 @@
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.page-header
|
.page-header
|
||||||
%h1 Edit your Account
|
%h1 Edit Your Account
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= semantic_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
|
= semantic_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
|
||||||
= f.input :username, required: false, input_html: { autocomplete: 'off' }
|
= f.input :username, required: false, input_html: { autocomplete: 'off' }
|
||||||
= f.input :email, required: false, input_html: { autocomplete: 'off' }
|
= f.input :email, required: false, input_html: { autocomplete: 'off' }
|
||||||
= f.input :email_public
|
= f.input :email_public, label: "Make my email public"
|
||||||
= f.input :password, hint: "(Leave blank if you don't want to change it)", input_html: { autocomplete: 'off' }
|
= f.input :password, hint: "(Leave blank if you don't want to change it)", input_html: { autocomplete: 'off' }
|
||||||
= f.input :password_confirmation, input_html: { autocomplete: 'off' }
|
= f.input :password_confirmation, input_html: { autocomplete: 'off' }
|
||||||
= f.inputs name: 'OpenID' do
|
= f.inputs name: 'OpenID' do
|
||||||
%h4
|
- if @openids.present?
|
||||||
Currently the following openIDs are associated with your account
|
%h4
|
||||||
- @openids.each do |openid|
|
Currently the following openIDs are associated with your account
|
||||||
%li= "#{openid.provider}:#{openid.email}"
|
- @openids.each do |openid|
|
||||||
%br
|
%li= "#{openid.provider}:#{openid.email}"
|
||||||
|
%br
|
||||||
%h4
|
%h4
|
||||||
To add an openID with a different email address to your account, sign in with your
|
To add an openID with a different email address to your account, sign in with your
|
||||||
openID while logged in to OSEM
|
openID while logged in to OSEM
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
= 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, input_html: { required: true }
|
= f.input :username, input_html: { required: true }
|
||||||
= f.input :email, input_html: { required: true }
|
= f.input :email, input_html: { required: true }
|
||||||
= f.input :name, input_html: { required: true }
|
= f.input :name
|
||||||
= f.input :password, input_html: { required: true }
|
= f.input :password, input_html: { required: true }
|
||||||
= f.input :password_confirmation, input_html: { required: true }
|
= f.input :password_confirmation, input_html: { required: true }
|
||||||
%p.text-right
|
%p.text-right
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
Sign In
|
Sign In
|
||||||
.panel-body
|
.panel-body
|
||||||
= semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
= semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
||||||
= f.input :login
|
= f.input :login, label: "Username / Email"
|
||||||
= f.input :password
|
= f.input :password
|
||||||
- if devise_mapping.rememberable?
|
- if devise_mapping.rememberable?
|
||||||
%p.text-right.small
|
%p.text-right.small
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
.control-label
|
.control-label
|
||||||
= "Avatar"
|
= "Avatar"
|
||||||
= image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '')
|
= image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '')
|
||||||
= link_to 'Change your avatar here', 'https://gravatar.com'
|
= link_to 'Change your avatar here', 'https://gravatar.com', target: :_blank
|
||||||
= f.input :affiliation, as: :string,
|
= f.input :affiliation, as: :string,
|
||||||
hint: 'This could be a company, a user group, or nothing at all.'
|
hint: 'This could be a company, a user group, or nothing at all.'
|
||||||
= f.input :biography, input_html: { rows: 5, data: { provide: 'markdown-editable' } },
|
= f.input :biography, input_html: { rows: 5, data: { provide: 'markdown-editable' } },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue