fixes conflicts with fork
This commit is contained in:
@@ -25,7 +25,7 @@ class AccountController < ApplicationController
|
||||
if @account.organization?
|
||||
params.require(:account).permit(:phone_number, :email_on_comment, :email_on_comment_reply, :newsletter, organization_attributes: [:name, :responsible_name])
|
||||
else
|
||||
params.require(:account).permit(:username, :public_activity, :email_on_comment, :email_on_comment_reply, :email_on_direct_message, :email_digest, :newsletter)
|
||||
params.require(:account).permit(:username, :public_activity, :email_on_comment, :email_on_comment_reply, :email_on_direct_message, :email_digest, :newsletter, :official_position_badge)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -87,6 +87,17 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= f.label :official_position_badge do %>
|
||||
<%= f.check_box :official_position_badge,
|
||||
title: t('account.show.official_position_badge_label'),
|
||||
label: false %>
|
||||
<span class="checkbox">
|
||||
<%= t("account.show.official_position_badge_label") %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.submit t("account.show.save_changes_submit"), class: "button" %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ en:
|
||||
subscription_to_website_newsletter_label: Receive by email website relevant information
|
||||
email_on_direct_message_label: Receive emails about direct messages
|
||||
email_digest_label: Receive a summary of proposal notifications
|
||||
official_position_badge_label: Show official position badge
|
||||
title: My account
|
||||
user_permission_debates: Participate on debates
|
||||
user_permission_info: With your account you can...
|
||||
|
||||
@@ -17,6 +17,7 @@ es:
|
||||
subscription_to_website_newsletter_label: Recibir emails con información interesante sobre la web
|
||||
email_on_direct_message_label: Recibir emails con mensajes privados
|
||||
email_digest_label: Recibir resumen de notificaciones sobre propuestas
|
||||
official_position_badge_label: Mostrar etiqueta de tipo de usuario
|
||||
title: Mi cuenta
|
||||
user_permission_debates: Participar en debates
|
||||
user_permission_info: Con tu cuenta ya puedes...
|
||||
|
||||
5
db/migrate/20160617172616_add_badge_to_users.rb
Normal file
5
db/migrate/20160617172616_add_badge_to_users.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddBadgeToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :official_position_badge, :boolean, default: false
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160614160949) do
|
||||
ActiveRecord::Schema.define(version: 20160617172616) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -462,6 +462,7 @@ ActiveRecord::Schema.define(version: 20160614160949) do
|
||||
t.boolean "email_on_proposal_notification", default: true
|
||||
t.boolean "email_digest", default: true
|
||||
t.boolean "email_on_direct_message", default: true
|
||||
t.boolean "official_position_badge", default: false
|
||||
end
|
||||
|
||||
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'
|
||||
uncheck 'account_email_digest'
|
||||
uncheck 'account_email_on_direct_message'
|
||||
check 'account_official_position_badge'
|
||||
click_button 'Save changes'
|
||||
|
||||
expect(page).to have_content "Changes saved"
|
||||
@@ -48,6 +49,7 @@ feature 'Account' do
|
||||
expect(find("#account_email_on_comment_reply")).to be_checked
|
||||
expect(find("#account_email_digest")).to_not be_checked
|
||||
expect(find("#account_email_on_direct_message")).to_not be_checked
|
||||
expect(find("#account_official_position_badge")).to be_checked
|
||||
end
|
||||
|
||||
scenario 'Edit Organization' do
|
||||
|
||||
@@ -95,6 +95,12 @@ describe User do
|
||||
expect(subject.email_on_direct_message).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'official_position_badge' do
|
||||
it 'should be false by default' do
|
||||
expect(subject.official_position_badge).to eq(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "administrator?" do
|
||||
|
||||
Reference in New Issue
Block a user