From 1bb80c8108bd5a066d00a84ace1c00a41532736e Mon Sep 17 00:00:00 2001 From: desantonop Date: Mon, 10 Oct 2016 18:54:06 +0300 Subject: [PATCH] Change variable names in admin/emails#index to more descriptive ones. Geia soy Stella :* --- app/assets/javascripts/osem.js | 12 ++++++------ app/views/admin/emails/index.html.haml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/osem.js b/app/assets/javascripts/osem.js index 8b594823..eae08d41 100644 --- a/app/assets/javascripts/osem.js +++ b/app/assets/javascripts/osem.js @@ -43,12 +43,12 @@ $(function () { * Adds the default template as value to the regarding email textarea field. */ $(".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); + var subject_input_id = $(this).data('subject-input-id'); + var subject_input_text = $(this).data('subject-text'); + var body_input_id = $(this).data('body-input-id'); + var body_input_text = $(this).data('body-text'); + $('#' + subject_input_id).val(subject_input_text); + $('#' + body_input_id).val(body_input_text); }); /** diff --git a/app/views/admin/emails/index.html.haml b/app/views/admin/emails/index.html.haml index abc8b117..d3ca5b46 100644 --- a/app/views/admin/emails/index.html.haml +++ b/app/views/admin/emails/index.html.haml @@ -20,8 +20,8 @@ = 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", 'data-subject-template' => 'Thank you for registering', 'data-subject-name' => 'email_settings_registration_subject' } Load Template + %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_registration_subject', 'data-subject-text' => 'Thank you for registering', "data-body-input-id"=>"email_settings_registration_body", "data-body-text"=>"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" + } 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}