Browse Source

mediatheque

dev-rcn
root 3 years ago
parent
commit
ed92c3ffe0
4 changed files with 27 additions and 101 deletions
  1. +3
    -0
      models/event.py
  2. +3
    -0
      views/event.xml
  3. +0
    -86
      views/event_templates_page_registration.xml
  4. +21
    -15
      views/mediatheque.xml

+ 3
- 0
models/event.py View File

@ -425,6 +425,9 @@ class KalachakraEvent(models.Model):
)
teaching_html_content_records=fields.Html('teaching content records')
teaching_html_content_records_published=fields.Boolean('publish html content')
display_english_records=fields.Boolean('display english records',default=True)
# only_audio_records=fields.Boolean('only audio records',default=False)
# only_video_records=fields.Boolean('only video records',default=False)
def add_registration_to_mailing_list(self):
registrants=self.env['event.registration'].search([('event_id','=',int(self.id))])
if registrants:


+ 3
- 0
views/event.xml View File

@ -176,6 +176,9 @@
<group style="width:100%%">
<field name="teaching_html_content_records_published"/>
<field name="teaching_html_content_records"/>
<field name="display_english_records"/>
<!-- <field name="only_audio_records"/>
<field name="only_video_records"/> -->
<field name="teaching_day_ids">
<tree>
<field name="sequence" widget="handle"/>


+ 0
- 86
views/event_templates_page_registration.xml View File

@ -47,92 +47,6 @@
</template>
<template id="kalachakra.event_description_full" inherit_id="website_event.event_description_full">
<xpath expr="//span[@itemprop='description']" position="before">
<t t-if="event.teaching_day_ids">
<h6 style="background-color: orange;">Enregistrements disponibles :</h6>
<t t-foreach="event.teaching_day_ids.sorted(key=lambda r: r.sequence)" t-as="t_day">
<t t-if="t_day.teaching_session_ids">
<table class="table" style="font-size: smaller;">
<tr>
<td colspan="3"><span t-esc="t_day.day_teaching"/></td>
<td colspan="3"><span t-esc="t_day.day_teaching"/></td>
</tr>
<tr>
<td>Session</td>
<td colspan="2">En français</td>
<td colspan="2">In english</td>
<td>Session</td>
</tr>
<tr>
<td></td>
<td>Audio</td>
<td>Video</td>
<td>Audio</td>
<td>Video</td>
<td></td>
</tr>
<t t-foreach="t_day.teaching_session_ids" t-as="media">
<tr>
<td><span t-esc="media.description_fr" /></td>
<t t-if="media.link_audio_fr">
<td><a t-attf-href="#{media.link_audio_fr}"><span>Audio FR</span></a></td>
</t>
<t t-if="not media.link_audio_fr">
<td>
</td>
</t>
<t t-if="media.link_video_fr">
<td><a t-attf-href="#{media.link_video_fr}"><span>Video FR</span></a></td>
</t>
<t t-if="not media.link_video_fr">
<td>
</td>
</t>
<t t-if="media.link_audio_en">
<td><a t-attf-href="#{media.link_audio_en}"><span>Audio EN</span></a></td>
</t>
<t t-if="not media.link_audio_en">
<td>
</td>
</t>
<t t-if="media.link_video_en">
<td><a t-attf-href="#{media.link_video_en}"><span>Video EN</span></a></td>
</t>
<t t-if="not media.link_video_en">
<td>
</td>
</t>
<td><span t-esc="media.description_en" /></td>
</tr>
</t>
</table>
</t>
<br></br>
</t>
</t>
<t t-if="event.teaching_html_content_records_published">
<h6 style="background-color: orange;">Enregistrements disponibles :</h6>
<div>
<t t-raw="event.teaching_html_content_records"/>
</div>
<br></br><br></br>
</t>
</xpath>
<xpath expr="//span[@itemprop='description']" position="after">
<t t-if="event.find_out_more_link">
<br></br>


+ 21
- 15
views/mediatheque.xml View File

@ -1,4 +1,5 @@
<odoo>
<data noupdate="0">
<template id="website_mediatheque" name="Mediatheque">
<t t-call="website.layout">
<div id="wrap" class="o_wevent_index">
@ -146,6 +147,7 @@
<template id="kalachakra.website_mediatheque_event" name="website mediatheque event">
<t t-call="website.layout">
<body>
<div class="container">
<a href="/kalachakra/mediatheque?search=&amp;date=old&amp;tags=enregistrements" class="navbar-brand h4 my-0 mr-0 mr-md-4">
@ -162,23 +164,25 @@
<t t-if="t_day.teaching_session_ids">
<table class="table" style="font-size: smaller;">
<tr>
<td colspan="3"><span t-esc="t_day.day_teaching"/></td>
<td colspan="3"><span t-esc="t_day.day_teaching"/></td>
<td colspan="3">
<b><span t-field="t_day.day_teaching" class="my-1 mr-1 kala_evt1" t-options="{'date_only': 'true', 'format': 'long'}"/></b>
</td>
<t t-if="event.display_english_records">
<td colspan="3">
<b><span t-field="t_day.day_teaching" class="my-1 mr-1 kala_evt1" t-options="{'date_only': 'true', 'format': 'long'}"/></b>
</td>
</t>
</tr>
<tr>
<!-- <tr>
<td>Session</td>
<t t-if="event.display_english_records">
<td colspan="2">En français</td>
<td colspan="2">In english</td>
<td>Session</td>
</tr>
<tr>
<td></td>
<td>Audio</td>
<td>Video</td>
<td>Audio</td>
<td>Video</td>
<td></td>
</tr>
</t>
</tr> -->
<t t-foreach="t_day.teaching_session_ids" t-as="media">
<tr>
<td><span t-esc="media.description_fr" /></td>
@ -196,7 +200,7 @@
<td>
</td>
</t>
<t t-if="event.display_english_records">
<t t-if="media.link_audio_en">
<td><a t-attf-href="#{media.link_audio_en}"><span>Audio EN</span></a></td>
</t>
@ -213,7 +217,7 @@
</t>
<td><span t-esc="media.description_en" /></td>
</t>
</tr>
</t>
</table>
@ -224,6 +228,7 @@
</t>
</t>
<t t-if="event.teaching_html_content_records_published">
<h6 style="background-color: orange;">Enregistrements disponibles :</h6>
<div>
@ -232,7 +237,8 @@
<br></br><br></br>
</t>
</div>
</body>
</t>
</template>
</data>
</odoo>

Loading…
Cancel
Save