From feabbfbc99da7e30d0a7e19295590388b6476482 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Thu, 29 Oct 2015 14:03:34 +0200 Subject: [PATCH] rebase against email settings changes --- app/models/cfp.rb | 6 +++--- app/views/admin/emails/index.html.haml | 8 ++++---- ...015_rename_email_settings_with_cfp_and_program.rb | 8 ++++---- db/schema.rb | 8 ++++---- spec/models/cfp_spec.rb | 12 ++++++------ 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/models/cfp.rb b/app/models/cfp.rb index 46366794..35b2e561 100644 --- a/app/models/cfp.rb +++ b/app/models/cfp.rb @@ -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 ## diff --git a/app/views/admin/emails/index.html.haml b/app/views/admin/emails/index.html.haml index 006d2720..fa5010d1 100644 --- a/app/views/admin/emails/index.html.haml +++ b/app/views/admin/emails/index.html.haml @@ -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 diff --git a/db/migrate/20151021113015_rename_email_settings_with_cfp_and_program.rb b/db/migrate/20151021113015_rename_email_settings_with_cfp_and_program.rb index f29eee9c..ca2978ca 100644 --- a/db/migrate/20151021113015_rename_email_settings_with_cfp_and_program.rb +++ b/db/migrate/20151021113015_rename_email_settings_with_cfp_and_program.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index e591ddda..d78f384f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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| diff --git a/spec/models/cfp_spec.rb b/spec/models/cfp_spec.rb index f71f7cbe..3f8e7a0f 100644 --- a/spec/models/cfp_spec.rb +++ b/spec/models/cfp_spec.rb @@ -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