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