GOLEM/golem_activity_registration/report/golem_member_card_templates.xml

74 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2018 Michel Dessenne <michel@yaltik.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<odoo>
<template id="golem_member_card_template_inherit_golem_activity_resgitration"
inherit_id="golem_member.golem_member_card_template">
<xpath expr="//div[@id='page_report_member']" postion="inside">
<h3>Activities</h3>
<p t-if="not member.activity_registration_ids">
On default season, there is no activity for this member.
</p>
<table t-else="" id="table_activity_ref" class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Animator</th>
<th>Day</th>
<th class="text-right">Hours</th>
<th class="text-right">Dates</th>
</tr>
</thead>
<tbody>
<tr t-foreach="member.activity_registration_ids" t-as="reg">
<td>
<span t-field="reg.activity_id.name" />
</td>
<td>
<span t-field="reg.activity_id.type_id.name" />
</td>
<td>
<span t-field="reg.activity_id.animator_id" />
</td>
<td>
<span t-field="reg.activity_id.weekday" />
</td>
<td class="text-right">
<t t-esc="'%02d:%02d' % (int(reg.activity_id.hour_start), round(reg.activity_id.hour_start % 1 * 60))" />
-
<t t-esc="'%02d:%02d' % (int(reg.activity_id.hour_stop), round(reg.activity_id.hour_stop % 1 * 60))" />
</td>
<td class="text-right">
<span t-if="reg.activity_id.is_fullseason" t-field="season.date_start" />
<span t-else="" t-field="reg.activity_id.date_start" />
-
<span t-if="reg.activity_id.is_fullseason" t-field="season.date_end" />
<span t-else="" t-field="reg.activity_id.date_stop" />
</td>
</tr>
</tbody>
</table>
</xpath>
</template>
</odoo>