Browse Source

mediatheque

dev-rcn
root 3 years ago
parent
commit
4fa57cf9de
3 changed files with 56 additions and 24 deletions
  1. +8
    -6
      controllers/kalachakra.py
  2. +1
    -1
      views/event.xml
  3. +47
    -17
      views/mediatheque.xml

+ 8
- 6
controllers/kalachakra.py View File

@ -266,10 +266,10 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
def _extract_searched_event_tags(self, searches):
tags = request.env['event.tag']
lst_tags=searches['tags'].split("|")
if searches.get('tags'):
tags = request.env['event.tag'].search([('name', '=', searches['tags'])])
tags = request.env['event.tag'].search([('name', 'in',lst_tags)])
return tags
@http.route(['/kalachakra/mediatheque/event'], type='http', auth="public", website=True, sitemap=sitemap_event)
@ -287,8 +287,10 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
SudoEventType = request.env['event.type'].sudo()
searches.setdefault('search', '')
searches.setdefault('date', 'all')
searches.setdefault('tags', '')
searches.setdefault('date', 'old')
searches.setdefault('tags', 'enregistrements')
searches.setdefault('type', 'all')
searches.setdefault('country', 'all')
@ -386,7 +388,7 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
step = 12 # Number of events per page
event_count = Event.search_count(dom_without("none"))
pager = website.pager(
url="/event",
url="/kalachakra/mediatheque",
url_args=searches,
total=event_count,
page=page,
@ -399,7 +401,7 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
order = 'is_published desc, ' + order
events = Event.search(dom_without("none"), limit=step, offset=pager['offset'], order=order)
keep = QueryURL('/event', **{key: value for key, value in searches.items() if (key == 'search' or value != 'all')})
keep = QueryURL('/kalachakra/mediatheque', **{key: value for key, value in searches.items() if (key == 'search' or value != 'all')})
#search_tags=['enregistrement']
values = {
'current_date': current_date,


+ 1
- 1
views/event.xml View File

@ -155,7 +155,7 @@
<group style="width:40%%">
<field name="booking_event" invisible="1"/>
<field name="participation_product_id" attrs="{'required': [('free_participation','!=',True),('booking_event','!=',True)]}"/>
<field name="participation_product_id" attrs="{'required': [('participation_standard_price','>',0),('booking_event','!=',True)]}"/>
<field name="participation_standard_price" attrs="{'required': [('free_participation','=', False)]}"/>
<field name="participation_member_price" attrs="{'required': [('free_participation','=', False)]}"/>
<field name="participation_super_member_price" attrs="{'required': [('free_participation','=', False)]}"/>


+ 47
- 17
views/mediatheque.xml View File

@ -13,9 +13,9 @@
<!-- Content -->
<div t-attf-class="o_wevent_events_list #{opt_events_list_cards and 'opt_event_list_cards_bg'}">
<div class="container">
<!-- <div class="row">
<div class="row">
<t t-call="website_event.searched_tags"/>
</div> -->
</div>
<div class="row">
<div id="o_wevent_index_main_col" t-attf-class="col-md my-5 #{opt_events_list_columns and 'opt_events_list_columns' or 'opt_events_list_rows'}">
<div class="row">
@ -84,12 +84,12 @@
<!-- Location -->
<div itemprop="location" t-field="event.address_id" t-options="{'widget': 'contact', 'fields': ['city'], 'no_marker': 'true'}"/>
<div class="mt8 d-flex align-items-center">
<!-- <t t-foreach="event.tag_ids" t-as="tag">
<t t-foreach="event.tag_ids" t-as="tag">
<span t-if="tag.color"
t-attf-class="badge mr8 #{'badge-primary' if tag in search_tags else 'badge-light'} #{'o_tag_color_%s' % tag.color if tag.color else ''}">
<span t-esc="tag.name"/>
</span>
</t> -->
</t>
</div>
</main>
</div>
@ -114,8 +114,34 @@
<template id="mediatheque_index_topbar" name="Topbar">
<nav class="navbar navbar-light border-top shadow-sm d-print-none">
<div class="container">
<div class="d-flex flex-column flex-sm-row justify-content-between w-100">
<span class="navbar-brand h4 my-0 mr-auto">Mediathèque</span>
<div class="d-flex flex-column flex-sm-row justify-content-between w-100">
<span class="navbar-brand h4 my-0 mr-auto">Mediathèque</span>
<ul class="o_wevent_index_topbar_filters nav">
<div class="d-flex align-items-center flex-wrap pl-sm-3 pr-0">
<li class="nav-item dropdown mr-2 my-1">
<a href="#" role="button" class="btn dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-folder-open"/>
tags
</a>
<div class="dropdown-menu">
<t t-foreach="categories" t-as="category">
<t t-foreach="category.tag_ids" t-as="tag">
<t t-if="not tag.hidden">
<a t-if="tag.color"
t-att-href="'/kalachakra/mediatheque?tags='+tag.name+'&#124;enregistrements'"
t-attf-class="dropdown-item d-flex align-items-center justify-content-between #{'active' if tag in search_tags else ''}">
<t t-esc="tag.name"/>
</a>
</t>
</t>
</t>
</div>
</li>
</div>
</ul>
<ul class="o_wevent_index_topbar_filters nav"/>
<div class="d-flex align-items-center flex-wrap pl-sm-3 pr-0">
<t t-call="kalachakra.mediatheque_search_box">
@ -125,6 +151,9 @@
</div>
</div>
</div>
</nav>
</template>
@ -155,6 +184,13 @@
<span class="kala_evt1">Retour</span>
</a>
<h6><span t-esc="event.name"></span></h6>
<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>
<t t-if="event.teaching_day_ids">
<h6 style="background-color: orange;">Enregistrements disponibles :</h6>
@ -187,14 +223,14 @@
<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>
<td><a target='blank' 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>
<td><a target='blank' t-attf-href="#{media.link_video_fr}"><span>Video FR</span></a></td>
</t>
<t t-if="not media.link_video_fr">
<td>
@ -202,14 +238,14 @@
</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>
<td><a target='blank' 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>
<td><a target='blank' t-attf-href="#{media.link_video_en}"><span>Video EN</span></a></td>
</t>
<t t-if="not media.link_video_en">
<td>
@ -229,13 +265,7 @@
</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>
</div>
</body>
</t>


Loading…
Cancel
Save