diff --git a/app/assets/javascripts/reports/new.js b/app/assets/javascripts/reports/new.js index c41da5c22..2d7e647f1 100644 --- a/app/assets/javascripts/reports/new.js +++ b/app/assets/javascripts/reports/new.js @@ -1015,6 +1015,31 @@ function reportHandsonTableConverter() { }); } + function initTaskContents() { + dropdownSelector.init('.task-contents-container .order-results', { + singleSelect: true, + closeOnSelect: true, + noEmptyOption: true, + selectAppearance: 'simple', + disableSearch: true + }); + + $('.task-contents-container') + .on('change', '.select-all-task-contents', function() { + $('.content-element .sci-checkbox:not(.skip-select-all)') + .prop('checked', this.checked); + }) + .on('change', '.protocol-steps-checkbox', function() { + $('.step-contents .sci-checkbox') + .prop('checked', this.checked); + }) + .on('change', '.all-results-checkbox', function() { + $('.results-type-contents .sci-checkbox:not(.skip-select-all)') + .prop('checked', this.checked); + }); + } + initReportWizard(); initDropdowns(); + initTaskContents(); }()); diff --git a/app/assets/stylesheets/reports/new.scss b/app/assets/stylesheets/reports/new.scss index 5166c56be..ede2922fe 100644 --- a/app/assets/stylesheets/reports/new.scss +++ b/app/assets/stylesheets/reports/new.scss @@ -232,6 +232,7 @@ } } + .report-template-values-container { background: $color-white; box-shadow: $modal-shadow; @@ -259,6 +260,88 @@ padding: .5em; } } + + .task-contents-container { + background: $color-white; + box-shadow: $modal-shadow; + margin: 2em 20%; + padding: 1em 2em; + width: 60%; + + .divider { + background: $color-alto; + height: 1px; + margin-top: 1em; + width: 100%; + } + + .select-all-container { + @include font-h2; + line-height: 1em; + } + + ul { + list-style-type: none; + padding-left: 1em; + + li { + @include font-h2; + line-height: 1em; + padding-top: 1em; + } + + .content-element-title { + @include font-h1; + margin-bottom: 1em; + } + } + + .all-results-container { + align-items: flex-start; + display: flex; + + .results-order-contaner { + margin-top: .5em; + + label { + @include font-small; + } + } + } + + .file-result-title-container { + align-items: flex-start; + display: flex; + + .include-pages-container { + @include font-button; + font-weight: normal; + line-height: 1.2em; + margin-top: 1em; + + .fa-exclamation-triangle { + color: $brand-warning; + margin-top: .5em; + } + } + } + + .sci-checkbox-container { + float: left; + margin-right: .25em; + } + + .title { + @include font-h1; + margin-bottom: 1em; + } + + .protocol-contents, + .result-contents, + .additional-contents { + margin-top: 1em; + } + } } @media (max-width: 960px) { @@ -273,5 +356,10 @@ margin: 2em 1em; width: calc(100% - 2em); } + + .task-contents-container { + margin: 2em 1em; + width: calc(100% - 2em); + } } } diff --git a/app/views/reports/new.html.erb b/app/views/reports/new.html.erb index b1cdf6c1c..4dd22b788 100644 --- a/app/views/reports/new.html.erb +++ b/app/views/reports/new.html.erb @@ -22,7 +22,7 @@ Step 2
- Step 3 + <%= render partial: 'reports/wizard/third_step' %>
diff --git a/app/views/reports/wizard/_third_step.html.erb b/app/views/reports/wizard/_third_step.html.erb new file mode 100644 index 000000000..808c742ee --- /dev/null +++ b/app/views/reports/wizard/_third_step.html.erb @@ -0,0 +1,146 @@ +
+
+ <%= t("projects.reports.wizard.third_step.title") %> +
+
+ + + + + <%= t("projects.reports.wizard.third_step.select_all") %> +
+
+ +
diff --git a/config/locales/en.yml b/config/locales/en.yml index 2de621e11..4c8c6d379 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -536,10 +536,39 @@ en: footer: "Footer" no_values_title: "No additional data requiered" no_values_description: "SciNote template doesn’t need any additional input for it to be succesfully generated." + third_step: + title: "Select task contents" + select_all: "Select all content" + task_protocol: "Task protocol" + protocol_description: "Protocol description" + protocol_step: "Protocol steps" + completed_steps: "Completed steps" + uncompleted_steps: "Uncompleted steps" + step_checklists: "Step checklists" + step_files: "Step files" + step_tables: "Step tables" + step_comments: "Step comments" + results: "Results" + all_results: "Include all results" + order_results: "Order results" + atoz: "Alphabetically A to Z" + ztoa: "Alphabetically Z to A" + new_results: "Newest first" + old_results: "Oldest first" + file_results: "File results" + insert_pages_from_pdf: "Insert pages from PDF and docx files into the report" + pdf_warning: "This may increase report generation time." + table_results: "Table results" + text_results: "Text results" + results_comments: "Include all result comments" + additional_content: "Additional content" + task_activity: "Include task activity" + new: report_name_placeholder: "Name your report" continue_button: "Continue" generate_button: "Start generating" + head_title: "%{project} | New report" nav_title: "Report for: " nav_print: "Print"