Skip to content

Commit

Permalink
Merge pull request #22 from CompassionCH/T1599-muskathlon-participant…
Browse files Browse the repository at this point in the history
…s-chosen-discipline

T1599 - Muskathlon Website - Participant’s chosen discipline
  • Loading branch information
NoeBerdoz authored Jul 18, 2024
2 parents 991552b + 1ca1ec3 commit 3cc8060
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 0 deletions.
2 changes: 2 additions & 0 deletions muskathlon/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"templates/muskathlon_page.xml",
"templates/muskathlon_registration_form.xml",
"templates/muskathlon_order_material.xml",
"templates/muskathlon_participants_list.xml",
"templates/muskathlon_participant_page.xml",
"templates/my_tasks_forms.xml",
"templates/donation_result.xml",
"templates/assets.xml",
Expand Down
5 changes: 5 additions & 0 deletions muskathlon/static/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@
.sport_icon.walk {
height: 38px;
}

.sport_icon_sm {
height: 25px;
width: 25px;
}
75 changes: 75 additions & 0 deletions muskathlon/templates/muskathlon_participant_page.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="muskathlon_participant_page"
inherit_id="website_event_compassion.participant_page"
>
<xpath expr="//div[@class='container']//figure/../.." position="after">
<t
t-set="discipline"
t-value="registration.sport_discipline_id.with_context(lang='en_US')"
/>
<t
t-set="discipline_loc"
t-value="registration.sport_discipline_id"
/>

<div
t-if="discipline.sport == 'Bike'"
class="mb-4"
t-att-title="discipline_loc.name"
align="center"
>
<img
class="sport_icon_sm"
src="/muskathlon/static/src/data/biking.png"
/>
<span class="distance_km"><t
t-esc="discipline.distance_km"
/>km</span>
</div>
<div
t-if="discipline.sport == 'Running'"
class="mb-4"
t-att-title="discipline_loc.name"
align="center"
>
<img
class="sport_icon_sm"
src="/muskathlon/static/src/data/running.png"
/>
<span class="distance_km"><t
t-esc="discipline.distance_km"
/>km</span>
</div>
<div
t-if="discipline.sport == 'Walking'"
class="mb-4"
t-att-title="discipline_loc.name"
align="center"
>
<img
class="sport_icon_sm"
src="/muskathlon/static/src/data/walking.png"
/>
<span class="distance_km"><t
t-esc="discipline.distance_km"
/>km</span>
</div>
<div
t-if="discipline.sport == 'Climbing'"
class="mb-4"
t-att-title="discipline_loc.name"
align="center"
>
<img
class="sport_icon_sm"
src="/muskathlon/static/src/data/climbing.png"
/>
<span class="distance_km"><t
t-esc="discipline.distance_km"
/>km</span>
</div>
</xpath>
</template>
</odoo>
71 changes: 71 additions & 0 deletions muskathlon/templates/muskathlon_participants_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="muskathlon_participants_list"
inherit_id="website_event_compassion.event_participants_list"
>
<xpath expr="//div[@class='card-title']/.." position="after">
<t
t-set="discipline"
t-value="registration.sport_discipline_id.with_context(lang='en_US')"
/>
<t
t-set="discipline_loc"
t-value="registration.sport_discipline_id"
/>

<div
t-if="discipline.sport == 'Bike'"
class="mb-3"
t-att-title="discipline_loc.name"
>
<img
class="sport_icon_sm"
src="/muskathlon/static/src/data/biking.png"
/>
<span class="distance_km"><t
t-esc="discipline.distance_km"
/>km</span>
</div>
<div
t-if="discipline.sport == 'Running'"
class="mb-3"
t-att-title="discipline_loc.name"
>
<img
class="sport_icon_sm"
src="/muskathlon/static/src/data/running.png"
/>
<span class="distance_km"><t
t-esc="discipline.distance_km"
/>km</span>
</div>
<div
t-if="discipline.sport == 'Walking'"
class="mb-3"
t-att-title="discipline_loc.name"
>
<img
class="sport_icon_sm"
src="/muskathlon/static/src/data/walking.png"
/>
<span class="distance_km"><t
t-esc="discipline.distance_km"
/>km</span>
</div>
<div
t-if="discipline.sport == 'Climbing'"
class="mb-3"
t-att-title="discipline_loc.name"
>
<img
class="sport_icon_sm"
src="/muskathlon/static/src/data/climbing.png"
/>
<span class="distance_km"><t
t-esc="discipline.distance_km"
/>km</span>
</div>
</xpath>
</template>
</odoo>

0 comments on commit 3cc8060

Please sign in to comment.