Load template loads subject

This commit is contained in:
desantonop 2016-10-06 18:48:02 +03:00
parent 274fd25e30
commit 0ab6a79713
2 changed files with 6 additions and 2 deletions

View file

@ -45,7 +45,10 @@ $(function () {
$(".load_template").on('click', function () {
var template = $(this).data('template');
var textarea_name = $(this).data('name');
var subject_template = $(this).data('subject-template');
var subject_input_id = $(this).data('subject-name');
$('#' + textarea_name).val(template);
$('#' + subject_input_id).val(subject_template);
});
/**

View file

@ -20,8 +20,9 @@
= f.input :send_on_registration, label: "Send an email when the user registers for the conference?", :input_html => {"data-name"=>"email_settings_registration_subject", "class"=>"send_on_radio"}
= f.input :registration_subject
= f.input :registration_body, :input_html => { :rows => 10, :cols => 20}
%a.btn.btn-link.control_label.load_template{"data-template"=>"Dear {name},\n\nThank you for Registering for the conference {conference}.\nPlease complete your registration by filling out your travel information.\n\nIf you are unable to attend please unregister online:\n{registrationlink}\n\nFeel free to contact us with any questions or concerns.\nWe look forward to see you there.\n\nBest wishes\n\n{conference} Team",
"data-name"=>"email_settings_registration_body"} Load Template
%a.btn.btn-link.control_label.load_template{ "data-template"=>"Dear {name},\n\nThank you for Registering for the conference {conference}.\nPlease complete your registration by filling out your travel information.\n\nIf you are unable to attend please unregister online:\n{registrationlink}\n\nFeel free to contact us with any questions or concerns.\nWe look forward to see you there.\n\nBest wishes\n\n{conference} Team",
"data-name"=>"email_settings_registration_body", 'data-subject-template' => 'Thank you for registering', 'data-subject-name' => 'email_settings_registration_subject' } Load Template
%a.btn.btn-link.control_label.template_help_link{"data-name"=>"registration_help"} Show Help
= render partial: 'help', locals: {id: 'registration_help', show_event_variables: false}
#proposal.tab-pane{:role => "tabpanel"}