Merge pull request #1296 from JewelSam/master
#1040 Show email in public option
This commit is contained in:
commit
b725bde890
6 changed files with 18 additions and 4 deletions
|
|
@ -24,7 +24,7 @@ class RegistrationsController < Devise::RegistrationsController
|
||||||
def configure_permitted_parameters
|
def configure_permitted_parameters
|
||||||
devise_parameter_sanitizer.for(:account_update) do |u|
|
devise_parameter_sanitizer.for(:account_update) do |u|
|
||||||
u.
|
u.
|
||||||
permit(:email, :password, :password_confirmation, :current_password, :username)
|
permit(:email, :password, :password_confirmation, :current_password, :username, :email_public)
|
||||||
end
|
end
|
||||||
devise_parameter_sanitizer.for(:sign_up) do |u|
|
devise_parameter_sanitizer.for(:sign_up) do |u|
|
||||||
u.
|
u.
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
= 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 :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
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
%h3
|
%h3
|
||||||
by
|
by
|
||||||
= link_to @speaker.name, user_path(@speaker.id)
|
= link_to @speaker.name, user_path(@speaker.id)
|
||||||
= "(#{@speaker.email})"
|
= "(#{@speaker.email})" if @speaker.email_public
|
||||||
- if @speaker.affiliation?
|
- if @speaker.affiliation?
|
||||||
%br
|
%br
|
||||||
%span.muted
|
%span.muted
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
class ChangeEmailPublicFromUsers < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
change_column_default :users, :email_public, true
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
change_column_default :users, :email_public, nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20170129075434) do
|
ActiveRecord::Schema.define(version: 20170213145807) do
|
||||||
|
|
||||||
create_table "ahoy_events", force: :cascade do |t|
|
create_table "ahoy_events", force: :cascade do |t|
|
||||||
t.uuid "visit_id", limit: 16
|
t.uuid "visit_id", limit: 16
|
||||||
|
|
@ -482,7 +482,7 @@ ActiveRecord::Schema.define(version: 20170129075434) do
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.boolean "email_public"
|
t.boolean "email_public", default: true
|
||||||
t.text "biography"
|
t.text "biography"
|
||||||
t.string "nickname"
|
t.string "nickname"
|
||||||
t.string "affiliation"
|
t.string "affiliation"
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,8 @@ namespace :user do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Set email_public attrubute true for all users"
|
||||||
|
task :set_email_public => :environment do
|
||||||
|
User.update_all email_public: true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue