diff --git a/app/assets/javascripts/osem.js b/app/assets/javascripts/osem.js index e6a99815..c4c8356a 100644 --- a/app/assets/javascripts/osem.js +++ b/app/assets/javascripts/osem.js @@ -175,8 +175,7 @@ $( document ).ready(function() { $("#submission-minimum-word-count").text(min); word_count($('#event_abstract').get(0), 'abstract-count', max); word_count($('#event_submission_text').get(0), 'submission-count', max); - }) - .trigger('change'); + }).trigger('change'); /* Count the proposal abstract length */ $("#event_abstract").bind('change keyup paste input', function() { @@ -193,7 +192,7 @@ $( document ).ready(function() { }); /* Listen for reset template button, wait for confirm, and reset. */ - $('#sub_text_reset').click((e) => { + $('.js-resetSubmissionText').click((e) => { let $selected = $("#event_event_type_id option:selected"); let $this = $(e.target); let affirm = confirm($this.data('confirm')); diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 9b7b9951..5ec2bf58 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -68,7 +68,7 @@ module EventsHelper data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length, - help: type.submission_instructions + instructions: type.submission_instructions } ] end diff --git a/app/views/proposals/_proposal_form.html.haml b/app/views/proposals/_proposal_form.html.haml index dfbcdadd..8d16f9a9 100644 --- a/app/views/proposals/_proposal_form.html.haml +++ b/app/views/proposals/_proposal_form.html.haml @@ -25,7 +25,7 @@ %span{ class: 'help-block select-help-text collapse event_difficulty_level_id', id: "#{difficulty_level.id}-help" } = difficulty_level.description - = render 'submission_type_content_form', f: f, program: @program + = render 'proposals/submission_type_content_form', f: f, program: @program - if @program.cfp&.enable_registrations? = f.inputs 'Enable pre-registration' do diff --git a/app/views/proposals/_submission_type_content_form.haml b/app/views/proposals/_submission_type_content_form.haml index fcdd4539..a61726d6 100644 --- a/app/views/proposals/_submission_type_content_form.haml +++ b/app/views/proposals/_submission_type_content_form.haml @@ -56,7 +56,7 @@ .panel-body = markdown(event_type.submission_instructions) .panel-footer - %button.btn.btn-warning.btn-xs{ type: 'button', id: 'sub_text_reset', data: { confirm: 'Do you really want to reset your submission text to the provided template?' } } + %button.btn.btn-warning.btn-xs.js-resetSubmissionText{ type: 'button', data: { confirm: 'Do you really want to reset your submission text to the provided template?' } } Reset Submission to Template %span.small You may want to use this if you have changed the submission type. diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 46af8793..5a2a6097 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -206,7 +206,7 @@ feature Event do fill_in 'event_submission_text', with: 'Lorem ipsum example submission text' accept_confirm do - click_button 'Reset to Template' + click_button 'Reset Submission to Template' end expect(page.find('#event_submission_text').value).to eq(event_type.submisson_instructions)