From 52fd063a0da98f559a9cbb84ec8529b9a6b9b142 Mon Sep 17 00:00:00 2001 From: amdi-odoo Date: Thu, 4 Apr 2024 08:59:44 +0200 Subject: [PATCH] [IMP] survey: improve results page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a bunch of QOL improvements in the results page design: NB: In order to stay stable-compatible, using "d-none" to hide elements and using the "fs-x" class to resize the texts instead of changing the header tags. - Display the survey results page in half page size to prevent having too much blank space between the tables columns - The filter buttons are now displayed under the survey title - Set the print button as always visible even on smaller screen sizes - Show the leaderboard bar on the print preview - Changing the eye dropdown icon to a caret for fold/unfold - Align questions to the left to be on the same level as the sections - Add an horizontal scroll to the matrix and simple/multiple choices tables when the screen is not wide enough to display all the data - Reduce vertical spacing between elements to gain space - Reduce simple/multiple choices tables line height - Reduce survey title, section title and KPIs font size - Display the "Correct", "Partial", "Responded" and "Skipped" badges on a single line under the question and set a rounded border around each badges. - Fix the "Correct" and "Partial" display conditions - Removing the "Result Overview" title - Removing survey description, section description and question description - Rename the "Maximum", "Minimum" and "Average" badges to "Max", "Min" and "Avg" - When collapsed, hide the whole question on print preview - When collapsed, only show the question title and hide the KPIs Task-3707687 closes odoo/odoo#152263 Signed-off-by: Warnon Aurélien (awa) --- addons/survey/i18n/survey.pot | 41 +++++++ .../src/scss/survey_templates_results.scss | 17 +++ .../views/survey_templates_statistics.xml | 113 +++++++++--------- 3 files changed, 115 insertions(+), 56 deletions(-) diff --git a/addons/survey/i18n/survey.pot b/addons/survey/i18n/survey.pot index 6349db5ddae..985cefe3e32 100644 --- a/addons/survey/i18n/survey.pot +++ b/addons/survey/i18n/survey.pot @@ -390,6 +390,27 @@ msgid "" "" msgstr "" +#. module: survey +#: model_terms:ir.ui.view,arch_db:survey.question_result_number_or_date_or_datetime +msgid "" +"Avg " +"" +msgstr "" + +#. module: survey +#: model_terms:ir.ui.view,arch_db:survey.question_result_number_or_date_or_datetime +msgid "" +"Max " +"" +msgstr "" + +#. module: survey +#: model_terms:ir.ui.view,arch_db:survey.question_result_number_or_date_or_datetime +msgid "" +"Min " +"" +msgstr "" + #. module: survey #: model_terms:ir.ui.view,arch_db:survey.survey_page_statistics_question msgid "Responded" @@ -504,11 +525,31 @@ msgstr "" msgid "Registered" msgstr "" +#. module: survey +#: model_terms:ir.ui.view,arch_db:survey.survey_page_statistics_question +msgid "Responded" +msgstr "" + +#. module: survey +#: model_terms:ir.ui.view,arch_db:survey.survey_page_statistics_question +msgid "Skipped" +msgstr "" + #. module: survey #: model_terms:ir.ui.view,arch_db:survey.survey_survey_view_kanban msgid "Success" msgstr "" +#. module: survey +#: model_terms:ir.ui.view,arch_db:survey.survey_page_statistics_question +msgid "Correct" +msgstr "" + +#. module: survey +#: model_terms:ir.ui.view,arch_db:survey.survey_page_statistics_question +msgid "Partial" +msgstr "" + #. module: survey #: model_terms:ir.ui.view,arch_db:survey.survey_question_form msgid "Points" diff --git a/addons/survey/static/src/scss/survey_templates_results.scss b/addons/survey/static/src/scss/survey_templates_results.scss index eca02be84eb..f3c225149d9 100644 --- a/addons/survey/static/src/scss/survey_templates_results.scss +++ b/addons/survey/static/src/scss/survey_templates_results.scss @@ -23,6 +23,9 @@ border: none !important; } .o_survey_result { + // force to print background-images to render the leaderboard bar + -webkit-print-color-adjust: exact !important; /* Chrome, Safari */ + print-color-adjust: exact !important; /*Firefox*/ canvas { margin-bottom: 2rem; } @@ -38,6 +41,9 @@ .o_survey_results_question_wrapper:has(button.collapsed) { display: none; } + .o_survey_results_question_wrapper:has(div.collapsed) { + display: none !important; + } .o_survey_user_responses_table_wrapper { height: auto !important; } @@ -112,6 +118,14 @@ } .o_survey_results_question { + .o_survey_results_question_header { + div[aria-expanded="true"] i.fa-caret-right { + display: none; + } + div[aria-expanded="false"] i.fa-caret-down { + display: none; + } + } .o_survey_results_question_pill { .only_right_radius { border-radius: 0 2em 2em 0; @@ -136,6 +150,9 @@ cursor:default; } } + .collapse:not(.show) { + display: none !important; + } .nav-tabs .nav-link.active { background-color: transparent; border-color: #DEE2E6; diff --git a/addons/survey/views/survey_templates_statistics.xml b/addons/survey/views/survey_templates_statistics.xml index b394d14664a..36e2aaadad7 100644 --- a/addons/survey/views/survey_templates_statistics.xml +++ b/addons/survey/views/survey_templates_statistics.xml @@ -5,7 +5,7 @@ -
+
@@ -14,20 +14,20 @@ @@ -98,43 +98,44 @@ -
-
-
-