event_templates_list.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Index -->
  4. <template id="index" name="Events" track="1">
  5. <t t-call="website.layout">
  6. <div id="wrap" class="o_wevent_index">
  7. <!-- Options -->
  8. <t t-set="opt_events_list_cards" t-value="is_view_active('website_event.opt_events_list_cards')"/>
  9. <t t-set="opt_events_list_columns" t-value="is_view_active('website_event.opt_events_list_columns')"/>
  10. <!-- Topbar -->
  11. <t t-call="website_event.index_topbar">
  12. <t t-set="search" t-value="original_search or search or searches['search']"/>
  13. </t>
  14. <!-- Drag/Drop Area -->
  15. <div id="oe_structure_we_index_1" class="oe_structure oe_empty"/>
  16. <!-- Content -->
  17. <div class="o_wevent_events_list">
  18. <div class="container">
  19. <div class="d-flex mx-n3">
  20. <t t-call="website_event.searched_tags"/>
  21. </div>
  22. <div class="row">
  23. <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'}">
  24. <div class="row">
  25. <!-- Events List -->
  26. <t t-call="website_event.events_list"/>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <!-- Drag/Drop Area -->
  33. <div id="oe_structure_we_index_2" class="oe_structure oe_empty"/>
  34. </div>
  35. </t>
  36. </template>
  37. <!-- Index - OPTION - Sidebar -->
  38. <template id="opt_index_sidebar" inherit_id="website_event.index" active="False" name="Show Sidebar">
  39. <xpath expr="//div[@id='o_wevent_index_main_col']" position="after">
  40. <t t-call="website_event.index_sidebar"/>
  41. </xpath>
  42. </template>
  43. <!-- Index Topbar -->
  44. <template id="index_topbar" name="Topbar">
  45. <nav class="navbar navbar-light border-top shadow-sm d-print-none">
  46. <div class="container">
  47. <div class="d-flex flex-column flex-sm-row justify-content-between w-100">
  48. <span class="navbar-brand h4 my-0 me-auto">Events</span>
  49. <ul class="o_wevent_index_topbar_filters nav">
  50. <t t-foreach="categories" t-as="category">
  51. <li t-if="category.is_published and category.tag_ids and any(tag.color for tag in category.tag_ids)" class="nav-item dropdown me-2 my-1">
  52. <a href="#" role="button" class="btn dropdown-toggle" data-bs-toggle="dropdown">
  53. <i class="fa fa-folder-open"/>
  54. <t t-out="category.name"/>
  55. </a>
  56. <div class="dropdown-menu">
  57. <t t-foreach="category.tag_ids" t-as="tag">
  58. <a t-if="tag.color"
  59. t-att-href="'/event?%s' % keep_query('*', tags=str((search_tags - tag).ids if tag in search_tags else (tag | search_tags).ids))"
  60. t-attf-class="dropdown-item d-flex align-items-center justify-content-between #{'active' if tag in search_tags else ''}">
  61. <t t-out="tag.name"/>
  62. </a>
  63. </t>
  64. </div>
  65. </li>
  66. </t>
  67. </ul>
  68. <div class="d-flex align-items-center flex-wrap ps-sm-3 pe-0">
  69. <t t-call="website_event.events_search_box_input"/>
  70. </div>
  71. </div>
  72. </div>
  73. </nav>
  74. </template>
  75. <template id="searched_tags" name="Searched tags">
  76. <div class="d-flex align-items-center mt16">
  77. <t t-foreach="search_tags" t-as="tag">
  78. <span t-attf-class="align-items-baseline border d-inline-flex ps-2 rounded ml16 mb-2 #{'o_tag_color_%s' % tag.color if tag.color else ''}">
  79. <i class="fa fa-tag me-2 text-muted"/>
  80. <t t-out="tag.display_name"/>
  81. <a t-att-href="'/event?%s' % keep_query('*', tags=str((search_tags - tag).ids))" class="btn border-0 py-1">&#215;</a>
  82. </span>
  83. </t>
  84. </div>
  85. </template>
  86. <!-- Filter - Date -->
  87. <template id="event_time" inherit_id="website_event.index_topbar" name="Filter by Date">
  88. <xpath expr="//ul[hasclass('o_wevent_index_topbar_filters')]" position="inside">
  89. <li class="nav-item dropdown me-2 my-1">
  90. <a href="#" role="button" class="btn dropdown-toggle" data-bs-toggle="dropdown">
  91. <i class="fa fa-calendar"/>
  92. <t t-if="current_date" t-out="current_date"/>
  93. <t t-else="">Upcoming Events</t>
  94. </a>
  95. <div class="dropdown-menu">
  96. <t t-foreach="dates" t-as="date">
  97. <t t-if="date[3] or (date[0] in ('old','upcoming','all'))">
  98. <a t-att-href="keep('/event', date=date[0])" t-attf-class="dropdown-item d-flex align-items-center justify-content-between #{searches.get('date') == date[0] and 'active'}">
  99. <t t-out="date[1]"/>
  100. <span t-if="date[3]" t-out="date[3]" t-attf-class="badge rounded-pill #{searches.get('date') == date[0] and 'bg-light text-primary' or 'bg-primary'} ms-3"/>
  101. </a>
  102. </t>
  103. </t>
  104. </div>
  105. </li>
  106. </xpath>
  107. </template>
  108. <!-- Filter - Location -->
  109. <template id="event_location" inherit_id="website_event.index_topbar" active="False" name="Filter by Country">
  110. <xpath expr="//ul[hasclass('o_wevent_index_topbar_filters')]" position="inside">
  111. <li class="nav-item dropdown me-2 my-1">
  112. <a href="#" role="button" class="btn dropdown-toggle" data-bs-toggle="dropdown">
  113. <i class="fa fa-map-marker"/>
  114. <t t-if="current_country" t-out="current_country.name"/>
  115. <t t-else="">All countries</t>
  116. </a>
  117. <div class="dropdown-menu">
  118. <t t-foreach="countries" t-as="country">
  119. <t t-if="country['country_id']">
  120. <a t-att-href="keep('/event', country=country['country_id'][0])" t-attf-class="dropdown-item d-flex align-items-center justify-content-between #{searches.get('country') == str(country['country_id'] and country['country_id'][0]) and 'active'}">
  121. <t t-out="country['country_id'][1]"/>
  122. <span t-out="country['country_id_count']" class="badge rounded-pill text-bg-primary ms-auto"/>
  123. </a>
  124. </t>
  125. <t t-else="">
  126. <a t-att-href="keep('/event', country='online')" t-attf-class="dropdown-item d-flex align-items-center justify-content-between #{searches.get('country') == 'online' and 'active'}">
  127. <span>Online Events</span>
  128. <span t-out="country['country_id_count']" class="badge rounded-pill text-bg-primary ms-3"/>
  129. </a>
  130. </t>
  131. </t>
  132. </div>
  133. </li>
  134. </xpath>
  135. </template>
  136. <!-- Index - Events list -->
  137. <template id="events_list" name="Events list">
  138. <!-- Options -->
  139. <t t-set="opt_index_sidebar" t-value="is_view_active('website_event.opt_index_sidebar')"/>
  140. <t t-if="opt_events_list_columns" t-set="opt_event_size" t-value="opt_index_sidebar and 'col-md-6' or 'col-md-6 col-lg-4'"/>
  141. <t t-else="" t-set="opt_event_size" t-value="opt_index_sidebar and 'col-12' or 'col-xl-10 offset-xl-1'"/>
  142. <!-- No events -->
  143. <t t-if="not event_ids">
  144. <div class="col-12">
  145. <div class="h2 mb-3">No events found.</div>
  146. <div class="alert alert-info text-center" groups="event.group_event_user">
  147. <p class="m-0">Use the top button '<b>+ New</b>' to create an event.</p>
  148. </div>
  149. </div>
  150. </t>
  151. <!-- Fuzzy search -->
  152. <div t-if="event_ids and original_search" class="col-12 alert alert-warning mt8">
  153. No results found for '<span t-out="original_search"/>'. Showing results for '<span t-out="searches['search']"/>'.
  154. </div>
  155. <!-- List -->
  156. <div t-foreach="event_ids" t-as="event" t-attf-class=" #{opt_event_size} mb-4">
  157. <a t-cache="event if not editable and event.website_published else None" t-attf-href="/event/#{ slug(event) }/#{(not event.menu_id) and 'register'}" class="text-decoration-none" t-att-data-publish="event.website_published and 'on' or 'off'">
  158. <article t-attf-class="h-100 #{opt_events_list_cards and 'card border-0 shadow-sm'}" itemscope="itemscope" itemtype="http://schema.org/Event">
  159. <div class="h-100 row g-0">
  160. <!-- Header -->
  161. <header t-attf-class="overflow-hidden bg-secondary #{opt_events_list_columns and 'col-12' or 'col-sm-4 col-lg-3'} #{(not opt_events_list_cards) and 'shadow'}">
  162. <!-- Image + Link -->
  163. <div class="d-block h-100 w-100">
  164. <t t-call="website.record_cover">
  165. <t t-set="_record" t-value="event"/>
  166. <!-- Short Date -->
  167. <div class="o_wevent_event_date position-absolute shadow-sm o_not_editable">
  168. <span t-out="event.date_begin" t-options="{'widget': 'datetime', 'tz_name': event.date_tz, 'format': 'LLL'}" class="o_wevent_event_month"/>
  169. <span t-out="event.date_begin" t-options="{'widget': 'datetime', 'tz_name': event.date_tz, 'format': 'dd'}" class="o_wevent_event_day oe_hide_on_date_edit"/>
  170. </div>
  171. <!-- Participating -->
  172. <small t-if="event.is_participating" class="o_wevent_participating text-bg-success">
  173. <i class="fa fa-check me-2"/>Registered
  174. </small>
  175. <!-- Unpublished -->
  176. <small t-if="not event.website_published" class="o_wevent_unpublished text-bg-danger">
  177. <i class="fa fa-ban me-2"/>Unpublished
  178. </small>
  179. </t>
  180. </div>
  181. </header>
  182. <div t-att-class="'%s %s position-relative' % (
  183. opt_events_list_columns and 'col-12' or 'col',
  184. opt_events_list_columns and event.event_registrations_open and not event.event_registrations_sold_out and 'h-100' or '')">
  185. <!-- Body -->
  186. <main t-attf-class="#{opt_events_list_cards and 'card-body' or (opt_events_list_columns and 'py-3' or 'px-4')}">
  187. <!-- Title -->
  188. <h5 t-attf-class="card-title mt-2 mb-0 text-truncate #{(not event.website_published) and 'text-danger'}">
  189. <span t-field="event.name" itemprop="name"/>
  190. </h5>
  191. <!-- Start Date & Time -->
  192. <time class="o_not_editable" itemprop="startDate" t-att-datetime="event.date_begin">
  193. <span t-out="event.date_begin"
  194. t-options="{'widget': 'datetime', 'tz_name': event.date_tz, 'date_only': 'true', 'format': 'long', 'tz_name': event.date_tz}"/> -
  195. <span t-out="event.date_begin"
  196. t-options="{'widget': 'datetime', 'tz_name': event.date_tz, 'time_only': 'true', 'format': 'short', 'tz_name': event.date_tz}"/>
  197. (<span t-out="event.date_tz"/>)
  198. </time>
  199. <!-- Location -->
  200. <div class="o_not_editable" itemprop="location" t-out="event.address_id" t-options="{'widget': 'contact', 'fields': ['city'], 'no_marker': 'true'}"/>
  201. <div class="mt8">
  202. <t t-foreach="event.tag_ids.filtered(lambda tag: tag.category_id.is_published)" t-as="tag">
  203. <span t-if="tag.color"
  204. t-attf-class="badge mr4 #{'bg-primary' if tag in search_tags else ''} #{'o_tag_color_%s' % tag.color if tag.color else ''}">
  205. <span t-out="tag.name"/>
  206. </span>
  207. </t>
  208. </div>
  209. </main>
  210. </div>
  211. <!-- Footer -->
  212. <footer t-if="not event.event_registrations_open or event.event_registrations_sold_out"
  213. t-att-class="'alert-secondary small align-self-end w-100 %s %s' % (
  214. opt_events_list_cards and 'card-footer' or (not opt_events_list_columns and 'mx-4 mt-auto pt-2') or 'py-2',
  215. opt_events_list_cards and 'border-top' or '',
  216. )">
  217. <span t-if="not event.event_registrations_open">
  218. <t t-if="not event.event_registrations_started">
  219. Registrations not yet open
  220. </t>
  221. <t t-elif="event.event_registrations_sold_out">
  222. Sold Out
  223. </t>
  224. <t t-else="">
  225. Registrations Closed
  226. </t>
  227. </span>
  228. </footer>
  229. </div>
  230. </article>
  231. </a>
  232. </div>
  233. <!-- Pager -->
  234. <div class="d-flex justify-content-center my-3">
  235. <t t-call="website.pager"/>
  236. </div>
  237. </template>
  238. <template id="opt_events_list_columns" inherit_id="website_event.events_list" active="True" name="Layout • Columns"/>
  239. <template id="opt_events_list_cards" inherit_id="website_event.events_list" active="True" name="'Cards' Design"/>
  240. <template id="opt_events_list_categories" inherit_id="website_event.events_list" active="False" name="Show Templates">
  241. <xpath expr="//main/*" position="before">
  242. <span t-if="event.event_type_id" t-attf-href="/event?type=#{event.event_type_id.id}" t-attf-class="badge bg-secondary o_wevent_badge #{opt_events_list_columns and 'o_wevent_badge_event' or 'float-end'}" t-field="event.event_type_id"/>
  243. </xpath>
  244. </template>
  245. <!-- Index - Sidebar -->
  246. <template id="index_sidebar" name="Sidebar">
  247. <div id="o_wevent_index_sidebar" class="col-lg-4 ms-lg-3 ms-xl-5 my-5"/>
  248. </template>
  249. <!-- Index - Sidebar - About us -->
  250. <template id="index_sidebar_about_us" inherit_id="website_event.index_sidebar" active="True" name="About us" priority="20">
  251. <xpath expr="//div[@id='o_wevent_index_sidebar']" position="inside">
  252. <div class="o_wevent_sidebar_block">
  253. <h6 class="o_wevent_sidebar_title">About us</h6>
  254. <p>Use this paragraph to write a short text about your events or company.</p>
  255. </div>
  256. <div id="oe_structure_website_event_about_us_1" class="oe_structure"/>
  257. </xpath>
  258. </template>
  259. <!-- Index - Sidebar - Follow us -->
  260. <template id="index_sidebar_follow_us" inherit_id="website_event.index_sidebar" active="False" name="Follow us" priority="30">
  261. <xpath expr="//div[@id='o_wevent_index_sidebar']" position="inside">
  262. <div class="o_wevent_sidebar_block">
  263. <h6 class="o_wevent_sidebar_title">Follow Us</h6>
  264. <div class="o_wevent_sidebar_social mx-n1">
  265. <a t-if="website.social_facebook" t-att-href="website.social_facebook" class="o_wevent_social_link"><i class="fa fa-facebook text-facebook" aria-label="Facebook" title="Facebook"/></a>
  266. <a t-if="website.social_twitter" t-att-href="website.social_twitter" class="o_wevent_social_link"><i class="fa fa-twitter text-twitter" aria-label="Twitter" title="Twitter"/></a>
  267. <a t-if="website.social_linkedin" t-att-href="website.social_linkedin" class="o_wevent_social_link"><i class="fa fa-linkedin text-linkedin" aria-label="LinkedIn" title="LinkedIn"/></a>
  268. <a t-if="website.social_youtube" t-att-href="website.social_youtube" class="o_wevent_social_link"><i class="fa fa-youtube-play text-youtube" aria-label="Youtube" title="Youtube"/></a>
  269. <a t-if="website.social_github" t-att-href="website.social_github" class="o_wevent_social_link"><i class="fa fa-github text-github" aria-label="Github" title="Github"/></a>
  270. <a t-if="website.social_instagram" t-att-href="website.social_instagram" class="o_wevent_social_link"><i class="fa fa-instagram text-instagram" aria-label="Instagram" title="Instagram"/></a>
  271. </div>
  272. </div>
  273. <div id="oe_structure_website_event_follow_us_1" class="oe_structure"/>
  274. </xpath>
  275. </template>
  276. <!-- Index - Sidebar - Photos -->
  277. <template id="index_sidebar_photos" inherit_id="website_event.index_sidebar" active="True" name="Photos" priority="40">
  278. <xpath expr="//div[@id='o_wevent_index_sidebar']" position="inside">
  279. <h6 class="o_wevent_sidebar_title">Photos</h6>
  280. <a href="/event">
  281. <figure class="o_wevent_sidebar_block o_wevent_sidebar_figure figure">
  282. <img class="figure-img img-fluid rounded" src="/website_event/static/src/img/event_past_0.jpg" alt=""/>
  283. <figcaption class="figure-caption">A past event</figcaption>
  284. </figure>
  285. </a>
  286. <a href="/event">
  287. <figure class="o_wevent_sidebar_block o_wevent_sidebar_figure figure">
  288. <img class="figure-img img-fluid rounded" src="/website_event/static/src/img/event_training_0.jpg" alt=""/>
  289. <figcaption class="figure-caption">Our Trainings</figcaption>
  290. </figure>
  291. </a>
  292. </xpath>
  293. </template>
  294. <!-- Index - Sidebar - Quotes -->
  295. <template id="index_sidebar_quotes" inherit_id="website_event.index_sidebar" active="True" name="Quotes" priority="60">
  296. <xpath expr="//div[@id='o_wevent_index_sidebar']" position="inside">
  297. <div class="o_wevent_sidebar_block card">
  298. <div class="card-body">
  299. <blockquote class="blockquote mb-0">
  300. <p><em>Write here a quote from one of your attendees. It gives confidence in your events.</em></p>
  301. <footer class="blockquote-footer text-muted">Author</footer>
  302. </blockquote>
  303. </div>
  304. </div>
  305. </xpath>
  306. </template>
  307. </odoo>