diff --git a/my_compassion/templates/footer_links.xml b/my_compassion/templates/footer_links.xml new file mode 100644 index 00000000..e9b940ff --- /dev/null +++ b/my_compassion/templates/footer_links.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/my_compassion_segmentation/__manifest__.py b/my_compassion_segmentation/__manifest__.py index d0f42036..246e145f 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 09e3a4a0..a85e2549 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(["/my", "/my2", "/my/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 f7f847ce..b432e18b 100644 --- a/my_compassion_segmentation/templates/survey_templates.xml +++ b/my_compassion_segmentation/templates/survey_templates.xml @@ -1,10 +1,148 @@ - - - - Ask me again later + + + + + + + + + + + + + + + + + + + + + + col-12 + + + + + + + + + + + + + + + + + + Start Survey + + + + + + + + + + Ask me again later + + + + + + + + + + + + + + + + + + + + + + d-none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'width: ' + str(percentage) + '%; --flow-speed: 10s;' + + diff --git a/theme_compassion_2025/static/src/scss/components/_progress_bar.scss b/theme_compassion_2025/static/src/scss/components/_progress_bar.scss index 1e480bd1..86eba69b 100644 --- a/theme_compassion_2025/static/src/scss/components/_progress_bar.scss +++ b/theme_compassion_2025/static/src/scss/components/_progress_bar.scss @@ -61,6 +61,22 @@ $num-colors: length($color-pattern); background-position: -200% 0%; } 100% { - background-position: 0% 0%; + background-position: 0 0; + } +} + +/* For native-width odoo progress bars */ +.o_survey_progress_wrapper { + min-width: calc(100vw - 3rem)!important; +} +.progress-bar-container.native-width { + height: 5px; + + .progress-bar.is-flowing { + /* Use 100vw to anchor the gradient to the screen so it doesn't compress */ + background-size: 100vw 100%; + transition: width 0.5s ease-out; + + &.density-low { background-image: create-gradient(0); } } } 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 00000000..edf184f7 --- /dev/null +++ b/theme_compassion_2025/static/src/scss/components/_survey_form.scss @@ -0,0 +1,106 @@ +/* ============================================================================ + MyCompassion 2025 Theme - Survey Overrides + ============================================================================ + This file overrides the default Odoo 14 Survey module styling to match + the MyCompassion 2.0 design system. + ============================================================================ */ + +/* Transforms standard boxed inputs into minimal "bottom-border only" inputs */ +.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; +} + +/* Sets the default text color for standard survey choice options. */ +.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; +} + +/* Applies the primary theme color to the top row and left column headers. */ +.o_survey_form .o_survey_question_matrix th, .o_survey_session_manage .o_survey_question_matrix th { + background-color: var(--mid-blue)!important; +} + +/* Sets the default background color for the clickable matrix cells. */ +.o_survey_form .o_survey_question_matrix td, .o_survey_session_manage .o_survey_question_matrix td { + background-color: var(--high-blue)!important; +} + +/* Overrides table row hover effect. */ +.o_survey_form .o_survey_question_matrix td:hover { + background-color: var(--high-blue)!important; +} + +/* Forces the active/selected radio icon to use the theme's low-blue. */ +.o_survey_matrix_btn.text-primary { + color: var(--low-blue)!important; +} + +/* Centers the radio icons within the matrix cells and adjusts the checkmark position. */ +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; + } +} + +/* Transforms the standard survey choice buttons into pill-shaped options with centered text. */ +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; + + /* Hides the Odoo selection key letters (A, B, C...) */ + & div { + display: none !important; + } + + /* Hides the FontAwesome radio/checkbox icons */ + & i { + display: none !important; + } + + /* Centers and styles the actual answer text */ + & span { + color: var(--off-black) !important; + display: flex; + text-align: center; + } +} + +/* Adds a subtle visual highlight when a user mouses over an unselected option. */ +label.o_survey_choice_btn:hover { + background-color: var(--high-blue) !important; +} + +/* Highlights the chosen answer(s) with a solid theme color and white text. */ +label.o_survey_choice_btn.o_survey_selected { + background-color: var(--mid-blue) !important; + + & span { + color: var(--pure-white) !important; + } +} + +/* Hide default done button */ +.done-description { + a.btn, .mt-4 { + display: none!important; + } +} diff --git a/theme_compassion_2025/templates/components/buttons/ThemedButton.xml b/theme_compassion_2025/templates/components/buttons/ThemedButton.xml index 2c4537cc..5a475ffa 100644 --- a/theme_compassion_2025/templates/components/buttons/ThemedButton.xml +++ b/theme_compassion_2025/templates/components/buttons/ThemedButton.xml @@ -33,6 +33,8 @@ for security). - data_toggle (char, optional): data-toggle attribute to be added to the button or link element, e.g., `data-toggle="dropdown"` - add_class (string, optional): An optional class which will be added to the button + - 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. --> @@ -87,7 +89,7 @@ diff --git a/theme_compassion_2025/views/assets.xml b/theme_compassion_2025/views/assets.xml index f982f031..29c3f869 100644 --- a/theme_compassion_2025/views/assets.xml +++ b/theme_compassion_2025/views/assets.xml @@ -94,6 +94,11 @@ type="text/scss" href="/theme_compassion_2025/static/src/scss/components/_progress_bar.scss" /> + diff --git a/theme_compassion_2025/views/footer.xml b/theme_compassion_2025/views/footer.xml index 122418f8..f5bd7283 100644 --- a/theme_compassion_2025/views/footer.xml +++ b/theme_compassion_2025/views/footer.xml @@ -1,5 +1,8 @@ + + + @@ -12,6 +15,7 @@ + diff --git a/theme_compassion_2025/views/template_header.xml b/theme_compassion_2025/views/template_header.xml index e9da89d2..5b2fbb2d 100644 --- a/theme_compassion_2025/views/template_header.xml +++ b/theme_compassion_2025/views/template_header.xml @@ -52,11 +52,9 @@ - -