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
3 changes: 2 additions & 1 deletion my_compassion/static/src/css/my2_donation_item.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.donation-item-container {
border-left: 5px solid;
container-type: inline-size;
container-name: donation-item-container;
font-size: 18px;
Expand All @@ -16,6 +15,8 @@

.donation-item-container .action-button {
cursor: pointer;
position: relative;
z-index: 1;
}

.donation-item-container .action-button:hover span {
Expand Down
146 changes: 71 additions & 75 deletions my_compassion/templates/components/my2_donation_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,25 @@
<!-- DONATION ITEM BUTTON -->
<template id="DonationItemButton" name="Donation Item Button">
<t t-set="color" t-value="button.get('color') or 'dark-blue'" />
<t t-if="button.get('action') == 'link'" t-set="onclick" t-valuef="location.href='#{button.get('href')}'" />
<t
t-if="button.get('action') == 'link'"
t-set="onclick"
t-valuef="event.stopPropagation(); location.href='#{button.get('href')}'"
/>
<t
t-elif="button.get('action') == 'event'"
t-set="onclick"
t-valuef="this.dispatchEvent(new CustomEvent('#{button.get('custom_event')}', {bubbles: true, detail: #{button.get('detail')}}))"
t-valuef="event.stopPropagation(); this.dispatchEvent(new CustomEvent('#{button.get('custom_event')}', {bubbles: true, detail: #{button.get('detail')}}))"
/>
<div t-attf-class="action-button #{button_top_class}" t-att-onclick="onclick">
<i t-if="button.get('icon')" t-attf-class="tiny-text icon-#{button.get('icon')} text-#{color}" />
<i t-if="button.get('pictogram')" t-attf-class="tiny-text #{button.get('pictogram')} text-#{color}" />
<span t-if="button.get('label')" t-attf-class="tiny-text bold text-#{color}">
<i
t-if="button.get('icon')"
t-attf-class="{{'' if large_icon else 'tiny-text'}} icon-#{button.get('icon')} text-#{color}"
/>
Comment thread
Danielgergely marked this conversation as resolved.
<span
t-if="button.get('label')"
t-attf-class="tiny-text {{'font-italic' if large_icon else ''}} bold text-#{color}"
>
<t t-esc="button.get('label')" />
</span>
</div>
Expand All @@ -72,22 +81,31 @@
t-attf-style="--image_url: url('#{image}');"
/>
</t>
<t t-set="redirect_link" t-value="redirect_link or ''" />
<t t-set="redirect_label" t-value="redirect_label or ''" />
<!-- Donation item container -->
<div
t-attf-class="donation-item-container p-2 d-flex rounded-lg bg-#{bg_color} border-#{accent_color} #{top_class}"
t-attf-class="donation-item-container d-flex bg-#{bg_color} border-#{accent_color} #{top_class} position-relative rounded-pill padding-pill"
t-attf-style="min-width: #{min_width}"
>
<t t-if="redirect_link">
<a t-attf-href="{{redirect_link}}" class="stretched-link" t-attf-aria-label="{{redirect_label}}" />
</t>
<div
t-attf-class="thumbnail responsive-lg mr-3 flex-shrink-0 rounded-lg #{not image and image_fallback_pictogram or ''}"
t-attf-style="--image_url: url('#{image}');"
/>
<!-- Donation details -->
<t t-if="not primary_button" t-raw="small_thumbnail_content" />
<div class="w-100 d-flex flex-column justify-content-between">
<!-- Donation Title -->
<div class="d-flex align-items-start">
<t t-if="primary_button" t-raw="small_thumbnail_content" />
<div class="flex-grow-1 d-flex flex-column">
<div t-attf-class="text-#{title_color} body-large bold">
<t t-esc="name" />
</div>
<!-- Donation recipient -->
<div t-if="recipient" t-attf-class="text-#{recipient_color} body-small bold">
To
<t t-esc="recipient" />
Expand All @@ -102,11 +120,13 @@
</t>
</t>
</div>
<!-- Donation edit -->
<div t-attf-class="mt-2 d-flex justify-content-#{'between' if primary_button else 'end'}">
<t t-if="primary_button" t-call="my_compassion.DonationItemButton">
<t t-set="button" t-value="primary_button" />
</t>
<div t-attf-class="text-#{price_color} ">
<!-- Donation price -->
<div t-attf-class="text-#{price_color} lead">
<t t-esc="currency_name" />
<t t-if="price % 1 == 0" t-set="price" t-value="'{0}.-'.format(int(price))" />
<t t-else="" t-set="price" t-value="'{0:.2f}'.format(price)" />
Expand All @@ -122,84 +142,60 @@
</div>
</template>
<template id="SponsorshipDonationItem" name="Sponsorship Donation Item">
<t t-set="label_see_profile">See profile</t>
<t t-set="label_see_more">See more</t>
<t t-if="sponsorship.type == 'CSP'">
<t t-set="product_template" t-value="sponsorship.contract_line_ids[:1].product_id.product_tmpl_id" />
<t t-if="product_template">
<t t-set="csp_my_compassion_name" t-value="product_template.my_compassion_name" />
<t t-set="csp_thanks_name" t-value="product_template.thanks_name" />
<t t-set="csp_default_name">Compassion survival program</t>
<t t-set="displayed_title" t-value="csp_my_compassion_name or csp_thanks_name or csp_default_name" />
<t
t-set="image_fallback_pictogram"
t-value="product_template.my_compassion_pictogram.class_name or 'pictogram-gift-donation-general'"
/>
<t t-if="product_template.is_published">
<t t-set="displayed_image" t-value="website.image_url(product_template, 'my_compassion_image')" />
<t
t-set="primary_button_data"
t-value="{
'label': label_see_more,
'pictogram': product_template.my_compassion_pictogram.class_name or 'pictogram-gift-donation-general',
'action': 'link',
'href': '/my2/gifts/' + str(product_template.id),
'color': 'low-blue'
}"
/>
</t>
<t
t-set="secondary_buttons_data"
t-value="[
{
'icon': 'download01',
'color': 'low-blue',
'action': 'link',
'href': '/my/download/csp_bvr?csp_id=' + str(sponsorship.id),
}
]"
/>
</t>
</t>
<t t-else="">
<t t-set="image_fallback_pictogram" t-value="'pictogram-child-sponsorship'" />
<t t-set="displayed_title" t-value="sponsorship.child_id.preferred_name" />
<t t-set="displayed_image" t-valuef="/web/image/compassion.child/#{sponsorship.child_id.id}/portrait" />
<t
t-set="primary_button_data"
t-value="{
'label': label_see_profile,
'pictogram': 'pictogram-child-sponsorship',
'action': 'link',
'href': '/my2/children/' + str(sponsorship.child_id.id),
'color': 'low-blue'
}"
/>
<t t-set="is_csp" t-value="sponsorship.type == 'CSP'" />
<!-- is Compassion Survival Program ? -->
<t t-set="pt" t-value="is_csp and sponsorship.contract_line_ids[:1].product_id.product_tmpl_id" />
<!-- product template -->
<t
t-set="name"
t-value="pt.my_compassion_name or pt.thanks_name or 'Compassion survival program' if is_csp else sponsorship.child_id.preferred_name"
/>
<t
t-set="image"
t-value="website.image_url(pt, 'my_compassion_image') if is_csp else '/web/image/compassion.child/%s/portrait' % sponsorship.child_id.id"
/>
<t
t-set="pictogram"
t-value="(pt.my_compassion_pictogram.class_name or 'pictogram-gift-donation-general') if is_csp else 'pictogram-child-sponsorship'"
/>
<t t-set="href" t-value="'/my2/gifts/%s' % pt.id if is_csp else '/my2/children/%s' % sponsorship.child_id.id" />
<!-- donations page or child profile page -->
<t t-call="my_compassion.DonationItemComponent">
<t t-set="image_fallback_pictogram" t-value="pictogram" />
<t t-set="name" t-value="name" />
<t t-set="image" t-value="image if not is_csp else ''" />
<t t-set="subtext" t-value="sponsorship.payment_mode_id.display_name" />
<t t-set="price" t-value="sponsorship.total_amount" />
<t t-if="is_csp" t-set="download_href" t-valuef="/my/download/csp_bvr?csp_id=#{sponsorship.id}" />
<t t-else="" t-set="download_href" t-valuef="/my/download/gift_bvr?child_id=#{sponsorship.child_id.id}" />
<t
t-set="secondary_buttons_data"
t-value="[
{
t-set="secondary_buttons"
t-value="[{
'icon': 'download01',
'color': 'low-blue',
'action': 'link',
'href': '/my/download/gift_bvr?child_id=' + str(sponsorship.child_id.id),
}
]"
'href': download_href,
}]"
/>
Comment thread
Danielgergely marked this conversation as resolved.
</t>
<t t-call="my_compassion.DonationItemComponent">
<t t-set="image_fallback_pictogram" t-value="image_fallback_pictogram" />
<t t-set="name" t-value="displayed_title" />
<t t-set="image" t-value="displayed_image" />
<t t-set="subtext" t-value="sponsorship.payment_mode_id.display_name" />
<t t-set="price" t-value="sponsorship.total_amount" />
<t t-set="primary_button" t-value="primary_button_data" />
<t t-set="secondary_buttons" t-value="secondary_buttons_data" />
<t t-set="monthly_noabbr" t-value="True" />
<t t-set="bg_color" t-value="'light-blue'" />
<t t-set="accent_color" t-value="'low-blue'" />
<t t-set="title_color" t-value="'low-blue'" />
<t t-set="price_color" t-value="'low-blue'" />
<t t-set="large_icon" t-value="True" />
<t t-if="not is_csp">
<t
t-set="primary_button"
t-value="{
'label': 'Click to see profile',
'action': 'link',
'href': href,
'color': 'low-blue'
}"
/>
<t t-set="redirect_link" t-value="href" />
<t t-set="redirect_label" t-value="'See child profile'" />
</t>
</t>
</template>
</odoo>
4 changes: 2 additions & 2 deletions my_compassion/templates/pages/my2_donation_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<div class="mt-3 ml-4 body-standard text-mid-brown">The reality...</div>
<t t-foreach="product.my_compassion_impact_before_ids" t-as="line">
<div class="mt-2 d-flex">
<i class="mr-2 icon-alert-circle text-mid-brown flex-shrink-0" />
<i class="mr-2 icon-alert-circle text-mid-brown flex-shrink-0 mt-1" />
<t t-esc="line.description" />
</div>
</t>
Expand All @@ -58,7 +58,7 @@
<div class="mt-3 ml-4 body-standard text-mid-green">With your help we can...</div>
<t t-foreach="product.my_compassion_impact_after_ids" t-as="line">
<div class="mt-2 d-flex">
<i class="mr-2 icon-check-heart text-mid-green flex-shrink-0" />
<i class="mr-2 icon-check-heart text-mid-green flex-shrink-0 mt-1" />
<t t-esc="line.description" />
</div>
</t>
Expand Down
14 changes: 7 additions & 7 deletions my_compassion/templates/pages/my2_gift_package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<t t-if="line.is_gift" t-set="recipient" t-value="line.gift_recipient_id.preferred_name" />
<t t-set="title_color" t-value="'low-black'" />
<t t-set="accent_color" t-value="'mid-green'" />
<t t-set="price_color" t-value="'low-green'" />
<t t-set="recipient_color" t-value="'low-green'" />
<t t-set="bg_color" t-value="'mid-eggshell'" />
<t t-set="price_color" t-value="'mid-green'" />
<t t-set="recipient_color" t-value="'mid-green'" />
<t t-set="bg_color" t-value="'low-eggshell'" />
<t t-set="price" t-value="line.price_total" />
<t t-set="currency_name" t-value="line.currency_id.name" />
<t
Expand All @@ -41,7 +41,7 @@
<t t-set="_txt_Edit_Details_1">Edit Details</t>
<t
t-set="primary_button"
t-value="{'icon': 'edit05', 'label': _txt_Edit_Details_1, 'color': 'low-green', 'action': 'event', 'custom_event': 'donation-item:edit', 'detail': {'order_line_id': line.id}}"
t-value="{'icon': 'edit05', 'label': _txt_Edit_Details_1, 'color': 'mid-green', 'action': 'event', 'custom_event': 'donation-item:edit', 'detail': {'order_line_id': line.id}}"
/>
<t
t-set="secondary_buttons"
Expand Down Expand Up @@ -107,10 +107,10 @@
<!-- TOTAL AMOUNT -->
<div
t-if="len(order.order_line) &gt;= 1"
class="mt-5 px-3 pt-3 pb-2 w-100 rounded-lg bg-light-green d-flex justify-content-between"
class="mt-5 w-100 bg-light-green d-flex justify-content-between rounded-pill padding-pill"
>
<div class="text-mid-green body-large bold">Total amount</div>
<div class="text-dark-blue body-large bold">
<div class="text-off-black body-large bold">Total amount</div>
<div class="text-off-black body-large bold d-flex align-items-center m-0">
<t t-set="amount" t-value="order.amount_total" />
<t t-esc="order.currency_id.name" />
<t t-if="amount % 1 == 0" t-esc="int(amount)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
<odoo>
<template id="ThemedButtonComponent_Content" name="Button Content">
<t t-if="icon">
<span t-attf-class="btn__icon #{'btn__icon--' + variant if label else ''} text-#{icon_color}">
<span
t-attf-class="btn__icon #{'btn__icon--' + variant if label else ''} text-#{icon_color} d-flex align-items-center justify-content-center"
>
<i t-att-class="icon" />
</span>
</t>
Expand Down
20 changes: 12 additions & 8 deletions theme_compassion_2025/views/footer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class="col-12 d-flex flex-column flex-lg-row justify-content-center align-items-center"
>
<div
class="py-1 px-lg-4 d-flex flex-column flex-lg-row align-items-center align-items-lg-start justify-content-center"
class="py-1 px-lg-4 d-flex flex-column flex-lg-row align-items-center justify-content-center"
>
<div class="mb-1 mb-lg-0 mr-lg-2" style="font-size: 1.2rem;">
<i class="icon-marker-pin01 bg-low-yellow text-primary" />
Expand Down Expand Up @@ -69,7 +69,7 @@
<section class="pt16">
<div class="container">
<div class="row align-items-center">
<div class="col-12 text-center mb-2">
<div class="col-12 text-center mb-3">
<p class="mb-0">
Copyright ©
<span t-esc="datetime.datetime.now().year" />
Expand All @@ -81,7 +81,7 @@
>
<div class="mb-2 mb-md-0">
<a
class="text-pure-white mr-3"
class="text-pure-white mr-0 mr-md-3"
href="https://compassion.ch/protection-des-donnees/"
target="_blank"
rel="noopener noreferrer"
Expand All @@ -90,36 +90,36 @@
</a>
<span class="d-none d-md-inline mr-3">|</span>
</div>
<div class="d-flex">
<div class="d-flex ml-1 mt-1 lead">
<a
href="https://www.facebook.com/compassionschweiz"
target="_blank"
rel="noopener noreferrer"
class="mr-3"
class="mr-3 ml-3 ml-md-0"
>
<i class="fa fa-facebook-official text-pure-white" />
</a>
<a
href="https://www.instagram.com/compassionswiss"
target="_blank"
rel="noopener noreferrer"
class="mr-3"
class="mr-3 ml-3 ml-md-0"
>
<i class="fa fa-instagram text-pure-white" />
</a>
<a
href="https://www.youtube.com/channel/UChVNRRvihHG0AYPsdEFfasQ"
target="_blank"
rel="noopener noreferrer"
class="mr-3"
class="mr-3 ml-3 ml-md-0"
>
<i class="fa fa-youtube-play text-pure-white" />
</a>
<a
href="https://vimeo.com/compassionswitzerland"
target="_blank"
rel="noopener noreferrer"
class="mr-3"
class="mr-3 ml-3 ml-md-0"
>
<i class="fa fa-vimeo text-pure-white" />
</a>
Expand All @@ -131,6 +131,10 @@
<i class="fa fa-linkedin text-pure-white" />
</a>
</div>
<div class="mt-2 mt-md-0">
<span class="d-none d-md-inline ml-3">|</span>
<a class="text-pure-white ml-0 ml-md-3" href="/contactus">Contact</a>
</div>
</div>
</div>
<div class="row">
Expand Down