From 57f83783d08d4138b8584ef1901a3bc586314338 Mon Sep 17 00:00:00 2001 From: Daniel Gergely Date: Wed, 25 Feb 2026 16:03:07 +0100 Subject: [PATCH 1/9] [T3022] REFACTOR: theme 2025 survey override - REFACTOR: changed survey route intercept from my to my2 - FEAT: survey_template now overrides default survey with 2025 theme components - CHORE: added theme_compassion_2025 to my_compassion_segmentation dependencies - REFACTOR: overriding default odoo survey styling - FEAT: added optional type and value to themed button --- my_compassion_segmentation/__manifest__.py | 1 + .../controllers/my_account.py | 2 +- .../templates/survey_templates.xml | 101 +++++++++++++++++- .../src/scss/components/_survey_form.scss | 79 ++++++++++++++ .../components/buttons/ThemedButton.xml | 4 + theme_compassion_2025/views/assets.xml | 5 + 6 files changed, 188 insertions(+), 4 deletions(-) create mode 100644 theme_compassion_2025/static/src/scss/components/_survey_form.scss diff --git a/my_compassion_segmentation/__manifest__.py b/my_compassion_segmentation/__manifest__.py index d0f42036c..246e145f5 100644 --- a/my_compassion_segmentation/__manifest__.py +++ b/my_compassion_segmentation/__manifest__.py @@ -39,6 +39,7 @@ ], "depends": [ "my_compassion", + "theme_compassion_2025", "partner_segmentation", ], "demo": [], diff --git a/my_compassion_segmentation/controllers/my_account.py b/my_compassion_segmentation/controllers/my_account.py index 09e3a4a07..8a10a47b6 100644 --- a/my_compassion_segmentation/controllers/my_account.py +++ b/my_compassion_segmentation/controllers/my_account.py @@ -12,7 +12,7 @@ class MyAccountControllerSurvey(CustomerPortal): - @route(["/my", "/my/home"], type="http", auth="user", website=True) + @route(["/my2", "/my2/home"], type="http", auth="user", website=True) def home(self, redirect=None, **post): partner = request.env.user.partner_id if not partner.has_segment: diff --git a/my_compassion_segmentation/templates/survey_templates.xml b/my_compassion_segmentation/templates/survey_templates.xml index f7f847cea..88462fa7b 100644 --- a/my_compassion_segmentation/templates/survey_templates.xml +++ b/my_compassion_segmentation/templates/survey_templates.xml @@ -1,10 +1,105 @@ + + + + + + + diff --git a/theme_compassion_2025/static/src/scss/components/_survey_form.scss b/theme_compassion_2025/static/src/scss/components/_survey_form.scss new file mode 100644 index 000000000..ff895e290 --- /dev/null +++ b/theme_compassion_2025/static/src/scss/components/_survey_form.scss @@ -0,0 +1,79 @@ +.o_survey_form .o_survey_question_text_box, .o_survey_form .o_survey_question_date, .o_survey_form .o_survey_question_datetime, .o_survey_form .o_survey_question_numerical_box, .o_survey_print .o_survey_question_text_box, .o_survey_print .o_survey_question_date, .o_survey_print .o_survey_question_datetime, .o_survey_print .o_survey_question_numerical_box, .o_survey_session_manage .o_survey_question_text_box, .o_survey_session_manage .o_survey_question_date, .o_survey_session_manage .o_survey_question_datetime, .o_survey_session_manage .o_survey_question_numerical_box, .o_survey_quick_access .o_survey_question_text_box, .o_survey_quick_access .o_survey_question_date, .o_survey_quick_access .o_survey_question_datetime, .o_survey_quick_access .o_survey_question_numerical_box { + border-bottom: 1px solid var(--mid-blue)!important; +} + +.o_survey_form .o_survey_choice_btn, .o_survey_print .o_survey_choice_btn, .o_survey_session_manage .o_survey_choice_btn, .o_survey_quick_access .o_survey_choice_btn { + color: var(--mid-blue)!important; +} + +.o_survey_form .o_survey_question_matrix th, .o_survey_session_manage .o_survey_question_matrix th { + background-color: var(--mid-blue)!important; +} + +.o_survey_form .o_survey_question_matrix td, .o_survey_session_manage .o_survey_question_matrix td { + background-color: var(--high-blue)!important; +} + +.o_survey_form .o_survey_question_matrix td:hover { + background-color: var(--high-blue)!important; +} + +.o_survey_matrix_btn.text-primary { + color: var(--low-blue)!important; +} + +td.o_survey_matrix_btn { + vertical-align: middle !important; + text-align: center !important; + padding: 0 !important; + + i { + display: block; + margin-left: auto; + margin-right: auto; + position: relative; + top: 0; + left: 0; + transform: none; + } + + .fa-check-circle { + margin-top: -1.2em; + } +} + +label.o_survey_choice_btn { + border-radius: 25px !important; + padding: 10px 15px !important; + background-color: var(--light-grey) !important; + box-shadow: #000000 0 0 0 0 !important; + display: flex; + justify-content: center; + align-items: center; + + & div { + display: none !important; + } + + & i { + display: none !important; + } + + & span { + color: var(--off-black) !important; + display: flex; + text-align: center; + } +} + +label.o_survey_choice_btn:hover { + background-color: var(--high-blue) !important; +} + +label.o_survey_choice_btn.o_survey_selected { + background-color: var(--mid-blue) !important; + + & span { + color: var(--pure-white) !important; + } +} \ No newline at end of file diff --git a/theme_compassion_2025/templates/components/buttons/ThemedButton.xml b/theme_compassion_2025/templates/components/buttons/ThemedButton.xml index fbe7a4a59..40f177c7c 100644 --- a/theme_compassion_2025/templates/components/buttons/ThemedButton.xml +++ b/theme_compassion_2025/templates/components/buttons/ThemedButton.xml @@ -32,6 +32,8 @@ - rel (string, optional): The rel attribute for the link (e.g., 'noopener noreferrer' for security). - data_toggle (char, optional): data-toggle attribute to be added to the button or link element, e.g., `data-toggle="dropdown"` + - type (string, optional): The type attribute for the button element (e.g., 'submit', 'button', 'reset'). + - value (string, optional): The value attribute for the button element. -->