Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ sms_sponsorship/webapp/build
sms_sponsorship/webapp/.idea
/sbc_compassion/FPDF/.idea/
/sbc_compassion/FPDF/stderr.txt
*.DS_Store
1 change: 1 addition & 0 deletions my_compassion/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"views/correspondence_view.xml",
"views/correspondence_prewritten_letter.xml",
"views/my2_header_menu.xml",
"views/my2_bottom_nav.xml",
"data/signup_email_confirmation.xml",
"data/communication_config.xml",
"data/dynamic_stylesheets.xml",
Expand Down
9 changes: 9 additions & 0 deletions my_compassion/templates/pages/my2_child_letters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,15 @@
</t>
</div>
</t>
<!-- Floating round button shown only on mobile views -->
<a
id="write_button"
t-attf-href="/my2/children/letters/new#{('?child_id=' + str(filter_child.id)) if filter_child else ''}"
class="d-flex d-md-none align-items-center justify-content-center text-decoration-none"
aria-label="Write a letter"
>
<i class="pictogram-writing vignette-icon" />
</a>
</div>
</t>
</template>
Expand Down
86 changes: 86 additions & 0 deletions my_compassion/views/my2_bottom_nav.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="my2_mobile_app_layout" inherit_id="website.layout" name="My2 Mobile App Layout">
<xpath expr="//header" position="attributes">
<attribute
name="t-attf-class"
add="#{ 'd-none d-md-block' if request.session.uid and '/my2/' in request.httprequest.path else '' }"
separator=" "
/>
</xpath>
<xpath expr="//footer" position="attributes">
<attribute
name="t-attf-class"
add="#{ 'd-none d-md-block' if request.session.uid and '/my2/' in request.httprequest.path else '' }"
separator=" "
/>
</xpath>
<xpath expr="//div[@id='wrapwrap']" position="inside">
<t t-if="request.session.uid and '/my2/' in request.httprequest.path">
Comment thread
NoeBerdoz marked this conversation as resolved.
<div id="bottom_nav_spacer" class="d-block d-md-none w-100" />
<t t-set="partner" t-value="request.env.user.partner_id" />
<t t-set="tab_count" t-value="6 if partner.is_sponsor else 4" />
<nav
class="my2-bottom-nav d-flex d-md-none fixed-bottom bg-white border-top shadow-lg pt-2 pb-1"
t-attf-style="--tab-count: #{tab_count}"
>
<a
href="/my2/dashboard"
t-attf-class="nav-tab d-flex flex-column align-items-center text-decoration-none #{'active text-core-blue' if request.httprequest.path == '/my2/dashboard' else 'text-muted'}"
>
<i t-attf-class="pictogram-buildings-house vignette-icon" />
<span>Home</span>
</a>
<t t-if="partner.is_sponsor">
<a
href="/my2/children"
t-attf-class="nav-tab d-flex flex-column align-items-center text-decoration-none #{'active text-core-blue' if '/my2/children' in request.httprequest.path and 'letter' not in request.httprequest.path else 'text-muted'}"
>
<i t-attf-class="pictogram-child-sponsorship vignette-icon" />
<span>My Sponsorships</span>
</a>
<a
href="/my2/children/letters"
t-attf-class="nav-tab d-flex flex-column align-items-center text-decoration-none #{'active text-core-blue' if '/my2/children/letters' in request.httprequest.path else 'text-muted'}"
>
<i t-attf-class="pictogram-letter-writing vignette-icon" />
<span>Letters</span>
</a>
</t>
<a
href="/my2/gifts"
t-attf-class="nav-tab d-flex flex-column align-items-center text-decoration-none #{'active text-core-blue' if request.httprequest.path == '/my2/gifts' else 'text-muted'}"
>
<i t-attf-class="pictogram-gift-donation-general vignette-icon" />
<span>Give</span>
</a>
<a
href="/my2/gift-package"
t-attf-class="nav-tab o_wsale_my_cart d-flex flex-column align-items-center text-decoration-none #{'active text-core-blue' if '/my2/gift-package' in request.httprequest.path else 'text-muted'}"
>
<div class="position-relative">
<i t-attf-class="pictogram-gift-basket vignette-icon" />
<t t-set="website_sale_order" t-value="website.sale_get_order()" />
<sup
t-if="website_sale_order and website_sale_order.cart_quantity"
class="my_cart_quantity badge text-white"
t-esc="website_sale_order.cart_quantity"
/>
</div>
<span>Gift basket</span>
</a>
<a
href="/my2/user_settings"
t-attf-class="nav-tab d-flex flex-column align-items-center text-decoration-none #{'active text-core-blue' if '/my2/user_settings' in request.httprequest.path or '/my2/donations' in request.httprequest.path else 'text-muted'}"
>
<i t-attf-class="pictogram-profile vignette-icon" />
<span>Profile</span>
</a>
Comment on lines +32 to +78
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Hardcoded English strings — missing i18n

All nav-tab labels (Home, My Sponsorships, Letters, Give, Gift basket, Profile) are hardcoded English strings with no Odoo translation markup. For a multilingual Compassion website, these won't be translated. Odoo QWeb supports translation via the t-esc="_('...')" pattern or the t-translation attribute on plain text nodes.

Similarly for the other <span> labels in the nav and the aria-label="Write a letter" attribute on the #write_button in my2_child_letters.xml.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very true @Danielgergely And even more, there is no way for the user to switch its language anymore on mobile ! A solution has to be considered for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greptileai Great point, you could even have said that actually, the proposition removes the possibility for a mobile user to switch language, as they can't see the top menu anymore where the language selector is, which is a regression that should have been flagged.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're absolutely right, and that's a more critical regression than the i18n markup issue I flagged. The d-none d-md-block on the header (lines 6-9) doesn't just hide the nav — it removes the entire language selector for mobile users. That's a functional regression, not just a translation quality issue.

My original comment focused on the static string labels but should have explicitly called out that hiding the header breaks language switching for mobile users entirely. The two issues together mean mobile users are both stuck in whatever language they loaded the page in and have no way to change it.

A concrete fix worth flagging: the language switcher (and any other header-only controls) needs to either be surfaced in the bottom nav or in a dedicated mobile menu/settings area before the header can be safely hidden on small screens.

Tip: You can give me more context with .greptile/rules.md so I get this right next time.

<div class="indicator-wrapper">
<div class="indicator" />
</div>
</nav>
</t>
</xpath>
</template>
</odoo>
12 changes: 12 additions & 0 deletions theme_compassion_2025/data/pictograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
<field name="name">Food</field>
<field name="svg_file" type="base64" file="theme_compassion_2025/static/src/img/pictograms/Food.svg"/>
</record>
<record id="pictogram_gift_basket" model="theme.compassion.pictograms">
<field name="name">GiftBasket</field>
<field name="svg_file" type="base64" file="theme_compassion_2025/static/src/img/pictograms/GiftBasket.svg"/>
</record>
<record id="pictogram_gift_donation_general" model="theme.compassion.pictograms">
<field name="name">GiftDonationGeneral</field>
<field name="svg_file" type="base64" file="theme_compassion_2025/static/src/img/pictograms/GiftDonationGeneral.svg"/>
Expand Down Expand Up @@ -145,6 +149,10 @@
<field name="name">Neighbourhood</field>
<field name="svg_file" type="base64" file="theme_compassion_2025/static/src/img/pictograms/Neighbourhood.svg"/>
</record>
<record id="pictogram_profile" model="theme.compassion.pictograms">
<field name="name">Profile</field>
<field name="svg_file" type="base64" file="theme_compassion_2025/static/src/img/pictograms/Profile.svg"/>
</record>
<record id="pictogram_unsponsored_children" model="theme.compassion.pictograms">
<field name="name">UnsponsoredChildren</field>
<field name="svg_file" type="base64" file="theme_compassion_2025/static/src/img/pictograms/UnsponsoredChildren.svg"/>
Expand All @@ -161,5 +169,9 @@
<field name="name">WhereMostNeeded</field>
<field name="svg_file" type="base64" file="theme_compassion_2025/static/src/img/pictograms/WhereMostNeeded.svg"/>
</record>
<record id="pictogram_writing" model="theme.compassion.pictograms">
<field name="name">Writing</field>
<field name="svg_file" type="base64" file="theme_compassion_2025/static/src/img/pictograms/Writing.svg"/>
</record>
</data>
</odoo>
23 changes: 23 additions & 0 deletions theme_compassion_2025/static/src/img/pictograms/GiftBasket.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions theme_compassion_2025/static/src/img/pictograms/Profile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions theme_compassion_2025/static/src/img/pictograms/Writing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading