event_track_templates_agenda.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Revamped agenda : Will need to replace agenda_online from website_event_track in master -->
  4. <template id="agenda_online" name="Track Online: Agenda">
  5. <t t-call="website_event.layout">
  6. <!-- No tracks -->
  7. <div t-if="not tracks_by_days" class="container">
  8. <div class="h2 mb-3">No track found.</div>
  9. <div t-if="search_key" class="alert alert-info text-center">
  10. <p class="m-0">We did not find any track matching your <strong t-out="search_key"/> search.</p>
  11. </div>
  12. <div t-else="" class="alert alert-info text-center" groups="event.group_event_user">
  13. <a target="_blank" t-att-href="'/web?#action=website_event_track.action_event_track_from_event&amp;active_id=%s' % event.id">
  14. <p class="m-0">Schedule some tracks to get started</p>
  15. </a>
  16. </div>
  17. </div>
  18. <div t-else="" class="o_wevent_online o_weagenda_index">
  19. <!-- Options -->
  20. <t t-set="option_track_wishlist" t-value="not event.is_done and is_view_active('website_event_track.agenda_topbar_wishlist')"/>
  21. <!-- Topbar -->
  22. <t t-call="website_event_track.agenda_topbar"/>
  23. <!-- Drag/Drop Area -->
  24. <div class="oe_structure" id="oe_structure_website_event_track_agenda_1"/>
  25. <!-- Content -->
  26. <div class="container-fluid">
  27. <div class="row mb-5">
  28. <t t-call="website_event_track.agenda_main"/>
  29. </div>
  30. </div>
  31. <!-- Drag/Drop Area -->
  32. <div class="oe_structure" id="oe_structure_website_event_track_agenda_2"/>
  33. </div>
  34. </t>
  35. </template>
  36. <!-- ============================================================ -->
  37. <!-- TOPBAR: BASE NAVIGATION -->
  38. <!-- ============================================================ -->
  39. <!-- Main topbar -->
  40. <template id="agenda_topbar" name="Agenda Tools">
  41. <nav class="navbar navbar-light border-top shadow-sm d-print-none">
  42. <div class="container-fluid">
  43. <div class="d-flex flex-column flex-sm-row justify-content-between w-100">
  44. <ul class="o_weagenda_topbar_filters o_wevent_index_topbar_filters nav">
  45. </ul>
  46. <div class="d-flex ps-sm-3 pe-0">
  47. <label class="invisible text-muted me-2" id="search_summary"><span id="search_number" class="me-1">0</span>Results</label>
  48. <input type="text" class="form-control" placeholder="Filter Tracks..." id="event_track_search"/>
  49. </div>
  50. </div>
  51. </div>
  52. </nav>
  53. </template>
  54. <!-- Option: Tracks display: optional favorites -->
  55. <template id="agenda_topbar_wishlist"
  56. inherit_id="website_event_track.agenda_topbar"
  57. name="Allow Wishlists"
  58. active="True">
  59. <xpath expr="//ul[hasclass('o_weagenda_topbar_filters')]" position="inside">
  60. </xpath>
  61. </template>
  62. <!-- ============================================================ -->
  63. <!-- CONTENT: MAIN TEMPLATES -->
  64. <!-- ============================================================ -->
  65. <!-- Agenda Main Display -->
  66. <template id="agenda_main" name="Tracks: Main Display">
  67. <section t-foreach="days" t-as="day" class="col-12">
  68. <!-- DAY HEADER -->
  69. <div class="o_we_track_day_header mt-3 w-100 d-flex justify-content-between align-items-center">
  70. <div class="d-flex">
  71. <span class="h1 m-0 fw-bold" t-out="day"
  72. t-options="{'widget': 'date', 'format': 'EEEE dd'}"/>
  73. <div class="d-flex flex-column ms-2">
  74. <span class="fw-bold" t-out="day"
  75. t-options="{'widget': 'date', 'format': 'MMMM'}"/>
  76. <span class="fw-bold" t-out="day"
  77. t-options="{'widget': 'date', 'format': 'YYYY'}"/>
  78. </div>
  79. <div class="flex-column align-self-center ms-2">
  80. <span class="small fw-light">(<t t-out="event.date_tz"/>)</span>
  81. </div>
  82. </div>
  83. <small class="float-end text-muted align-self-end"><t t-out="tracks_by_days[day]"/> tracks</small>
  84. </div>
  85. <hr class="mt-2 mb-2"/>
  86. <t t-set="locations" t-value="locations_by_days[day]"/>
  87. <!-- Day Agenda -->
  88. <div class="o_we_online_agenda">
  89. <table id="table_search" class="table table-sm border-0 h-100">
  90. <!--Header-->
  91. <tr>
  92. <th class="border-0 position-sticky"/>
  93. <t t-foreach="locations" t-as="location">
  94. <th t-if="location" class="active text-center">
  95. <span t-out="location and location.name or 'Unknown'"/>
  96. </th>
  97. </t>
  98. </tr>
  99. <!-- Time Slots -->
  100. <t t-set="used_cells" t-value="[]"/>
  101. <t t-foreach="time_slots[day]" t-as="time_slot">
  102. <t t-set="is_round_hour" t-value="time_slot == time_slot.replace(minute=0)"/>
  103. <t t-set="is_half_hour" t-value="time_slot == time_slot.replace(minute=30)"/>
  104. <tr t-att-class="'%s' % ('active' if is_round_hour else '')">
  105. <td class="active">
  106. <b t-if="is_round_hour" t-out="time_slots[day][time_slot]['formatted_time']"/>
  107. </td>
  108. <t t-foreach="locations" t-as="location">
  109. <t t-set="tracks" t-value="time_slots[day][time_slot].get(location, {})"/>
  110. <t t-if="tracks">
  111. <t t-foreach="tracks" t-as="track">
  112. <t t-set="_classes"
  113. t-value="'text-center %s %s %s' % (
  114. 'event_color_%s' % (track.color or 0),
  115. 'event_track h-100' if track else '',
  116. 'o_location_size_%d' % len(locations),
  117. )"/>
  118. <t t-if="track.location_id and track.location_id == location">
  119. <td t-att-rowspan="tracks[track]['rowspan']"
  120. t-att-class="_classes">
  121. <t t-call="website_event_track.agenda_main_track"/>
  122. </td>
  123. </t>
  124. <t t-else="">
  125. <td t-att-colspan="len(locations)-1"
  126. t-att-rowspan="tracks[track]['rowspan']"
  127. t-att-class="_classes">
  128. <t t-call="website_event_track.agenda_main_track"/>
  129. </td>
  130. </t>
  131. <t t-set="used_cells" t-value="used_cells + tracks[track]['occupied_cells']"/>
  132. </t>
  133. </t>
  134. <t t-elif="location and (time_slot, location) not in used_cells">
  135. <td t-att-rowspan="1"
  136. t-att-class="'o_location_size_%s %s' % (len(locations),
  137. 'o_we_agenda_time_slot_half' if is_half_hour else
  138. 'o_we_agenda_time_slot_main' if is_round_hour else
  139. ''
  140. )"><div/></td>
  141. </t>
  142. </t>
  143. </tr>
  144. </t>
  145. </table>
  146. </div>
  147. </section>
  148. </template>
  149. <template id="agenda_main_track" name="Track Agenda: Track">
  150. <div class="d-flex flex-column h-100" t-att-data-publish="track.website_published and 'on' or 'off'">
  151. <div class="d-flex justify-content-end flex-wrap-reverse align-items-center o_weagenda_track_badges">
  152. <small t-if="track.is_track_live and not track.is_track_done and track.website_published"
  153. class="mx-1 badge text-bg-danger rounded-1">Live
  154. </small>
  155. <small t-if="not track.website_published and is_event_user"
  156. title="Unpublished"
  157. class="ms-1 mt-1 mt-md-0 badge text-bg-danger o_wevent_online_badge_unpublished">Unpublished</small>
  158. <span t-if="option_track_wishlist">
  159. <t t-call="website_event_track.track_widget_reminder">
  160. <t t-set="reminder_light" t-value="True"/>
  161. <t t-set="reminder_small" t-value="True"/>
  162. <t t-set="light_theme" t-value="False"/>
  163. </t>
  164. </span>
  165. </div>
  166. <div class="o_we_agenda_card_content d-flex flex-column justify-content-center my-1">
  167. <div class="o_we_agenda_card_title">
  168. <t t-if="track.website_published or is_event_user">
  169. <a t-att-href="'/event/%s/track/%s' % (slug(event), slug(track))" class="text-black text-bold">
  170. <t t-out="track.name"/>
  171. </a>
  172. </t>
  173. <t t-else="">
  174. <span class="text-muted text-bold">
  175. <t t-out="track.name"/>
  176. </span>
  177. </t>
  178. </div>
  179. <div class="text-muted text-center" t-if="track.partner_tag_line">
  180. <small t-out="track.partner_tag_line"/>
  181. </div>
  182. <div class="d-flex justify-content-center flex-wrap">
  183. <t t-foreach="track.tag_ids" t-as="tag">
  184. <span t-if="tag.color" t-att-title="tag.name"
  185. t-attf-class="me-1 mt-1 badge #{'o_tag_color_'+str(tag.color)}" t-out="tag.name"
  186. t-attf-onclick="
  187. var value = '#{tag.name}' ;
  188. var target = $('#event_track_search');
  189. if (target.val() == value) { target.val(''); } else { target.val(value); }
  190. target.trigger('input');
  191. "
  192. />
  193. </t>
  194. </div>
  195. </div>
  196. </div>
  197. </template>
  198. </odoo>