fe 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +4 -4
- data/app/assets/config/fe/manifest.js +3 -0
- data/app/assets/config/manifest.js +3 -0
- data/app/assets/javascripts/application.js.erb +1 -1
- data/app/assets/javascripts/fe/admin.js +0 -1
- data/app/assets/javascripts/fe/fe.admin.js +2 -6
- data/app/assets/javascripts/fe/{fe.common.js → fe.common.js.erb} +14 -7
- data/app/assets/javascripts/fe/fe.public.js +1 -2
- data/app/assets/javascripts/fe/{fe.public.nojquery.js → fe.public.nojquery.js.erb} +152 -76
- data/app/assets/javascripts/fe/jquery.html5_upload.js +258 -0
- data/app/assets/stylesheets/fe/fe.screen.css.scss.erb +22 -1
- data/app/assets/stylesheets/fe/validation.css +5 -1
- data/app/controllers/{fe/concerns → concerns/fe}/admin/question_sheets_controller_concern.rb +15 -16
- data/app/controllers/concerns/fe/answer_pages_controller_concern.rb +131 -0
- data/app/controllers/{fe/concerns → concerns/fe}/answer_sheets_controller_concern.rb +14 -6
- data/app/controllers/{fe/concerns → concerns/fe}/application_controller_concern.rb +3 -3
- data/app/controllers/fe/admin/elements_controller.rb +46 -24
- data/app/controllers/fe/admin/email_templates_controller.rb +5 -5
- data/app/controllers/fe/admin/question_pages_controller.rb +8 -8
- data/app/controllers/fe/reference_pages_controller.rb +11 -11
- data/app/controllers/fe/reference_sheets_controller.rb +4 -4
- data/app/controllers/fe/references_controller.rb +19 -19
- data/app/controllers/fe/submit_pages_controller.rb +5 -5
- data/app/helpers/fe/answer_pages_helper.rb +1 -1
- data/app/helpers/fe/application_helper.rb +3 -3
- data/app/jobs/fe/update_reference_sheet_visibility_job.rb +11 -0
- data/app/mailers/fe/notifier.rb +4 -4
- data/app/models/answer_sheet.rb +1 -1
- data/app/models/application_record.rb +3 -0
- data/app/models/{fe/concerns → concerns/fe}/answer_concern.rb +2 -2
- data/app/models/{fe/concerns → concerns/fe}/answer_pages_presenter_concern.rb +6 -5
- data/app/models/concerns/fe/answer_sheet_concern.rb +125 -0
- data/app/models/{fe/concerns → concerns/fe}/choice_field_concern.rb +41 -23
- data/app/models/fe/address.rb +2 -2
- data/app/models/fe/answer.rb +1 -1
- data/app/models/fe/answer_sheet.rb +1 -1
- data/app/models/fe/answer_sheet_question_sheet.rb +2 -2
- data/app/models/fe/application.rb +14 -10
- data/app/models/fe/condition.rb +4 -4
- data/app/models/fe/date_field.rb +1 -1
- data/app/models/fe/element.rb +126 -44
- data/app/models/fe/email_address.rb +2 -2
- data/app/models/fe/email_template.rb +1 -1
- data/app/models/fe/page.rb +94 -19
- data/app/models/fe/page_element.rb +2 -2
- data/app/models/fe/paragraph.rb +1 -1
- data/app/models/fe/person.rb +5 -5
- data/app/models/fe/phone_number.rb +1 -1
- data/app/models/fe/question.rb +62 -38
- data/app/models/fe/question_grid.rb +15 -3
- data/app/models/fe/question_set.rb +53 -13
- data/app/models/fe/question_sheet.rb +49 -16
- data/app/models/fe/reference_question.rb +9 -3
- data/app/models/fe/reference_sheet.rb +102 -47
- data/app/models/fe/state_chooser.rb +2 -2
- data/app/models/fe/text_field.rb +2 -2
- data/app/models/fe/user.rb +1 -1
- data/app/models/staff.rb +6 -6
- data/app/views/fe/admin/elements/create.js.erb +3 -3
- data/app/views/fe/admin/elements/destroy.js.erb +1 -1
- data/app/views/fe/admin/elements/drop.js.erb +1 -1
- data/app/views/fe/admin/elements/duplicate.js.erb +1 -1
- data/app/views/fe/admin/elements/edit.js.erb +1 -1
- data/app/views/fe/admin/elements/error.js.erb +1 -1
- data/app/views/fe/admin/elements/new.js.erb +13 -6
- data/app/views/fe/admin/elements/update.js.erb +1 -1
- data/app/views/fe/admin/email_templates/_form.html.erb +3 -3
- data/app/views/fe/admin/email_templates/edit.html.erb +3 -3
- data/app/views/fe/admin/email_templates/index.html.erb +3 -3
- data/app/views/fe/admin/email_templates/new.html.erb +3 -3
- data/app/views/fe/admin/panels/_advanced_options.html.erb +8 -8
- data/app/views/fe/admin/panels/_common_boolean_fields.html.erb +1 -0
- data/app/views/fe/admin/panels/_common_boolean_fields_default.html.erb +11 -0
- data/app/views/fe/admin/panels/_common_fields.html.erb +2 -17
- data/app/views/fe/admin/panels/_condition.html.erb +1 -1
- data/app/views/fe/admin/panels/_insert.html.erb +25 -25
- data/app/views/fe/admin/panels/_nav_controls.html.erb +4 -4
- data/app/views/fe/admin/panels/_page.html.erb +1 -1
- data/app/views/fe/admin/panels/_pages_list.html.erb +3 -3
- data/app/views/fe/admin/panels/_prop_attachment_field.html.erb +2 -2
- data/app/views/fe/admin/panels/_prop_choice_field.html.erb +36 -17
- data/app/views/fe/admin/panels/_prop_date_field.html.erb +1 -1
- data/app/views/fe/admin/panels/_prop_element.html.erb +5 -5
- data/app/views/fe/admin/panels/_prop_page.html.erb +3 -3
- data/app/views/fe/admin/panels/_prop_paragraph.html.erb +8 -8
- data/app/views/fe/admin/panels/_prop_question_grid.html.erb +7 -2
- data/app/views/fe/admin/panels/_prop_question_grid_with_total.html.erb +2 -2
- data/app/views/fe/admin/panels/_prop_reference_question.html.erb +3 -3
- data/app/views/fe/admin/panels/_prop_section.html.erb +1 -1
- data/app/views/fe/admin/panels/_prop_sheet.html.erb +3 -3
- data/app/views/fe/admin/panels/_prop_text_field.html.erb +12 -12
- data/app/views/fe/admin/question_pages/_element.html.erb +7 -7
- data/app/views/fe/admin/question_pages/_element_show.html.erb +2 -2
- data/app/views/fe/admin/question_pages/_question_page.html.erb +4 -4
- data/app/views/fe/admin/question_pages/create.js.erb +3 -3
- data/app/views/fe/admin/question_pages/destroy.js.erb +3 -3
- data/app/views/fe/admin/question_pages/edit.js.erb +1 -1
- data/app/views/fe/admin/question_pages/error.js.erb +1 -1
- data/app/views/fe/admin/question_pages/show.js.erb +2 -2
- data/app/views/fe/admin/question_pages/show_panel.js.erb +1 -1
- data/app/views/fe/admin/question_pages/update.js.erb +1 -1
- data/app/views/fe/admin/question_sheets/edit.js.erb +1 -1
- data/app/views/fe/admin/question_sheets/error.js.erb +1 -1
- data/app/views/fe/admin/question_sheets/index.html.erb +8 -8
- data/app/views/fe/admin/question_sheets/new.html.erb +3 -3
- data/app/views/fe/admin/question_sheets/show.html.erb +5 -5
- data/app/views/fe/admin/question_sheets/update.js.erb +1 -1
- data/app/views/fe/answer_pages/_answer_page.html.erb +13 -14
- data/app/views/fe/answer_pages/_element.html.erb +22 -2
- data/app/views/fe/answer_pages/_page_name.html.erb +1 -1
- data/app/views/fe/answer_pages/show.html.erb +39 -0
- data/app/views/fe/answer_pages/update.js.erb +10 -2
- data/app/views/fe/answer_sheets/_answer_sheet.html.erb +4 -4
- data/app/views/fe/answer_sheets/_element.html.erb +9 -7
- data/app/views/fe/answer_sheets/_incomplete.html.erb +1 -1
- data/app/views/fe/answer_sheets/_page_link.html.erb +9 -7
- data/app/views/fe/answer_sheets/_pages_list.html.erb +3 -3
- data/app/views/fe/answer_sheets/_submit_to.html.erb +1 -1
- data/app/views/fe/answer_sheets/_title.html.erb +1 -1
- data/app/views/fe/answer_sheets/edit.html.erb +18 -18
- data/app/views/fe/answer_sheets/incomplete.js.erb +7 -4
- data/app/views/fe/answer_sheets/index.html.erb +1 -1
- data/app/views/fe/answer_sheets/show.html.erb +1 -1
- data/app/views/fe/applications/_logout.html.erb +1 -1
- data/app/views/fe/questions/fe/_acceptance.html.erb +10 -9
- data/app/views/fe/questions/fe/_attachment_field.html.erb +129 -10
- data/app/views/fe/questions/fe/_checkbox_field.html.erb +18 -16
- data/app/views/fe/questions/fe/_country.html.erb +6 -6
- data/app/views/fe/questions/fe/_date_field.html.erb +5 -4
- data/app/views/fe/questions/fe/_date_field_mmyy.html.erb +8 -8
- data/app/views/fe/questions/fe/_drop_down_field.html.erb +5 -5
- data/app/views/fe/questions/fe/_question_grid.html.erb +10 -10
- data/app/views/fe/questions/fe/_question_grid_with_total.html.erb +8 -8
- data/app/views/fe/questions/fe/_questions.html.erb +11 -5
- data/app/views/fe/questions/fe/_radio_button_field.html.erb +35 -19
- data/app/views/fe/questions/fe/_rating.html.erb +56 -18
- data/app/views/fe/questions/fe/_reference_discipler.html.erb +1 -1
- data/app/views/fe/questions/fe/_reference_friend.html.erb +1 -1
- data/app/views/fe/questions/fe/_reference_parent.html.erb +1 -1
- data/app/views/fe/questions/fe/_reference_peer.html.erb +1 -1
- data/app/views/fe/questions/fe/_reference_question.html.erb +40 -24
- data/app/views/fe/questions/fe/_reference_roommate.html.erb +1 -1
- data/app/views/fe/questions/fe/_reference_spiritual.html.erb +1 -1
- data/app/views/fe/questions/fe/_reference_staff.html.erb +1 -1
- data/app/views/fe/questions/fe/_state_chooser.html.erb +6 -6
- data/app/views/fe/questions/fe/_text_area_field.html.erb +14 -10
- data/app/views/fe/questions/fe/_text_field.html.erb +7 -6
- data/app/views/fe/questions/fe/_yes_no.html.erb +8 -8
- data/app/views/fe/questions/fe/_yes_no_field.erb +11 -8
- data/app/views/fe/reference_pages/_reference.html.erb +12 -12
- data/app/views/fe/reference_pages/edit.html.erb +4 -4
- data/app/views/fe/reference_sheets/done.html.erb +2 -2
- data/app/views/fe/reference_sheets/not_found.html.erb +3 -3
- data/app/views/fe/references/edit.html.erb +5 -5
- data/app/views/fe/references/show.html.erb +3 -3
- data/app/views/fe/references/submit.js.erb +3 -3
- data/app/views/fe/submit_pages/_thankyou.html.erb +1 -1
- data/app/views/fe/submit_pages/edit.html.erb +9 -9
- data/app/views/fe/submit_pages/error.js.erb +1 -1
- data/app/views/fe/submit_pages/submit.js.erb +2 -2
- data/app/views/layouts/fe/_error_messages_for.html.erb +1 -1
- data/app/views/layouts/fe/application.html.erb +3 -4
- data/app/views/layouts/fe/fe_admin.html.erb +30 -0
- data/app/views.current/fe/admin/elements/_errors.html.erb +11 -0
- data/app/views.current/fe/admin/elements/create.js.erb +12 -0
- data/app/views.current/fe/admin/elements/destroy.js.erb +4 -0
- data/app/views.current/fe/admin/elements/drop.js.erb +3 -0
- data/app/views.current/fe/admin/elements/duplicate.js.erb +3 -0
- data/app/views.current/fe/admin/elements/edit.js.erb +4 -0
- data/app/views.current/fe/admin/elements/error.js.erb +4 -0
- data/app/views.current/fe/admin/elements/new.js.erb +17 -0
- data/app/views.current/fe/admin/elements/update.js.erb +9 -0
- data/app/views.current/fe/admin/email_templates/_form.html.erb +8 -0
- data/app/views.current/fe/admin/email_templates/edit.html.erb +13 -0
- data/app/views.current/fe/admin/email_templates/index.html.erb +20 -0
- data/app/views.current/fe/admin/email_templates/new.html.erb +11 -0
- data/app/views.current/fe/admin/panels/_advanced_options.html.erb +49 -0
- data/app/views.current/fe/admin/panels/_common_boolean_fields.html.erb +1 -0
- data/app/views.current/fe/admin/panels/_common_boolean_fields_default.html.erb +11 -0
- data/app/views.current/fe/admin/panels/_common_fields.html.erb +23 -0
- data/app/views.current/fe/admin/panels/_condition.html.erb +6 -0
- data/app/views.current/fe/admin/panels/_insert.html.erb +39 -0
- data/app/views.current/fe/admin/panels/_nav_controls.html.erb +6 -0
- data/app/views.current/fe/admin/panels/_page.html.erb +3 -0
- data/app/views.current/fe/admin/panels/_pages_list.html.erb +16 -0
- data/app/views.current/fe/admin/panels/_prop_attachment_field.html.erb +2 -0
- data/app/views.current/fe/admin/panels/_prop_choice_field.html.erb +74 -0
- data/app/views.current/fe/admin/panels/_prop_date_field.html.erb +7 -0
- data/app/views.current/fe/admin/panels/_prop_element.html.erb +23 -0
- data/app/views.current/fe/admin/panels/_prop_page.html.erb +26 -0
- data/app/views.current/fe/admin/panels/_prop_paragraph.html.erb +46 -0
- data/app/views.current/fe/admin/panels/_prop_question_grid.html.erb +28 -0
- data/app/views.current/fe/admin/panels/_prop_question_grid_with_total.html.erb +14 -0
- data/app/views.current/fe/admin/panels/_prop_reference_question.html.erb +12 -0
- data/app/views.current/fe/admin/panels/_prop_section.html.erb +8 -0
- data/app/views.current/fe/admin/panels/_prop_sheet.html.erb +20 -0
- data/app/views.current/fe/admin/panels/_prop_text_field.html.erb +20 -0
- data/app/views.current/fe/admin/question_pages/_element.html.erb +28 -0
- data/app/views.current/fe/admin/question_pages/_element_show.html.erb +10 -0
- data/app/views.current/fe/admin/question_pages/_errors.html.erb +10 -0
- data/app/views.current/fe/admin/question_pages/_question_page.html.erb +13 -0
- data/app/views.current/fe/admin/question_pages/create.js.erb +11 -0
- data/app/views.current/fe/admin/question_pages/destroy.js.erb +5 -0
- data/app/views.current/fe/admin/question_pages/edit.js.erb +3 -0
- data/app/views.current/fe/admin/question_pages/error.js.erb +4 -0
- data/app/views.current/fe/admin/question_pages/show.js.erb +9 -0
- data/app/views.current/fe/admin/question_pages/show_panel.js.erb +3 -0
- data/app/views.current/fe/admin/question_pages/update.js.erb +2 -0
- data/app/views.current/fe/admin/question_sheets/_errors.html.erb +11 -0
- data/app/views.current/fe/admin/question_sheets/edit.js.erb +3 -0
- data/app/views.current/fe/admin/question_sheets/error.js.erb +5 -0
- data/app/views.current/fe/admin/question_sheets/index.html.erb +41 -0
- data/app/views.current/fe/admin/question_sheets/new.html.erb +15 -0
- data/app/views.current/fe/admin/question_sheets/show.html.erb +27 -0
- data/app/views.current/fe/admin/question_sheets/update.js.erb +2 -0
- data/app/views.current/fe/answer_pages/_answer_page.html.erb +53 -0
- data/app/views.current/fe/answer_pages/_element.html.erb +32 -0
- data/app/views.current/fe/answer_pages/_page_name.html.erb +1 -0
- data/app/views.current/fe/answer_pages/show.html.erb +39 -0
- data/app/views.current/fe/answer_pages/update.js.erb +13 -0
- data/app/views.current/fe/answer_sheets/_answer_sheet.html.erb +26 -0
- data/app/views.current/fe/answer_sheets/_element.html.erb +74 -0
- data/app/views.current/fe/answer_sheets/_incomplete.html.erb +10 -0
- data/app/views.current/fe/answer_sheets/_page_link.html.erb +9 -0
- data/app/views.current/fe/answer_sheets/_pages_list.html.erb +11 -0
- data/app/views.current/fe/answer_sheets/_submit_to.html.erb +1 -0
- data/app/views.current/fe/answer_sheets/_title.html.erb +1 -0
- data/app/views.current/fe/answer_sheets/edit.html.erb +66 -0
- data/app/views.current/fe/answer_sheets/incomplete.js.erb +11 -0
- data/app/views.current/fe/answer_sheets/index.html.erb +18 -0
- data/app/views.current/fe/answer_sheets/send_reference_invite.js.erb +8 -0
- data/app/views.current/fe/answer_sheets/show.html.erb +13 -0
- data/app/views.current/fe/applications/_logout.html.erb +1 -0
- data/app/views.current/fe/applications/show.html.erb +1 -0
- data/app/views.current/fe/help/builder.html +33 -0
- data/app/views.current/fe/help/question_grid.html +18 -0
- data/app/views.current/fe/questions/fe/_acceptance.html.erb +14 -0
- data/app/views.current/fe/questions/fe/_attachment_field.html.erb +165 -0
- data/app/views.current/fe/questions/fe/_checkbox_field.html.erb +53 -0
- data/app/views.current/fe/questions/fe/_country.html.erb +7 -0
- data/app/views.current/fe/questions/fe/_date_field.html.erb +7 -0
- data/app/views.current/fe/questions/fe/_date_field_mmyy.html.erb +9 -0
- data/app/views.current/fe/questions/fe/_drop_down_field.html.erb +8 -0
- data/app/views.current/fe/questions/fe/_paragraph.html.erb +1 -0
- data/app/views.current/fe/questions/fe/_question_grid.html.erb +70 -0
- data/app/views.current/fe/questions/fe/_question_grid_with_total.html.erb +64 -0
- data/app/views.current/fe/questions/fe/_questions.html.erb +15 -0
- data/app/views.current/fe/questions/fe/_radio_button_field.html.erb +60 -0
- data/app/views.current/fe/questions/fe/_rating.html.erb +64 -0
- data/app/views.current/fe/questions/fe/_reference_discipler.html.erb +1 -0
- data/app/views.current/fe/questions/fe/_reference_friend.html.erb +1 -0
- data/app/views.current/fe/questions/fe/_reference_parent.html.erb +1 -0
- data/app/views.current/fe/questions/fe/_reference_peer.html.erb +1 -0
- data/app/views.current/fe/questions/fe/_reference_question.html.erb +61 -0
- data/app/views.current/fe/questions/fe/_reference_roommate.html.erb +1 -0
- data/app/views.current/fe/questions/fe/_reference_spiritual.html.erb +1 -0
- data/app/views.current/fe/questions/fe/_reference_staff.html.erb +1 -0
- data/app/views.current/fe/questions/fe/_section.html.erb +1 -0
- data/app/views.current/fe/questions/fe/_state_chooser.html.erb +7 -0
- data/app/views.current/fe/questions/fe/_text_area_field.html.erb +17 -0
- data/app/views.current/fe/questions/fe/_text_field.html.erb +9 -0
- data/app/views.current/fe/questions/fe/_yes_no.html.erb +17 -0
- data/app/views.current/fe/questions/fe/_yes_no_field.erb +20 -0
- data/app/views.current/fe/reference_pages/_reference.html.erb +31 -0
- data/app/views.current/fe/reference_pages/edit.html.erb +24 -0
- data/app/views.current/fe/reference_sheets/done.html.erb +2 -0
- data/app/views.current/fe/reference_sheets/not_found.html.erb +5 -0
- data/app/views.current/fe/reference_sheets/submitted.js.erb +1 -0
- data/app/views.current/fe/references/edit.html.erb +8 -0
- data/app/views.current/fe/references/send_invite.js.erb +7 -0
- data/app/views.current/fe/references/show.html.erb +18 -0
- data/app/views.current/fe/references/submit.js.erb +3 -0
- data/app/views.current/fe/submit_pages/_errors.html.erb +1 -0
- data/app/views.current/fe/submit_pages/_thankyou.html.erb +2 -0
- data/app/views.current/fe/submit_pages/edit.html.erb +36 -0
- data/app/views.current/fe/submit_pages/error.js.erb +1 -0
- data/app/views.current/fe/submit_pages/submit.js.erb +3 -0
- data/app/views.current/layouts/fe/_error_messages_for.html.erb +7 -0
- data/app/views.current/layouts/fe/application.html.erb +47 -0
- data/app/{views/layouts/fe/fe.admin.html.erb → views.current/layouts/fe/fe_admin.html.erb} +4 -4
- data/config/initializers/paper_trail.rb +3 -0
- data/config/routes.rb +3 -1
- data/db/migrate/20131003041856_core.rb +23 -23
- data/db/migrate/20131003044250_create_reference_sheets.rb +1 -1
- data/db/migrate/20131003044436_add_element_and_answer_fields.rb +3 -3
- data/db/migrate/20131003044518_create_email_templates.rb +2 -2
- data/db/migrate/20131003044621_add_max_lengths.rb +1 -1
- data/db/migrate/20131003044714_create_join_table.rb +1 -1
- data/db/migrate/20131016162128_remove_question_id_from_element.rb +1 -1
- data/db/migrate/20140623153424_create_fe_people.rb +1 -1
- data/db/migrate/20140624180246_create_fe_addresses.rb +1 -1
- data/db/migrate/20140624182216_create_fe_phone_numbers.rb +1 -1
- data/db/migrate/20140625160545_create_fe_users.rb +1 -1
- data/db/migrate/20140808202507_add_conditional_type_to_elements.rb +1 -1
- data/db/migrate/20140808203609_add_conditional_answer_to_elements.rb +1 -1
- data/db/migrate/20141103204704_remove_short_value_column.rb +1 -1
- data/db/migrate/20141109154522_move_conditional_ids_used_for_choice_field_to_their_own_column.rb +1 -1
- data/db/migrate/20150504221439_add_all_element_ids_to_pages.rb +1 -1
- data/db/migrate/20150713022326_add_locale_columns.rb +1 -1
- data/db/migrate/20150714220730_add_locale_to_answer_sheet.rb +1 -1
- data/db/migrate/20150925181652_add_share_to_elements.rb +5 -0
- data/db/migrate/20150928085325_change_pages_all_element_ids_to_text.rb +1 -1
- data/db/migrate/20150930191538_add_locale_to_reference_sheets.rb +1 -1
- data/db/migrate/20151021181928_switch_conditional_answer_separator_to_semicolon.rb +7 -0
- data/db/migrate/20151021184250_add_question_sheet_id_in_refs.rb +12 -0
- data/db/migrate/20160201185838_add_visible_and_visibility_cache_key_to_reference_sheets.rb +6 -0
- data/db/migrate/20160805221415_add_rating_extra_labels.rb +10 -0
- data/db/migrate/20181108201746_create_versions.rb +80 -0
- data/db/migrate/20181218201130_increase_slug_length.rb +5 -0
- data/lib/fe/engine.rb +10 -10
- data/lib/fe/version.rb +1 -1
- data/lib/fe.rb +7 -1
- data/spec/controllers/fe/admin/elements_controller_spec.rb +30 -20
- data/spec/controllers/fe/admin/email_templates_controller_spec.rb +2 -2
- data/spec/controllers/fe/admin/question_pages_controller_spec.rb +1 -1
- data/spec/controllers/fe/admin/question_sheets_controller_spec.rb +4 -4
- data/spec/controllers/fe/answer_pages_controller_spec.rb +86 -30
- data/spec/controllers/fe/answer_sheets_controller_spec.rb +65 -9
- data/spec/dummy/app/assets/config/manifest.js +0 -0
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/app/views/layouts/application.html.erb +2 -2
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/environments/test.rb +3 -3
- data/spec/dummy/config/initializers/assets.rb +5 -2
- data/spec/dummy/config/initializers/fast_gettext.rb +1 -1
- data/spec/dummy/config/initializers/to_unsafe_h.rb +5 -0
- data/spec/dummy/config/initializers/to_unsafe_h.rb.new +5 -0
- data/spec/dummy/db/migrate/20141203214017_core.fe_engine.rb +23 -23
- data/spec/dummy/db/migrate/20141203214018_create_reference_sheets.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214019_add_element_and_answer_fields.fe_engine.rb +3 -3
- data/spec/dummy/db/migrate/20141203214020_create_email_templates.fe_engine.rb +2 -2
- data/spec/dummy/db/migrate/20141203214021_add_max_lengths.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214022_create_join_table.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214023_remove_question_id_from_element.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214024_create_fe_people.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214025_create_fe_addresses.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214027_create_fe_users.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214028_add_conditional_type_to_elements.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214029_add_conditional_answer_to_elements.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214030_remove_short_value_column.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20141203214031_move_conditional_ids_used_for_choice_field_to_their_own_column.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20150123215803_create_users.rb +1 -1
- data/spec/dummy/db/migrate/20150504222619_add_all_element_ids_to_pages.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20150925192557_add_share_to_elements.fe_engine.rb +6 -0
- data/spec/dummy/db/migrate/20150930190001_create_fe_phone_numbers.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20150930190002_add_locale_columns.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20150930190003_add_locale_to_answer_sheet.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20150930190004_change_pages_all_element_ids_to_text.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20150930191756_add_locale_to_reference_sheets.fe_engine.rb +1 -1
- data/spec/dummy/db/migrate/20151021190027_add_question_sheet_id_in_refs.fe_engine.rb +13 -0
- data/spec/dummy/db/migrate/20160204164612_switch_conditional_answer_separator_to_semicolon.fe_engine.rb +8 -0
- data/spec/dummy/db/migrate/20160204164613_add_visible_and_visibility_cache_key_to_reference_sheets.fe_engine.rb +7 -0
- data/spec/dummy/db/migrate/20181108201746_create_versions.rb +80 -0
- data/spec/dummy/db/schema.rb +71 -79
- data/spec/dummy/log/test.log +101278 -419
- data/spec/factories/answer_sheet_question_sheets.rb +1 -1
- data/spec/factories/answer_sheets.rb +2 -2
- data/spec/factories/answers.rb +1 -1
- data/spec/factories/applications.rb +3 -3
- data/spec/factories/dummy_applications.rb +3 -3
- data/spec/factories/dummy_people.rb +3 -3
- data/spec/factories/dummy_users.rb +3 -3
- data/spec/factories/elements.rb +21 -21
- data/spec/factories/email_templates.rb +3 -3
- data/spec/factories/fe_addresses.rb +10 -10
- data/spec/factories/fe_email_addresses.rb +3 -3
- data/spec/factories/fe_email_templates.rb +4 -4
- data/spec/factories/fe_people.rb +5 -5
- data/spec/factories/fe_phone_numbers.rb +3 -3
- data/spec/factories/fe_user.rb +3 -3
- data/spec/factories/page.rb +1 -1
- data/spec/factories/page_elements.rb +1 -1
- data/spec/factories/paragraphs.rb +1 -1
- data/spec/factories/question_sheet.rb +2 -2
- data/spec/factories/reference_questions.rb +1 -1
- data/spec/factories/reference_sheets.rb +1 -1
- data/spec/jobs/fe/update_reference_sheet_visibility_job_spec.rb +40 -0
- data/spec/models/fe/answer_sheet_question_sheet_spec.rb +1 -1
- data/spec/models/fe/answer_spec.rb +2 -2
- data/spec/models/fe/application_spec.rb +94 -1
- data/spec/models/fe/choice_field_spec.rb +47 -1
- data/spec/models/fe/condition_spec.rb +2 -2
- data/spec/models/fe/element_spec.rb +252 -60
- data/spec/models/fe/email_template_spec.rb +1 -1
- data/spec/models/fe/page_element_spec.rb +1 -1
- data/spec/models/fe/page_spec.rb +57 -12
- data/spec/models/fe/person_spec.rb +1 -1
- data/spec/models/fe/question_set_spec.rb +91 -0
- data/spec/models/fe/question_sheet_spec.rb +11 -15
- data/spec/models/fe/question_spec.rb +73 -6
- data/spec/models/fe/reference_question_spec.rb +20 -0
- data/spec/models/fe/reference_sheet_spec.rb +287 -4
- data/spec/models/fe/text_field_spec.rb +22 -0
- data/spec/rails_helper.rb +79 -76
- metadata +195 -57
- data/app/assets/javascripts/fe/jquery.scrollTo-min.js +0 -7
- data/app/controllers/fe/concerns/answer_pages_controller_concern.rb +0 -84
- data/app/models/fe/concerns/answer_sheet_concern.rb +0 -85
- data/spec/dummy/db/migrate/20141203214026_create_create_fe_phone_numbers.fe_engine.rb +0 -17
- data/spec/dummy/log/development.log +0 -5
- /data/app/{assets/stylesheets/360front.css → views.current/fe/admin/elements/reorder.js.erb} +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
$('#page-preview').html('<%= escape_javascript(render(
|
2
|
-
$('#nav-controls').html('<%= escape_javascript(render(
|
1
|
+
$('#page-preview').html('<%= escape_javascript(render("fe/admin/question_pages/question_page")) %>')
|
2
|
+
$('#nav-controls').html('<%= escape_javascript(render("fe/admin/panels/nav_controls")) %>')
|
3
3
|
switchTab("pages_list")
|
4
4
|
$('#list-pages li').removeClass('active')
|
5
5
|
$('#link-<%= dom_id(@page) %>').addClass('active')
|
@@ -1,2 +1,2 @@
|
|
1
1
|
$("#page-name").html('<%= escape_javascript(@page.label) %>')
|
2
|
-
$('#panel').html('<%= escape_javascript(render(
|
2
|
+
$('#panel').html('<%= escape_javascript(render("admin/panels/pages_list")) %>')
|
@@ -1,3 +1,3 @@
|
|
1
|
-
$('#panel').html('<%= escape_javascript(render(
|
1
|
+
$('#panel').html('<%= escape_javascript(render("fe/admin/panels/prop_sheet", question_sheet: @question_sheet)) %>');
|
2
2
|
clearPageName()
|
3
3
|
clearCurrentElement()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
$('#errors').html('<%= escape_javascript(render(
|
1
|
+
$('#errors').html('<%= escape_javascript(render("errors", page: @question_sheet)) %>');
|
2
2
|
|
3
3
|
<% @question_sheet.errors.each do |attr_name, message| %>
|
4
4
|
addError('question_sheet_<%= attr_name %>')
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<div style="background: #ffe5df; border: solid 1px #efbeb3; padding: 9px; margin: 0 0 18px;"><%= flash[:error] %></div>
|
6
6
|
<% end -%>
|
7
7
|
|
8
|
-
<%= link_to
|
8
|
+
<%= link_to "New Form", fe_admin_question_sheets_path(), method: :post, class: "add-link" %>
|
9
9
|
<br/>
|
10
10
|
<table cellspacing="0" class="list">
|
11
11
|
<tr>
|
@@ -14,10 +14,10 @@
|
|
14
14
|
</tr>
|
15
15
|
<% for question_sheet in @active_question_sheets %>
|
16
16
|
<tr class="<%= cycle("","alt") %>">
|
17
|
-
<td class="title"><%= link_to question_sheet.label, fe_admin_question_sheet_path(question_sheet), :
|
18
|
-
<td class="actions"><%= link_to
|
19
|
-
<td class="actions"><%= link_to
|
20
|
-
<td class="actions"><%= link_to
|
17
|
+
<td class="title"><%= link_to question_sheet.label, fe_admin_question_sheet_path(question_sheet), class: "questionnaire" %></td>
|
18
|
+
<td class="actions"><%= link_to "Duplicate", duplicate_fe_admin_question_sheet_path(question_sheet), data: {confirm: "This will take some time depending on the number of questions. Please be patient."}, method: :post, class: "duplicate" %></td>
|
19
|
+
<td class="actions"><%= link_to "Archive", archive_fe_admin_question_sheet_path(question_sheet), data: {confirm: "Are you sure you want to archive this Question Sheet?"}, method: :post, class: "archive" %></td>
|
20
|
+
<td class="actions"><%= link_to "Destroy", fe_admin_question_sheet_path(question_sheet), data: {confirm: "Are you sure you want to delete this Question Sheet?"}, method: :delete, class: "destroy delete" %></td>
|
21
21
|
</tr>
|
22
22
|
<% end %>
|
23
23
|
</table>
|
@@ -31,9 +31,9 @@
|
|
31
31
|
</tr>
|
32
32
|
<% for question_sheet in @archived_question_sheets %>
|
33
33
|
<tr class="<%= cycle("","alt") %>">
|
34
|
-
<td class="title"><%= link_to question_sheet.label, fe_admin_question_sheet_path(question_sheet), :
|
35
|
-
<td class="actions"><%= link_to
|
36
|
-
<td class="actions"><%= link_to
|
34
|
+
<td class="title"><%= link_to question_sheet.label, fe_admin_question_sheet_path(question_sheet), class: "questionnaire" %></td>
|
35
|
+
<td class="actions"><%= link_to "Duplicate", duplicate_fe_admin_question_sheet_path(question_sheet), data: {confirm: "This will take some time depending on the number of questions. Please be patient."}, method: :post, class: "duplicate" %></td>
|
36
|
+
<td class="actions"><%= link_to "Un-Archive", unarchive_fe_admin_question_sheet_path(question_sheet), method: :post, class: "unarchive" %></td>
|
37
37
|
</tr>
|
38
38
|
<% end %>
|
39
39
|
</table>
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
<%= error_messages_for :question_sheet %>
|
4
4
|
|
5
|
-
|
5
|
+
<%= form_for(:question_sheet, url: fe_admin_question_sheets_path) do |f| %>
|
6
6
|
<p>
|
7
7
|
<label for="question_sheet_label">Label</label>
|
8
|
-
<%= f.text_field :label, :
|
8
|
+
<%= f.text_field :label, maxlength: 60 %>
|
9
9
|
</p>
|
10
10
|
<p>
|
11
11
|
<%= submit_tag "Create" %>
|
12
12
|
</p>
|
13
13
|
<% end %>
|
14
14
|
|
15
|
-
<%= link_to
|
15
|
+
<%= link_to "Back", fe_admin_question_sheets_path %>
|
@@ -5,21 +5,21 @@ var activeElement = "";
|
|
5
5
|
<div id="content">
|
6
6
|
<div id="controls">
|
7
7
|
<ul id="nav-controls">
|
8
|
-
<%= render
|
8
|
+
<%= render "fe/admin/panels/nav_controls" %>
|
9
9
|
</ul>
|
10
10
|
|
11
11
|
<div id="panel">
|
12
|
-
<%= render
|
12
|
+
<%= render "fe/admin/panels/pages_list" %>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
|
16
16
|
|
17
17
|
<div id="preview">
|
18
|
-
<h2 id=
|
19
|
-
<%= link_to @question_sheet.label, edit_fe_admin_question_sheet_path(@question_sheet), :
|
18
|
+
<h2 id="sheet-name">
|
19
|
+
<%= link_to @question_sheet.label, edit_fe_admin_question_sheet_path(@question_sheet), remote: true, method: :get , class: "ctl" -%>
|
20
20
|
</h2>
|
21
21
|
<div id="page-preview">
|
22
|
-
<%= render
|
22
|
+
<%= render "fe/admin/question_pages/question_page" %>
|
23
23
|
</div>
|
24
24
|
</div>
|
25
25
|
|
@@ -1,2 +1,2 @@
|
|
1
1
|
$('#sheet-name').html('<%= escape_javascript(@question_sheet.label) %>');
|
2
|
-
$('#panel').html('<%= escape_javascript(render(
|
2
|
+
$('#panel').html('<%= escape_javascript(render("fe/admin/panels/prop_sheet", question_sheet: @question_sheet)) %>');
|
@@ -1,6 +1,5 @@
|
|
1
1
|
<% if @presenter.active_page %>
|
2
|
-
<% page_dom = @presenter.active_page_link.dom_id
|
3
|
-
next_js = load_page_js(@presenter.next_page) -%>
|
2
|
+
<% page_dom = @presenter.active_page_link.dom_id %>
|
4
3
|
|
5
4
|
<div id="<%= page_dom %>" class="answer-page" style="<% if show_first.nil? -%>display: none;<% end -%>"> <!-- this id is parsed by fe.public.js -->
|
6
5
|
|
@@ -8,37 +7,37 @@
|
|
8
7
|
<%= render "fe/answer_pages/page_name" %>
|
9
8
|
|
10
9
|
<% if @elements.length > 0 -%>
|
11
|
-
<%= form_tag @presenter.active_page_link.save_path, :
|
12
|
-
<%= hidden_field_tag
|
10
|
+
<%= form_tag @presenter.active_page_link.save_path, id: "#{page_dom}-form", autocomplete: "off", onsubmit: "fe.pageHandler.savePage($('#sp_application_55716-page_331')); return false;", multipart: true do -%>
|
11
|
+
<%= hidden_field_tag "a", params[:a] %>
|
13
12
|
<ul class="questions" id="questions_list">
|
14
13
|
<% previous_element = nil %>
|
15
14
|
<% @elements.each do |element| %>
|
16
|
-
|
17
|
-
|
15
|
+
<li style="<%= "display:none" if element.hidden?(@answer_sheet, @presenter.active_page) %>" class="<%= element.class.to_s.downcase.gsub("::","_") %> <%= element.style.to_s.downcase %> <%= "conditional" if element.conditional %>" id="element_<%= element.id %>" <% if element.conditional %>data-conditional_id="<%= element.conditional_id %>" data-conditional_type="<%= element.conditional_type %>" data-conditional_answer="<%= element.conditional_answer %>" data-application_id="<%= @answer_sheet.id %>" data-answer_sheet_id_prefix="<%= @answer_sheet.class.name.underscore.gsub("/","_") %>"<% end %><% if element.slug %> data-slug="<%= element.slug %>"<% end %>>
|
16
|
+
<%= render "fe/answer_pages/element", element: element %>
|
18
17
|
</li>
|
19
18
|
<% previous_element = element %>
|
20
19
|
<% end %>
|
21
20
|
</ul>
|
22
21
|
|
23
|
-
<%
|
22
|
+
<% unless @presenter.next_page -%>
|
24
23
|
<div id="submit_message" class="validation-advice" style="display: none;"></div>
|
25
24
|
<div>
|
26
|
-
<button type="button" class="button save_button"><%= _(
|
27
|
-
<button type="submit" class="button cru-gold no-left-margin" onclick="page_handler.completeAll(); return false;" id="submit_button"><%= _(
|
25
|
+
<button type="button" class="<%= "btn btn-default" if Fe.bootstrap %> button save_button"><%= _("Save Now") %></button>
|
26
|
+
<button type="submit" class="<%= "btn btn-default" if Fe.bootstrap %> button cru-gold no-left-margin" onclick="page_handler.completeAll(); return false;" id="submit_button"><%= _("Submit") %></button>
|
28
27
|
</div>
|
29
28
|
<% else -%>
|
30
29
|
<div class="savestatus">
|
31
|
-
<%= _(
|
30
|
+
<%= _("Last Saved:") %> <span class="last-saved"><%= l(@answer_sheet.updated_at, format: :datetime) %></span><%= spinner(page_dom) %>
|
32
31
|
</div>
|
33
32
|
<div>
|
34
|
-
<button type="button" class="button no-left-margin save_button"><%= _(
|
35
|
-
<button type="button" class="button cru-gold" onclick="
|
33
|
+
<button type="button" class="button no-left-margin save_button"><%= _("Save Now") %></button>
|
34
|
+
<button type="button" class="button cru-gold" onclick="fe.pageHandler.next(); return false;"><%= _("Next >>") %></button>
|
36
35
|
</div>
|
37
36
|
<% end -%>
|
38
37
|
<% end -%>
|
39
38
|
<% else -%>
|
40
39
|
<div style="background: #ffc;">
|
41
|
-
<p><%= _(
|
40
|
+
<p><%= _("There are no questions on this page.") %></p>
|
42
41
|
</div>
|
43
42
|
<% end -%>
|
44
43
|
</div>
|
@@ -47,7 +46,7 @@
|
|
47
46
|
<% if session[:attempted_submit] %>
|
48
47
|
<script type="text/javascript" charset="utf-8">
|
49
48
|
$(function() {
|
50
|
-
|
49
|
+
fe.pageHandler.validatePage("<%= page_dom %>")
|
51
50
|
});
|
52
51
|
</script>
|
53
52
|
<% end %>
|
@@ -1,12 +1,32 @@
|
|
1
|
+
<% if Fe.bootstrap %>
|
2
|
+
|
3
|
+
<div class="form-group">
|
4
|
+
<% if element.question? && element.default_label? && element.label.present? && !element.hide_label? -%>
|
5
|
+
<label for="<%= dom_id(element) %>" class="desc">
|
6
|
+
<%= raw element.label(session[:locale]) %>
|
7
|
+
<% if element.required?(@answer_sheet, @page) -%><span class="required">required</span><% end -%>
|
8
|
+
<%= tip(element.tooltip) if element.tooltip.present? %>
|
9
|
+
|
10
|
+
<% col ||= nil %>
|
11
|
+
<%= render partial: "fe/questions/" + element.ptemplate, object: element, locals: {col: col} %>
|
12
|
+
</label>
|
13
|
+
<% else %>
|
14
|
+
<% col ||= nil %>
|
15
|
+
<%= render partial: "fe/questions/" + element.ptemplate, object: element, locals: {col: col} %>
|
16
|
+
<% end -%>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<% else %>
|
1
20
|
|
2
21
|
<% if element.question? && element.default_label? && element.label.present? && !element.hide_label? -%>
|
3
22
|
<label for="<%= dom_id(element) %>" class="desc">
|
4
23
|
<%= raw element.label(session[:locale]) %>
|
5
|
-
<% if element.required?(@answer_sheet, @page) -%><span class="required"><%= _(
|
24
|
+
<% if element.required?(@answer_sheet, @page) -%><span class="required"><%= _("required") %></span><% end -%>
|
6
25
|
<%= tip(element.tooltip) if element.tooltip.present? %>
|
7
26
|
</label>
|
8
27
|
<% end -%>
|
9
28
|
|
10
29
|
<% col ||= nil %>
|
11
|
-
<%= render :
|
30
|
+
<%= render partial: "fe/questions/" + element.ptemplate, object: element, locals: {col: col} %>
|
12
31
|
|
32
|
+
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
<h4 id=
|
1
|
+
<h4 id="page-name"><%= @presenter.active_page.label(session[:locale]) %></h4>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<% if @presenter.active_page %>
|
2
|
+
<% page_dom = @presenter.active_page_link.dom_id
|
3
|
+
next_js = load_page_js(@presenter.next_page) -%>
|
4
|
+
|
5
|
+
<div id="<%= page_dom %>" class="answer-page"> <!-- this id is parsed by fe.public.js -->
|
6
|
+
|
7
|
+
<div class="page">
|
8
|
+
<%= render "fe/answer_pages/page_name" %>
|
9
|
+
|
10
|
+
<% if @elements.length > 0 -%>
|
11
|
+
<%= form_tag @presenter.active_page_link.save_path, id: "#{page_dom}-form", autocomplete: "off", onsubmit: "fe.pageHandler.savePage($("#sp_application_55716-page_331")); return false;", multipart: true do -%>
|
12
|
+
<%= hidden_field_tag "a", params[:a] %>
|
13
|
+
<ul class="questions" id="questions_list">
|
14
|
+
<% previous_element = nil %>
|
15
|
+
<% @elements.each do |element| %>
|
16
|
+
<li class="<%= element.class.to_s.downcase.gsub("::","_") %> <%= element.style.to_s.downcase %> <%= "conditional" if element.conditional %>" id="element_<%= element.id %>" <% if element.conditional %>data-conditional_id="<%= element.conditional_id %>" data-conditional_type="<%= element.conditional_type %>" data-conditional_answer="<%= element.conditional_answer %>" data-application_id="<%= @answer_sheet.id %>" data-answer_sheet_id_prefix="<%= @answer_sheet.class.name.underscore.gsub("/","_") %>"<% end %><% if element.slug %> data-slug="<%= element.slug %>"<% end %>>
|
17
|
+
<%= render "fe/answer_pages/element", element: element %>
|
18
|
+
</li>
|
19
|
+
<% previous_element = element %>
|
20
|
+
<% end %>
|
21
|
+
</ul>
|
22
|
+
|
23
|
+
<% end -%>
|
24
|
+
<% else -%>
|
25
|
+
<div style="background: #ffc;">
|
26
|
+
<p><%= _("There are no questions on this page.") %></p>
|
27
|
+
</div>
|
28
|
+
<% end -%>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<% if session[:attempted_submit] %>
|
33
|
+
<script type="text/javascript" charset="utf-8">
|
34
|
+
$(function() {
|
35
|
+
fe.pageHandler.validatePage("<%= page_dom %>")
|
36
|
+
});
|
37
|
+
</script>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
@@ -1,5 +1,13 @@
|
|
1
|
-
|
1
|
+
<% if @saved_at_timestamp.is_a?(Time) || @saved_at_timestamp.is_a?(Date) %>
|
2
|
+
$('.last-saved').html('<%= escape_javascript(l(@saved_at_timestamp, format: :datetime)) %>')
|
3
|
+
<% end %>
|
2
4
|
<% if @answer && @answer.attachment_file_name %>
|
3
|
-
$('#<%= dom_id(@answer.question) %>_filename').html('Current File:
|
5
|
+
$('#<%= dom_id(@answer.question) %>_filename').html('Current File: ' +
|
6
|
+
'<%= link_to(@answer.attachment_file_name, @answer.attachment.expiring_url) %>' +
|
7
|
+
'<%= link_to(image_tag("fe/icons/minus-button.png"),
|
8
|
+
delete_file_fe_answer_sheet_page_path(@presenter.active_answer_sheet, @page, question_id: @answer.question.id),
|
9
|
+
method: :delete, remote: true) %>')
|
4
10
|
$('#<%= dom_id(@answer.question) %>_filename').effect('highlight')
|
11
|
+
<% elsif @answer %>
|
12
|
+
$('#<%= dom_id(@answer.question) %>_filename').html('')
|
5
13
|
<% end %>
|
@@ -1,15 +1,15 @@
|
|
1
|
-
<h3 id=
|
1
|
+
<h3 id="sheet-name"><%= answer_sheet.question_sheet.label %></h3>
|
2
2
|
|
3
3
|
<% if elements.length > 0 -%>
|
4
4
|
|
5
5
|
<% elements.each do |page, page_elements| -%>
|
6
6
|
<% next unless page.has_questions? %>
|
7
|
-
<a name="<%= dom_id(page) %>"></a>
|
7
|
+
<a name="<%= dom_id(page) %>" class="anchor"></a>
|
8
8
|
|
9
9
|
<div class="page" data-page-id="<%= page.id %>">
|
10
10
|
<h3><%= page.label %></h3>
|
11
11
|
<ul class="questions readonly" start="<%= @question_number %>">
|
12
|
-
<%= render :
|
12
|
+
<%= render partial: "fe/answer_sheets/element", collection: page_elements, locals: {elements: page_elements} %>
|
13
13
|
</ul>
|
14
14
|
</div>
|
15
15
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<% else -%>
|
21
21
|
|
22
22
|
<div style="background: #ffc;">
|
23
|
-
<p>That
|
23
|
+
<p>That"s odd. There are no answers to review.</p>
|
24
24
|
</div>
|
25
25
|
|
26
26
|
<% end -%>
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<% if element.kind == "Fe::QuestionGrid" || element.kind == "Fe::QuestionGridWithTotal"-%>
|
2
2
|
<li>
|
3
|
-
|
3
|
+
<% unless element.hide_label? %>
|
4
|
+
<label class="desc"><%= raw element.label %></label>
|
5
|
+
<% end %>
|
4
6
|
<table class="grid">
|
5
7
|
<%- if element.cols -%>
|
6
8
|
<tr>
|
7
|
-
<%- element.cols.split(
|
8
|
-
<th><%= raw header ||
|
9
|
+
<%- element.cols.split(";").each do |header| -%>
|
10
|
+
<th><%= raw header || " " %></th>
|
9
11
|
<%- end -%>
|
10
12
|
</tr>
|
11
13
|
<%- end -%>
|
@@ -31,10 +33,10 @@
|
|
31
33
|
<%- end -%>
|
32
34
|
<% elsif grid_element.is_a?(Fe::QuestionGrid) || grid_element.is_a?(Fe::QuestionGridWithTotal) %>
|
33
35
|
<ul>
|
34
|
-
<%= render :
|
36
|
+
<%= render partial: "fe/answer_sheets/element", object: grid_element %>
|
35
37
|
</ul>
|
36
38
|
<% else %>
|
37
|
-
<%= render :
|
39
|
+
<%= render partial: "fe/questions/" + element.ptemplate, object: element %>
|
38
40
|
<% end %>
|
39
41
|
<% end -%>
|
40
42
|
</td>
|
@@ -63,10 +65,10 @@
|
|
63
65
|
<span class="answer"><%= simple_format element.display_response(@answer_sheet) %></span>
|
64
66
|
<%- end -%>
|
65
67
|
<% else -%>
|
66
|
-
<%= render :
|
68
|
+
<%= render partial: "fe/questions/" + element.ptemplate, object: element %>
|
67
69
|
<% end -%>
|
68
70
|
</li>
|
69
71
|
<% element.choice_field_children.each do |choice_field_child| %>
|
70
|
-
<%= render
|
72
|
+
<%= render "fe/answer_sheets/element", element: choice_field_child %>
|
71
73
|
<% end %>
|
72
74
|
<% end -%>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="submission_errors">
|
2
|
-
<p><%= _(
|
2
|
+
<p><%= _("You still need to answer questions on the following pages:") %></p>
|
3
3
|
<ul>
|
4
4
|
<% @answer_sheet.pages.each do |page| %>
|
5
5
|
<% unless page.complete?(@answer_sheet) %>
|
@@ -1,7 +1,9 @@
|
|
1
|
-
|
2
|
-
<%
|
3
|
-
|
4
|
-
<%
|
5
|
-
|
6
|
-
<%=
|
7
|
-
|
1
|
+
<div class="application_section">
|
2
|
+
<% css_class = "" %>
|
3
|
+
<% if session[:attempted_submit] && page_link.page.has_questions? %>
|
4
|
+
<% css_class = page_link.page.complete?(@answer_sheet) ? "complete" : "incomplete" %>
|
5
|
+
<% end %>
|
6
|
+
<%= li_page_active_if(@presenter.active_page && page_link.page == @presenter.active_page, id: page_link.dom_id + "-li", class: css_class, style: ("display:none" if page_link.page.hidden?(@answer_sheet))) do %>
|
7
|
+
<%= link_to_function(page_link.label(session[:locale]), load_page_js(page_link), id: page_link.dom_id + "-link", "data-page-id" => page_link.dom_id, class: "page_link", href: page_link.load_path) %>
|
8
|
+
<% end -%>
|
9
|
+
</div>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<div id="panel-pages">
|
2
|
-
<h4><%= _(
|
2
|
+
<h4><%= _("Application Sections") %></h4>
|
3
3
|
<div id="page_ajax_spinner" style="display:none;">
|
4
4
|
<div>
|
5
|
-
<%= image_tag
|
5
|
+
<%= image_tag "fe/ajax-loader.gif" %> <%= _("Loading...") %>
|
6
6
|
</div>
|
7
7
|
</div>
|
8
8
|
<ul id="list-pages" class="navigation-list">
|
9
|
-
<%= render :
|
9
|
+
<%= render partial: "fe/answer_sheets/page_link", collection: @presenter.page_links %>
|
10
10
|
</ul>
|
11
11
|
</div>
|
@@ -1 +1 @@
|
|
1
|
-
<%= hidden_field_tag
|
1
|
+
<%= hidden_field_tag "submit_to", submit_fe_answer_sheet_path(@answer_sheet), id: "submit_to" %>
|
@@ -1 +1 @@
|
|
1
|
-
<h3 id=
|
1
|
+
<h3 id="sheet-name"><%= @presenter.sheet_title %></h3>
|
@@ -5,31 +5,31 @@
|
|
5
5
|
<% else %>
|
6
6
|
<div id="controls">
|
7
7
|
<div id="panel">
|
8
|
-
<%= render :
|
8
|
+
<%= render partial: "fe/answer_sheets/pages_list" %>
|
9
9
|
</div>
|
10
10
|
<div id="legend">
|
11
|
-
<%= image_tag(
|
12
|
-
<%= image_tag(
|
11
|
+
<%= image_tag("fe/icons/question-balloon.png") %> <%= _("Rolling over this symbol gives you help") %><br/>
|
12
|
+
<%= image_tag("fe/icons/star-small.png") %> <%= _("Marks a required field") %>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
|
16
16
|
<div id="preview">
|
17
|
-
<%= render :
|
18
|
-
<%= render :
|
17
|
+
<%= render partial: "fe/answer_sheets/title" %>
|
18
|
+
<%= render partial: "fe/answer_pages/answer_page", locals: { show_first: true } %>
|
19
19
|
</div>
|
20
20
|
|
21
21
|
<script type="text/javascript">
|
22
22
|
$(function() {
|
23
|
-
page_handler =
|
24
|
-
page_handler.initialize(
|
25
|
-
// Event.observe(window,
|
23
|
+
page_handler = fe.pageHandler;
|
24
|
+
page_handler.initialize("<%= @presenter.active_page_link.try(:dom_id) %>");
|
25
|
+
// Event.observe(window, "unload", page_handler.savePage);
|
26
26
|
|
27
|
-
// Validation.add(
|
27
|
+
// Validation.add("validate-phone", "Please enter a valid phone number +1-800-555-1234 x102", {
|
28
28
|
// pattern: /((\(\d{3}\)?)|(\d{3}))((\s|-|\.|\/)?)(\d{3})((\s|-|\.|\/)?)(\d{4})\s*([xX]|[eE][xX][tT])?\.?\s*\d*$/
|
29
29
|
// });
|
30
|
-
// Validation.add(
|
30
|
+
// Validation.add("validate-rating", "Please select one of the above options.", function(v,elm) {
|
31
31
|
// var p = elm.parentNode.parentNode;
|
32
|
-
// var options = p.getElementsByTagName(
|
32
|
+
// var options = p.getElementsByTagName("INPUT");
|
33
33
|
// return $A(options).any(function(elm) {
|
34
34
|
// return $F(elm);
|
35
35
|
// });
|
@@ -38,10 +38,10 @@
|
|
38
38
|
// global responders for all Ajax requests
|
39
39
|
$(function() {
|
40
40
|
$(document).ajaxStart(function() {
|
41
|
-
$(
|
42
|
-
$(
|
41
|
+
$("#page_ajax_spinner").show();
|
42
|
+
$("#page_ajax_spinner").css({top: $(window).scrollTop() + 200});
|
43
43
|
}).ajaxComplete(function() {
|
44
|
-
$(
|
44
|
+
$("#page_ajax_spinner").hide();
|
45
45
|
})
|
46
46
|
});
|
47
47
|
});
|
@@ -49,18 +49,18 @@
|
|
49
49
|
// Set up js for all question grids with totals
|
50
50
|
<% if @page %>
|
51
51
|
<% @page.question_sheet.pages.collect(&:question_grid_with_totals).flatten.each do |question_grid_with_total|
|
52
|
-
question_grid_with_total.total_cols.split(
|
52
|
+
question_grid_with_total.total_cols.split(",").collect(&:to_i).each do |col| -%>
|
53
53
|
try {
|
54
|
-
updateTotal(
|
54
|
+
updateTotal("<%= "#{question_grid_with_total.id}_#{col - 1}" %>");
|
55
55
|
$(".col_<%= "#{question_grid_with_total.id}_#{col - 1}" %>").change(function(e) {
|
56
|
-
updateTotal(
|
56
|
+
updateTotal("<%= "#{question_grid_with_total.id}_#{col - 1}" %>");
|
57
57
|
});
|
58
58
|
} catch(e) {}
|
59
59
|
<% end
|
60
60
|
end %>
|
61
61
|
<% end %>
|
62
62
|
}
|
63
|
-
$(function() { $(document).trigger(
|
63
|
+
$(function() { $(document).trigger("fePageLoaded"); });
|
64
64
|
</script>
|
65
65
|
<%= render "fe/answer_sheets/submit_to" %>
|
66
66
|
<% end %>
|
@@ -1,8 +1,11 @@
|
|
1
|
-
if ($('#submit_message').length == 0) {
|
1
|
+
if ($('#submit_message, .submit_message').length == 0) {
|
2
2
|
$("ul#questions_list").filter(":visible").append("<li><div id=\"submit_message\"></div></li>");
|
3
3
|
}
|
4
|
-
$('#submit_message').html('<%= escape_javascript(render(
|
4
|
+
$('#submit_message, .submit_message').html('<%= escape_javascript(render("incomplete")) %>')
|
5
5
|
<% @answer_sheet.pages.each do |page| %>
|
6
|
-
$
|
6
|
+
$page = $('<%= escape_javascript(render("fe/answer_sheets/page_link", page_link: @presenter.new_page_link(@answer_sheet, page))) %>');
|
7
|
+
<% id = "##{dom_id(@answer_sheet)}-#{dom_id(page)}-li" %>
|
8
|
+
$('<%= id %>').replaceWith($page.find('<%= id %>'));
|
7
9
|
<% end %>
|
8
|
-
$('#submit_message').show();
|
10
|
+
$('#submit_message, .submit_message').show();
|
11
|
+
$('#'+fe.pageHandler.current_page+'-li').addClass('active');
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<% for answer_sheet in @answer_sheets %>
|
10
10
|
<tr>
|
11
11
|
<td><%= link_to answer_sheet.question_sheet.label, edit_fe_answer_sheet_path(answer_sheet) %></td>
|
12
|
-
<td><%= link_to
|
12
|
+
<td><%= link_to "Review", fe_answer_sheet_path(answer_sheet), method: :get %></td>
|
13
13
|
</tr>
|
14
14
|
<% end %>
|
15
15
|
</table>
|
@@ -8,6 +8,6 @@
|
|
8
8
|
|
9
9
|
<div id="preview" class="answer-page">
|
10
10
|
|
11
|
-
<%= render :
|
11
|
+
<%= render partial: "fe/answer_sheets/answer_sheet", locals: {answer_sheet: @answer_sheet, elements: @elements } %>
|
12
12
|
|
13
13
|
</div>
|
@@ -1 +1 @@
|
|
1
|
-
<% if user_signed_in? %><%= link_to(_("Log Out"), destroy_user_session_path, { :
|
1
|
+
<% if user_signed_in? %><%= link_to(_("Log Out"), destroy_user_session_path, { method: :delete, style: "color: #fff;", id: "link-log-out" }) %><% end %>
|
@@ -1,13 +1,14 @@
|
|
1
|
-
<% css_class =
|
2
|
-
checked = acceptance.has_answer?(
|
3
|
-
|
4
|
-
|
1
|
+
<% css_class = "checkbox " + acceptance.validation_class(@answer_sheet, @page)
|
2
|
+
checked = acceptance.has_answer?("1", @answer_sheet)
|
3
|
+
locked = acceptance.locked?(params, @answer_sheet, @presenter, current_person)
|
4
|
+
%>
|
5
|
+
<%= check_box_tag "answers[#{acceptance.id}]", "1",
|
5
6
|
checked,
|
6
|
-
:
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
7
|
+
id: dom_id(acceptance),
|
8
|
+
class: css_class,
|
9
|
+
disabled: locked,
|
10
|
+
readonly: locked %>
|
10
11
|
<label class="choice" for="<%= dom_id(acceptance) %>">
|
11
12
|
<%= raw acceptance.label(session[:locale]) %>
|
12
13
|
</label>
|
13
|
-
<%= hidden_field_tag "answers[#{acceptance.id}]",
|
14
|
+
<%= hidden_field_tag "answers[#{acceptance.id}]", "", id: "" %>
|