adds option to receive direct messages
This commit is contained in:
@@ -25,7 +25,7 @@ class AccountController < ApplicationController
|
|||||||
if @account.organization?
|
if @account.organization?
|
||||||
params.require(:account).permit(:phone_number, :email_on_comment, :email_on_comment_reply, :newsletter, organization_attributes: [:name, :responsible_name])
|
params.require(:account).permit(:phone_number, :email_on_comment, :email_on_comment_reply, :newsletter, organization_attributes: [:name, :responsible_name])
|
||||||
else
|
else
|
||||||
params.require(:account).permit(:username, :public_activity, :email_on_comment, :email_on_comment_reply, :email_on_proposal_notification, :email_digest, :newsletter)
|
params.require(:account).permit(:username, :public_activity, :email_on_comment, :email_on_comment_reply, :email_on_proposal_notification, :email_on_direct_message, :email_digest, :newsletter)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,15 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<%= f.label :email_on_direct_message do %>
|
||||||
|
<%= f.check_box :email_on_direct_message, title: t('account.show.email_on_direct_message_label'), label: false %>
|
||||||
|
<span class="checkbox">
|
||||||
|
<%= t("account.show.email_on_direct_message_label") %>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= f.submit t("account.show.save_changes_submit"), class: "button" %>
|
<%= f.submit t("account.show.save_changes_submit"), class: "button" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ en:
|
|||||||
save_changes_submit: Save changes
|
save_changes_submit: Save changes
|
||||||
subscription_to_website_newsletter_label: Receive by email website relevant information
|
subscription_to_website_newsletter_label: Receive by email website relevant information
|
||||||
email_on_proposal_notification_label: Receive by email notifications about proposals
|
email_on_proposal_notification_label: Receive by email notifications about proposals
|
||||||
|
email_on_direct_message_label: Receive emails about direct messages
|
||||||
email_digest_label: Receive a summary of proposal notifications
|
email_digest_label: Receive a summary of proposal notifications
|
||||||
title: My account
|
title: My account
|
||||||
user_permission_debates: Participate on debates
|
user_permission_debates: Participate on debates
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ es:
|
|||||||
save_changes_submit: Guardar cambios
|
save_changes_submit: Guardar cambios
|
||||||
subscription_to_website_newsletter_label: Recibir emails con información interesante sobre la web
|
subscription_to_website_newsletter_label: Recibir emails con información interesante sobre la web
|
||||||
email_on_proposal_notification_label: Recibir emails con notificaciones sobre propuestas
|
email_on_proposal_notification_label: Recibir emails con notificaciones sobre propuestas
|
||||||
|
email_on_direct_message_label: Recibir emails con mensajes directos
|
||||||
email_digest_label: Recibir resumen de notificaciones sobre propuestas
|
email_digest_label: Recibir resumen de notificaciones sobre propuestas
|
||||||
title: Mi cuenta
|
title: Mi cuenta
|
||||||
user_permission_debates: Participar en debates
|
user_permission_debates: Participar en debates
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
class AddEmailOnDirectMessagesToUsers < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :users, :email_on_direct_message, :boolean, default: true
|
||||||
|
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: 20160613150659) do
|
ActiveRecord::Schema.define(version: 20160614160949) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
@@ -461,6 +461,7 @@ ActiveRecord::Schema.define(version: 20160613150659) do
|
|||||||
t.datetime "date_of_birth"
|
t.datetime "date_of_birth"
|
||||||
t.boolean "email_on_proposal_notification", default: true
|
t.boolean "email_on_proposal_notification", default: true
|
||||||
t.boolean "email_digest", default: true
|
t.boolean "email_digest", default: true
|
||||||
|
t.boolean "email_on_direct_message", default: true
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
|
add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ feature 'Account' do
|
|||||||
check 'account_email_on_comment_reply'
|
check 'account_email_on_comment_reply'
|
||||||
uncheck 'account_email_on_proposal_notification'
|
uncheck 'account_email_on_proposal_notification'
|
||||||
uncheck 'account_email_digest'
|
uncheck 'account_email_digest'
|
||||||
|
uncheck 'account_email_on_direct_message'
|
||||||
click_button 'Save changes'
|
click_button 'Save changes'
|
||||||
|
|
||||||
expect(page).to have_content "Changes saved"
|
expect(page).to have_content "Changes saved"
|
||||||
@@ -47,6 +48,7 @@ feature 'Account' do
|
|||||||
expect(find("#account_email_on_comment")).to be_checked
|
expect(find("#account_email_on_comment")).to be_checked
|
||||||
expect(find("#account_email_on_comment_reply")).to be_checked
|
expect(find("#account_email_on_comment_reply")).to be_checked
|
||||||
expect(find("#account_email_digest")).to_not be_checked
|
expect(find("#account_email_digest")).to_not be_checked
|
||||||
|
expect(find("#account_email_on_direct_message")).to_not be_checked
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Edit Organization' do
|
scenario 'Edit Organization' do
|
||||||
|
|||||||
@@ -95,6 +95,12 @@ describe User do
|
|||||||
expect(subject.email_digest).to eq(true)
|
expect(subject.email_digest).to eq(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'email_on_direct_message' do
|
||||||
|
it 'should be true by default' do
|
||||||
|
expect(subject.email_on_direct_message).to eq(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "administrator?" do
|
describe "administrator?" do
|
||||||
|
|||||||
Reference in New Issue
Block a user