rebase against email settings changes

This commit is contained in:
Stella Rouzi 2015-10-29 14:03:34 +02:00 committed by Henne Vogelsang
parent 444356fbc7
commit feabbfbc99
5 changed files with 21 additions and 21 deletions

View file

@ -19,9 +19,9 @@ class Cfp < ActiveRecord::Base
def notify_on_cfp_date_update?
!self.end_date.blank? && !self.start_date.blank?\
&& (self.start_date_changed? || self.end_date_changed?)\
&& self.program.conference.email_settings.send_on_cfp_dates_updates\
&& !self.program.conference.email_settings.cfp_dates_updates_subject.blank?\
&& !self.program.conference.email_settings.cfp_dates_updates_template.blank?
&& self.program.conference.email_settings.send_on_cfp_dates_updated\
&& !self.program.conference.email_settings.cfp_dates_updated_subject.blank?\
&& !self.program.conference.email_settings.cfp_dates_updated_body.blank?
end
##

View file

@ -71,16 +71,16 @@
#cfp.tab-pane{:role => "tabpanel"}
= f.input :send_on_program_schedule_public, hint: "This will notify all participants when the dates are updated or when the schedule is made public"
= f.input :program_schedule_public_subject, hint: "This subject will used whenever dates are updated or when the schedule is made public"
= f.input :program_schedule_public_template, :input_html => { :rows => 10, :cols => 20 }
= f.input :program_schedule_public_body, :input_html => { :rows => 10, :cols => 20 }
%a.btn.btn-link.control_label.load_template{"data-template"=>"Dear {name},\n\nThe Conference Call for Papers Details of {conference} has changed.The schedule is being made public.\n Link to Schedule {schedule_link} \n\nBest wishes\n\n{conference} Team",
"data-name"=>"email_settings_program_schedule_public_template"} Load Template
"data-name"=>"email_settings_program_schedule_public_body"} Load Template
%a.btn.btn-link.control_label.template_help_link{"data-name"=>"updated_cfp_help"} Show Help
= render partial: 'help', locals: {id: 'updated_cfp_help', show_event_variables: false}
= f.input :send_on_cfp_dates_updated, hint: "This will notify all participants when the dates are updated or when the schedule is made public"
= f.input :cfp_dates_updated_subject, hint: "This subject will used whenever dates are updated or when the schedule is made public"
= f.input :cfp_dates_updated_template, :input_html => { :rows => 10, :cols => 20 }
= f.input :cfp_dates_updated_body, :input_html => { :rows => 10, :cols => 20 }
%a.btn.btn-link.control_label.load_template{"data-template"=>"Dear {name},\n\nThe Conference Call for Papers Details of {conference} has changed.\nNew Dates : {cfp_start_date} - {cfp_end_date}.\n Link to Schedule {schedule_link} \n\nBest wishes\n\n{conference} Team",
"data-name"=>"email_settings_cfp_dates_updates_template"} Load Template
"data-name"=>"email_settings_cfp_dates_updated_body"} Load Template
%a.btn.btn-link.control_label.template_help_link{"data-name"=>"updated_cfp_help"} Show Help
= render partial: 'help', locals: {id: 'updated_cfp_help', show_event_variables: false}
.row

View file

@ -1,10 +1,10 @@
class RenameEmailSettingsWithCfpAndProgram < ActiveRecord::Migration
def change
rename_column :email_settings, :send_on_call_for_papers_schedule_public, :send_on_program_schedule_public
rename_column :email_settings, :call_for_papers_schedule_public_body, :program_schedule_public_template
rename_column :email_settings, :call_for_papers_schedule_public_body, :program_schedule_public_body
rename_column :email_settings, :call_for_papers_schedule_public_subject, :program_schedule_public_subject
rename_column :email_settings, :send_on_call_for_papers_dates_updated, :send_on_cfp_dates_updates
rename_column :email_settings, :call_for_papers_dates_updated_subject, :cfp_dates_updates_subject
rename_column :email_settings, :call_for_papers_dates_updated_body, :cfp_dates_updates_template
rename_column :email_settings, :send_on_call_for_papers_dates_updated, :send_on_cfp_dates_updated
rename_column :email_settings, :call_for_papers_dates_updated_subject, :cfp_dates_updated_subject
rename_column :email_settings, :call_for_papers_dates_updated_body, :cfp_dates_updated_body
end
end

View file

@ -179,12 +179,12 @@ ActiveRecord::Schema.define(version: 20151021113015) do
t.boolean "send_on_venue_updated", default: false
t.string "venue_updated_subject"
t.text "venue_updated_body"
t.boolean "send_on_cfp_dates_updates", default: false
t.boolean "send_on_cfp_dates_updated", default: false
t.boolean "send_on_program_schedule_public", default: false
t.string "program_schedule_public_subject"
t.string "cfp_dates_updates_subject"
t.text "program_schedule_public_template"
t.text "cfp_dates_updates_template"
t.string "cfp_dates_updated_subject"
t.text "program_schedule_public_body"
t.text "cfp_dates_updated_body"
end
create_table "event_types", force: true do |t|

View file

@ -38,9 +38,9 @@ describe Cfp do
describe '#notify_on_cfp_date_update?' do
before :each do
email_settings = conference.email_settings
email_settings.send_on_cfp_dates_updates = true
email_settings.cfp_dates_updates_subject = 'subject'
email_settings.cfp_dates_updates_template = 'body text'
email_settings.send_on_cfp_dates_updated = true
email_settings.cfp_dates_updated_subject = 'subject'
email_settings.cfp_dates_updated_body = 'body text'
email_settings.save!
cfp.save!
@ -70,7 +70,7 @@ describe Cfp do
end
it 'when send_on_cfp_dates_updates is not set' do
conference.email_settings.send_on_cfp_dates_updates = false
conference.email_settings.send_on_cfp_dates_updated = false
conference.email_settings.save!
cfp.end_date = Date.today
@ -79,7 +79,7 @@ describe Cfp do
end
it 'when cfp_dates_updates_subject is not set' do
conference.email_settings.cfp_dates_updates_subject = ''
conference.email_settings.cfp_dates_updated_subject = ''
conference.email_settings.save!
cfp.end_date = Date.today
@ -88,7 +88,7 @@ describe Cfp do
end
it 'when cfp_dates_updates_template is not set' do
conference.email_settings.cfp_dates_updates_template = ''
conference.email_settings.cfp_dates_updated_body = ''
conference.email_settings.save!
cfp.end_date = Date.today