-
Notifications
You must be signed in to change notification settings - Fork 10
T3022 survey #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Danielgergely
wants to merge
10
commits into
14.0
Choose a base branch
from
T3022-survey
base: 14.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
T3022 survey #293
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
57f8378
[T3022] REFACTOR: theme 2025 survey override
Danielgergely 6bb2a7e
[T3022] REFACTOR: survey template override finishing touches
Danielgergely ff63eed
[T3022] FIX: re-added /my routes to be safe
Danielgergely e4d61a7
[T3022] FIX: pre-commit complained again
Danielgergely 346ff38
[T3022] FEAT: added useful links to footer
Danielgergely 065dc31
[T3022] FIX: added minimal margin to themed button
Danielgergely 4974b76
[T3022] REFACTOR: moved footer from views to templates
Danielgergely 6368226
[T3022] FIX: removed dynamic footer links from manifest
Danielgergely 25c2d57
Merge branch '14.0' into T3022-survey
Danielgergely 34e7442
[T3022] FIX: requested changes
Danielgergely File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <odoo> | ||
| <template | ||
| id="my2_compassion_footer_links" | ||
| inherit_id="theme_compassion_2025.compassion_footer_hook" | ||
| name="My Compassion Footer Links" | ||
| > | ||
| <xpath expr="//div[@id='compassion_dynamic_footer_links']" position="inside"> | ||
| <t t-set="partner" t-value="request.env.user.partner_id" /> | ||
| <t t-if="partner and partner.primary_segment_id.link_ids"> | ||
| <section class="footer-my-compassion-links pt48"> | ||
| <div class="container"> | ||
| <div class="row"> | ||
| <div class="col-12 d-flex flex-column justify-content-center align-items-center"> | ||
| <div | ||
| id="personal-links-container" | ||
| class="w-100 d-flex flex-row flex-wrap justify-content-center" | ||
| > | ||
| <t t-foreach="partner.primary_segment_id.link_ids" t-as="segment_link"> | ||
| <t | ||
| t-if="not segment_link.language_id or segment_link.language_id.code == request.env.lang or segment_link.language_id.code == 'en_US'" | ||
| > | ||
| <a t-att-href="segment_link.url" class="text-pure-white mx-3 mb-2 mb-md-0"> | ||
| <t t-esc="segment_link.label" /> | ||
| </a> | ||
| </t> | ||
| </t> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div | ||
| id="links-separator" | ||
| class="mt48 mb24 ml-auto mr-auto border-bottom border-white" | ||
| style="width: 100px;" | ||
| /> | ||
| </section> | ||
| </t> | ||
| </xpath> | ||
| </template> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ | |
| ], | ||
| "depends": [ | ||
| "my_compassion", | ||
| "theme_compassion_2025", | ||
| "partner_segmentation", | ||
| ], | ||
| "demo": [], | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 142 additions & 4 deletions
146
my_compassion_segmentation/templates/survey_templates.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,148 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <odoo> | ||
| <template id="custom_survey_layout" inherit_id="survey.survey_fill_form_start"> | ||
| <xpath expr="//div[@class='wrap o_survey_start']/div"> | ||
| <t t-if="survey == survey.env.ref('partner_segmentation.partner_segmentation_survey')"> | ||
| <a role="button" class="btn btn-light btn-lg" href="/my/children">Ask me again later</a> | ||
| <!-- Hide odoo branding --> | ||
| <template id="custom_survey_layout" inherit_id="survey.layout"> | ||
| <xpath expr="//div[@t-call='web.brand_promotion_message']" position="attributes"> | ||
| <attribute name="class" add="d-none" separator=" " /> | ||
| </xpath> | ||
| <xpath expr="//div[hasclass('o_survey_brand_message')]" position="attributes"> | ||
| <attribute name="class" add="d-none" separator=" " /> | ||
| </xpath> | ||
| </template> | ||
| <!-- Add padding to the survey start page --> | ||
| <template id="custom_survey_page_fill" inherit_id="survey.survey_page_fill"> | ||
| <xpath expr="//div[@class='wrap o_survey_wrap d-flex']" position="attributes"> | ||
| <attribute name="class" add="p-4 p-md-5" separator=" " /> | ||
| </xpath> | ||
| </template> | ||
| <!-- Apply 2025 theme to the title --> | ||
| <template id="custom_survey_fill_header" inherit_id="survey.survey_fill_header"> | ||
| <xpath expr="//h1[hasclass('o_survey_main_title')]" position="attributes"> | ||
| <attribute name="class" add="d-none" separator=" " /> | ||
| </xpath> | ||
| <xpath expr="//div[hasclass('col-lg-10')]" position="attributes"> | ||
| <attribute name="class">col-12</attribute> | ||
| </xpath> | ||
| <xpath expr="//div[hasclass('o_survey_timer')]" position="attributes"> | ||
| <attribute name="class" add="d-none" separator=" " /> | ||
| </xpath> | ||
| <xpath expr="//h1[hasclass('o_survey_main_title')]" position="after"> | ||
| <t t-call="theme_compassion_2025.TitleComponent"> | ||
| <t t-set="title_size" t-value="'lg'" /> | ||
| <t t-set="title_content" t-value="survey.title" /> | ||
| <t t-set="color" t-value="'core-blue'" /> | ||
| </t> | ||
| </xpath> | ||
| </template> | ||
| <template id="custom_survey_fill_form_start" inherit_id="survey.survey_fill_form_start"> | ||
| <!-- Replace buttons with 2025 theme buttons --> | ||
| <xpath expr="//button[hasclass('btn')]" position="attributes"> | ||
| <attribute name="class" add="d-none" separator=" " /> | ||
| </xpath> | ||
| <xpath expr="//button[hasclass('btn')]" position="after"> | ||
| <div class="d-flex flex-column flex-sm-row mt-4 justify-content-around align-items-center"> | ||
| <t t-call="theme_compassion_2025.ThemedButtonComponent"> | ||
| <t t-set="label">Start Survey</t> | ||
| <t t-set="variant" t-value="'impact'" /> | ||
| <t t-set="variation" t-value="'filled'" /> | ||
| <t t-set="color" t-value="'core-blue'" /> | ||
| <t t-set="text_color" t-value="'pure-white'" /> | ||
| <t t-set="type" t-value="'submit'" /> | ||
| </t> | ||
| <!-- Add an 'Ask me again later' button to the survey start page --> | ||
| <t t-if="survey == survey.env.ref('partner_segmentation.partner_segmentation_survey')"> | ||
| <t t-call="theme_compassion_2025.ThemedButtonComponent"> | ||
| <t t-set="label">Ask me again later</t> | ||
| <t t-set="variant" t-value="'impact'" /> | ||
| <t t-set="variation" t-value="'filled'" /> | ||
| <t t-set="color" t-value="'light-grey'" /> | ||
| <t t-set="text_color" t-value="'off-black'" /> | ||
| <t t-set="href" t-value="'/my2/dashboard'" /> | ||
| </t> | ||
| </t> | ||
| </div> | ||
| </xpath> | ||
| <!-- Hide 'or press Enter' --> | ||
| <xpath expr="//span[hasclass('o_survey_enter')]" position="attributes"> | ||
| <attribute name="class" add="d-none" separator=" " /> | ||
| </xpath> | ||
| </template> | ||
| <!-- Replace 'continue' button with themed version --> | ||
| <template id="custom_survey_fill_form_in_progress" inherit_id="survey.survey_fill_form_in_progress"> | ||
| <xpath expr="(//button[@type='submit'])[3]" position="attributes"> | ||
| <attribute name="class" add="d-none" separator=" " /> | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </xpath> | ||
| <!-- Hide 'or press Enter' --> | ||
| <xpath | ||
| expr="(//button[@type='submit'])[3]/following-sibling::span[hasclass('text-muted')]" | ||
| position="attributes" | ||
| > | ||
| <attribute name="class">d-none</attribute> | ||
| </xpath> | ||
| <xpath expr="(//button[@type='submit'])[3]" position="after"> | ||
| <div class="d-flex justify-content-end"> | ||
| <t t-call="theme_compassion_2025.ThemedButtonComponent"> | ||
| <t | ||
| t-set="label" | ||
| t-value="'Submit' if survey.questions_layout == 'one_page' or survey_last else 'Continue'" | ||
| /> | ||
| <t t-set="variant" t-value="'impact'" /> | ||
| <t t-set="variation" t-value="'filled'" /> | ||
| <t t-set="color" t-value="'core-blue'" /> | ||
| <t t-set="text_color" t-value="'pure-white'" /> | ||
| <t t-set="type" t-value="'submit'" /> | ||
| <t | ||
| t-set="value" | ||
| t-value="'finish' if survey.questions_layout == 'one_page' or survey_last else 'next'" | ||
| /> | ||
| </t> | ||
| </div> | ||
| </xpath> | ||
| </template> | ||
| <!-- Thank you page --> | ||
| <template id="custom_survey_fill_form_done" inherit_id="survey.survey_fill_form_done"> | ||
| <xpath expr="//div[hasclass('o_survey_finished')]" position="attributes"> | ||
| <attribute name="class" add="d-none" separator=" " /> | ||
| </xpath> | ||
| <xpath expr="//div[hasclass('o_survey_finished')]" position="after"> | ||
| <!-- Extract href and label from survey.description_done if the exist --> | ||
| <t | ||
| t-set="extracted_href" | ||
| t-value="survey.description_done.split('href=\"')[1].split('\"')[0] if 'href=\"' in survey.description_done else '/my/home'" | ||
| /> | ||
| <t | ||
| t-set="extracted_label" | ||
| t-value="survey.description_done.split('</a')[0].split('>')[-1] if survey.description_done and '</a' in survey.description_done else 'Continue'" | ||
| /> | ||
| <t t-call="theme_compassion_2025.TitleComponent"> | ||
| <t t-set="title_content" t-value="'Thank you!'" /> | ||
| <t t-set="color" t-value="'core-blue'" /> | ||
| <t t-set="show_underline" t-value="True" /> | ||
| <t t-set="underline_color" t-value="'low-yellow'" /> | ||
| <t t-set="description" t-value="False" /> | ||
| <div class="title-description text-low-black done-description"> | ||
| <t t-raw="survey.description_done" /> | ||
| </div> | ||
| <div class="text-center mt-5"> | ||
| <!-- Add styled continue button --> | ||
| <t t-call="theme_compassion_2025.ThemedButtonComponent"> | ||
| <t t-set="label" t-value="extracted_label" /> | ||
| <t t-set="href" t-value="extracted_href" /> | ||
| <t t-set="variant" t-value="'impact'" /> | ||
| <t t-set="variation" t-value="'filled'" /> | ||
| </t> | ||
| </div> | ||
| </t> | ||
| </xpath> | ||
| </template> | ||
| <!-- Overwrite odoo progres bar --> | ||
| <template id="custom_survey_progression" inherit_id="survey.survey_progression"> | ||
| <xpath expr="//div[hasclass('o_survey_progress')]" position="attributes"> | ||
| <attribute name="class" add="progress-bar-container native-width" separator=" " /> | ||
| </xpath> | ||
| <xpath expr="//div[hasclass('progress-bar')]" position="attributes"> | ||
| <attribute name="class" remove="bg-primary" add="is-flowing density-low" separator=" " /> | ||
| <attribute name="t-att-style">'width: ' + str(percentage) + '%; --flow-speed: 10s;'</attribute> | ||
| </xpath> | ||
| </template> | ||
| </odoo> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
theme_compassion_2025/static/src/scss/components/_survey_form.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /* 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; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /* 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; | ||
| } | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /* 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; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /* Overrides table row hover effect. */ | ||
| .o_survey_form .o_survey_question_matrix td:hover { | ||
| background-color: var(--high-blue)!important; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /* Forces the active/selected radio icon to use the theme's low-blue. */ | ||
| .o_survey_matrix_btn.text-primary { | ||
| color: var(--low-blue)!important; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /* 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; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
|
|
||
| /* Hides the Odoo selection key letters (A, B, C...) */ | ||
| & div { | ||
| display: none !important; | ||
| } | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /* Hides the FontAwesome radio/checkbox icons */ | ||
| & i { | ||
| display: none !important; | ||
| } | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /* Centers and styles the actual answer text */ | ||
| & span { | ||
| color: var(--off-black) !important; | ||
| display: flex; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /* 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; | ||
Danielgergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| & span { | ||
| color: var(--pure-white) !important; | ||
| } | ||
| } | ||
|
|
||
| /* Hide default done button */ | ||
| .done-description { | ||
| a.btn, .mt-4 { | ||
| display: none!important; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.