[MERGE] forward port of branch 8.0 up to e883193
[odoo/odoo.git] / addons / website_event / views / website_event.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4
5 <template id="event_script" inherit_id="website.assets_frontend" name="Country Events Snippet Script">
6     <xpath expr="/t" position="inside">
7         <script type="text/javascript" src="/website_event/static/src/js/website_geolocation.js"></script>
8     </xpath>
9 </template>
10
11 <template id="assets_editor" inherit_id="website.assets_editor" name="Event Editor" groups="event.group_event_manager">
12     <xpath expr="." position="inside">
13         <script type="text/javascript" src="/website_event/static/src/js/website_event.editor.js"></script>
14         <script type="text/javascript" src="/website_event/static/src/js/website.tour.event.js"></script>
15     </xpath>
16 </template>
17
18 <!-- Layout add nav and footer -->
19 <template id="header_footer_custom" inherit_id="website.footer_default" name="Footer Events Link">
20     <xpath expr="//ul[@id='products']" position="inside">
21         <li><a href="/event">Events</a></li>
22     </xpath>
23 </template>
24
25 <!-- Page -->
26 <template id="index" name="Events">
27     <t t-call="website.layout">
28       <div id="wrap">
29         <div class="oe_structure"/>
30         <div class="container">
31             <div class="row mt8">
32                 <div class="col-sm-5">
33                     <ol class="breadcrumb mb0">
34                         <li>
35                             <a href="/event">Our Events</a>
36                         </li>
37                         <li t-if="current_date"><t t-esc="current_date"/></li>
38                         <li t-if="current_type"><t t-esc="current_type.name"/></li>
39                         <li t-if="current_country"><t t-esc="current_country.name"/></li>
40                     </ol>
41                 </div><div class="col-sm-7">
42                     <t t-call="website.pager" >
43                         <t t-set="classname">pull-right</t>
44                     </t>
45                 </div>
46             </div>
47             <div class="row mt32 mb32">
48                 <div class="col-md-9" id="middle_column">
49                     <div class="text-center text-muted" t-if="not event_ids">
50                       <h1>No event found</h1>
51                       <t groups="base.group_website_publisher">
52                           <p groups="event.group_event_manager">Use the top menu <i>'Content'</i> to create your first event.</p>
53                       </t>
54                     </div>
55                     <ul class="media-list">
56                         <li t-foreach="event_ids" t-as="event" class="media">
57                             <div itemscope="itemscope" itemtype="http://schema.org/Event" class="media-body">
58                                 <h4 class="media-heading">
59                                     <a itemprop="url" t-att-class="event.state == 'done' and 'text-success'" t-attf-href="/event/#{ slug(event) }/#{(not event.menu_id) and 'register' or ''}"><span itemprop="name" t-field="event.name"> </span></a>
60                                     <small t-if="not event.address_id" class="label label-info">Online</small>
61                                     <small t-if="not event.website_published" class="label label-danger">not published</small>
62                                 </h4>
63                                 <div>
64                                     <t t-if="event.organizer_id">
65                                         Organized by: <span t-field="event.organizer_id"> </span>
66                                     </t>
67                                 </div>
68                                 <div>
69                                     <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="event.date_begin" t-field-options='{"hide_seconds":"True"}'> </span> <i>to</i> <span itemprop="endDate" t-field="event.date_end" t-field-options='{"hide_seconds":"True"}'> </span>
70                                 </div>
71                                 <div itemprop="location" t-field="event.address_id" t-field-options='{
72                                     "widget": "contact",
73                                     "fields": ["city"]
74                                     }'/>
75                                 <div class="text-muted" t-if="event.type">
76                                     <i class="fa fa-tag"></i> <span t-field="event.type"/>
77                                 </div>
78                             </div>
79                         </li>
80                     </ul>
81                 </div>
82                 <div class="col-md-3 oe_structure" id="right_column">
83                 </div>
84             </div>
85         </div>
86         <div class="oe_structure"/>
87       </div>
88     </t>
89 </template>
90
91 <template id="event_right_photos" inherit_id="website_event.index" active="False" customize_show="True" name="Photos">
92     <xpath expr="//div[@id='right_column']" position="inside">
93         <div class="row">
94             <div class="col-md-12 mb16">
95                 <div class="oe_demo">
96                     <img src="/website_event/static/src/img/openerp_enterprise_of_the_year.png" class="img-rounded"/>
97                     <div class="text-center"><a href="/event">Photos of Past Events</a></div>
98                 </div>
99             </div>
100             <div class="col-md-12 mb16">
101                 <div class="oe_demo">
102                     <img src="/website_event/static/src/img/training.jpg" class="img-rounded"/>
103                     <div class="text-center"><a href="/event">Our Trainings</a></div>
104                 </div>
105             </div>
106         </div>
107     </xpath>
108 </template>
109
110 <template id="event_right_quotes" inherit_id="website_event.index" active="False" customize_show="True" name="Quotes">
111     <xpath expr="//div[@id='right_column']" position="inside">
112         <div class="row">
113             <div class="col-md-12 mb16">
114                 <blockquote class="oe_snippet_body">
115                     <p>
116                         Write here a quote from one of your attendees.
117                         It gives confidence in your
118                         events.
119                     </p>
120                     <small>Author</small>
121                 </blockquote>
122             </div>
123         </div>
124     </xpath>
125 </template>
126
127 <template id="event_right_country_event" inherit_id="website_event.index" active="False" customize_show="True" name="Country Events">
128     <xpath expr="//div[@id='right_column']" position="inside">
129         <div class="row">
130             <div class="col-md-12 mb16 mt16 country_events">
131                 <div class="country_events_list">
132                     <div class="text-muted text-center">
133                         <h1>
134                             <i class="fa fa-flag fa-5x"></i>
135                         </h1>
136                         <h1>Events from Your Country</h1>
137                     </div>
138                 </div>
139             </div>
140         </div>
141     </xpath>
142 </template>
143
144 <template id="event_left_column" customize_show="True" inherit_id="website_event.index" name="Filters">
145     <xpath expr="//div[@id='middle_column']" position="attributes">
146         <attribute name="class">col-md-6</attribute>
147     </xpath>
148     <xpath expr="//div[@id='middle_column']" position="before">
149         <div class="col-md-3 css_noprint" id="left_column">
150             <ul class="nav nav-pills nav-stacked">
151                 <t t-foreach="dates" t-as="date">
152                     <li t-att-class="searches.get('date') == date[0] and 'active' or ''" t-if="date[3] or (date[0] in ('old','all'))">
153                         <a t-attf-href="/event?{{ keep_query('country', 'type', date=date[0]) }}"><t t-esc="date[1]"/>
154                             <span t-if="date[3]" class="badge pull-right"><t t-esc="date[3]"/></span>
155                         </a>
156                     </li>
157                 </t>
158             </ul>
159         </div>
160     </xpath>
161 </template>
162
163 <template id="event_category" inherit_id="website_event.event_left_column" active="False" customize_show="True" name="Filter by Category">
164     <xpath expr="//div[@id='left_column']" position="inside">
165         <ul class="nav nav-pills nav-stacked mt32">
166             <t t-foreach="types" t-as="type">
167                 <li t-if="type['type']"
168                     t-att-class="searches.get('type') == str(type['type'] and type['type'][0]) and 'active' or ''">
169                     <a t-attf-href="/event?{{ keep_query('country', 'date', type=type['type'][0]) }}"><t t-esc="type['type'][1]"/>
170                         <span class="badge pull-right"><t t-esc="type['type_count']"/></span>
171                     </a>
172                 </li>
173             </t>
174         </ul>
175     </xpath>
176 </template>
177
178 <template id="event_location" inherit_id="website_event.event_left_column" active="False" customize_show="True" name="Filter by Country">
179     <xpath expr="//div[@id='left_column']" position="inside">
180         <ul class="nav nav-pills nav-stacked mt32">
181             <t t-foreach="countries" t-as="country">
182                 <li t-if="country['country_id']" t-att-class="searches.get('country') == str(country['country_id'] and country['country_id'][0]) and 'active' or ''">
183                     <a t-attf-href="/event?{{ keep_query('type', 'date', country=country['country_id'][0]) }}"><t t-esc="country['country_id'][1]"/>
184                         <span class="badge pull-right"><t t-esc="country['country_id_count']"/></span>
185                     </a>
186                 </li>
187                 <li t-if="not country['country_id']" t-att-class="searches.get('country') == 'online' and 'active' or ''">
188                     <a t-attf-href="/event?{{ keep_query('type', 'date', country='online') }}">
189                         <span>Online Events</span>
190                         <span class="badge pull-right"><t t-esc="country['country_id_count']"/></span>
191                     </a>
192                 </li>
193             </t>
194         </ul>
195     </xpath>
196 </template>
197
198 <template id="layout">
199     <t t-call="website.layout">
200       <div id="wrap" class="js_event o_website_event">
201         <div class="container">
202             <div class="row mt8">
203                 <div class="col-sm-7" id="event_menu">
204                     <ol class="breadcrumb mb0" t-if="not event.menu_id">
205                         <li><a href="/event">All Events</a></li>
206                         <li t-if="event.type">
207                             <a t-attf-href="/event?type=#{event.type.id}" t-esc="event.type.name"/>
208                         </li>
209                         <li t-if="event.country_id">
210                             <a t-attf-href="/event?country=#{event.country_id.id}" t-esc="event.country_id.name"/>
211                         </li>
212                         <li class="active">
213                             <span t-field="event.name"/>
214                         </li>
215                     </ol>
216                     <ol class="breadcrumb mb0" id="event_menu" t-if="event.menu_id">
217                         <t t-foreach="event.menu_id.child_id" t-as="submenu">
218                             <t t-call="website.submenu"/>
219                         </t>
220                     </ol>
221                 </div>
222                 <div class="col-sm-5" groups="event.group_event_manager">
223                     <t t-call="website.publish_management">
224                       <t t-set="object" t-value="event"/>
225                       <t t-set="publish_edit" t-value="True"/>
226                       <t t-set="action" t-value="'event.action_event_view'"/>
227                     </t>
228                 </div>
229             </div>
230         </div>
231         <t t-raw="0"/>
232         <div class="oe_structure"/>
233       </div>
234     </t>
235 </template>
236
237 <template id="template_location">
238     <t t-call="website_event.layout">
239         <section class="container">
240             <h1 class="text-center">Event Location</h1>
241         </section>
242         <div class="oe_structure oe_empty"/>
243     </t>
244 </template>
245
246 <template id="template_intro">
247     <t t-call="website_event.layout">
248         <section class="container">
249             <h1 class="text-center">Event Introduction</h1>
250         </section>
251         <div class="oe_structure oe_empty"/>
252     </t>
253 </template>
254
255 <template id="event_details">
256     <t t-call="website_event.layout">
257         <div itemscope="itemscope" itemtype="http://schema.org/Event" class="container">
258             <h1 itemprop="name" class="text-center" t-field="event.name"></h1>
259             <h4 class="text-center text-muted">
260                 <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="event.date_begin" t-field-options='{"hide_seconds":"True"}'/> to
261                 <span itemprop="endDate" t-field="event.date_end" t-field-options='{"hide_seconds":"True"}'/>
262             </h4>
263             <h4 class="text-center text-muted"
264                 t-field="event.address_id" t-field-options='{
265                 "widget": "contact",
266                 "fields": ["city"]
267                 }'/>
268             <div class="row mt32 mb32">
269                 <t t-raw="0"/>
270             </div>
271         </div>
272     </t>
273 </template>
274
275 <template id="404">
276     <t t-call="website.layout">
277         <div id="wrap">
278             <div class="oe_structure oe_empty">
279                 <div class="container">
280                     <h1 class="mt32">Event not found!</h1>
281                     <p>Sorry, the requested event is not available anymore.</p>
282                     <p><a t-attf-href="/event">Return to the event list.</a></p>
283                 </div>
284             </div>
285         </div>
286     </t>
287 </template>
288
289 <template id="event_description_full">
290     <t t-call="website_event.event_details">
291         <div class="col-md-8">
292             <div itemprop="description" t-field="event.description"></div>
293             <div class="clearfix"/>
294             <ul class="media-list" id="comment">
295                 <li t-foreach="event.website_message_ids" t-as="comment" class="media">
296                     <div class="media-body">
297                         <t t-call="website.publish_management">
298                             <t t-set="object" t-value="comment"/>
299                             <t t-set="publish_edit" t-value="True"/>
300                         </t>
301                         <t t-raw="comment.body"/>
302                         <small class="pull-right muted text-right">
303                             <div t-field="comment.author_id"/>
304                             <div t-field="comment.date" t-field-options='{"hide_seconds":"True"}'/>
305                         </small>
306                     </div>
307                 </li>
308             </ul>
309         </div>
310         <div class="col-md-4 css_noprint">
311             <div class="clearfix"/>
312
313             <div class="panel panel-default" t-if="event.address_id">
314                 <div class="panel-heading">
315                     <h4>Where</h4>
316                 </div>
317                 <div class="panel-body">
318                     <a t-att-href="event.google_map_link()" target="_BLANK">
319                         <img t-att-src="event.google_map_img()" width="100%%"/>
320                     </a>
321                     <div itemprop="location" class="mt16 mb8" t-field="event.address_id" t-field-options='{
322                         "widget": "contact",
323                         "fields": ["address", "phone", "mobile", "fax", "email"]
324                         }'/>
325                 </div>
326             </div>
327
328             <div class="panel panel-default">
329                 <div class="panel-heading">
330                     <h4>When</h4>
331                 </div>
332                 <div class="panel-body">
333                     <i class="fa fa-clock-o"></i> From <span t-field="event.date_begin" t-field-options='{"hide_seconds":"True"}'> </span><br/>
334                     <i class="fa fa-clock-o"></i> To <span t-field="event.date_end" t-field-options='{"hide_seconds":"True"}'> </span>
335                 </div>
336             </div>
337
338             <div class="panel panel-default" t-if="event.organizer_id">
339                 <div class="panel-heading">
340                     <h4>Organizer</h4>
341                 </div>
342                 <div class="panel-body" t-field="event.organizer_id" t-field-options='{
343                     "widget": "contact",
344                     "fields": ["name", "phone", "mobile", "fax", "email"]
345                     }'/>
346             </div>
347
348             <div class="panel panel-default">
349                 <div class="panel-heading">
350                     <h4>Social Stream</h4>
351                 </div>
352                 <div class="panel-body">
353                     <t t-call="website_mail.follow"><t t-set="object" t-value="event"/></t>
354                     <div t-if="event.twitter_hashtag" class="mt16">
355                         <p><strong>Participate on Twitter</strong></p>
356                         <p class="text-muted">
357                             Find out what people see and say about this event,
358                             and join the conversation.
359                         </p>
360                         <p><strong>Use this tag:
361                             <a t-att-href="'http://twitter.com/search?q=%23'+event.twitter_hashtag" target="_blank" class="label label-primary">#<span t-field="event.twitter_hashtag"/></a>
362                         </strong></p>
363                     </div>
364                 </div>
365             </div>
366         </div>
367     </t>
368 </template>
369
370 <template id="country_events" name="Country Events" inherit_id="website.snippets">
371     <xpath expr="//div[@id='snippet_content']" position="inside">
372         <div>
373             <div class="oe_snippet_thumbnail">
374                 <div style="background: white;box-shadow:none;-webkit-box-shadow:none;" class="oe_snippet_thumbnail_img" >
375                     <i class="fa fa-flag fa-5x text-muted"></i>
376                 </div>
377                 <span class="oe_snippet_thumbnail_title">Local Events</span>
378             </div>
379             <div class="oe_snippet_body oe_country_events mb16 mt16">
380                 <div class="country_events_list">
381                     <div class="text-muted text-left">
382                         <div>
383                             <img class="img-rounded img-responsive" src="/website_event/static/src/img/world_map.jpg"></img>
384                         </div>
385                         <div>Events in visitor's country</div>
386                     </div>
387                 </div>
388             </div>
389         </div>
390     </xpath>
391     <xpath expr="//div[@id='snippet_options']" position="inside">
392         <div data-js='country_events'
393             data-selector=".oe_country_events"
394             data-drop-near="p, h1, h2, h3, blockquote, .well, .panel"
395             data-drop-in=".content"
396            >
397         </div>
398     </xpath>
399 </template>
400
401 <template id="country_events_list" name="Country">
402     <t t-ignore="true">
403         <t t-if="events">
404             <div class="country_events_list">
405                 <div>
406                     <t t-if="country">
407                         <img class="img-rounded img-responsive" t-att-src="website.image_url(country, 'image')"></img>
408                         <h4><b>Events: <span t-esc="country.name"></span></b></h4>
409                     </t>
410                     <t t-if="not country">
411                         <img class="img-rounded img-responsive" src="/website_event/static/src/img/world_map.jpg"></img>
412                         <h4><b>Upcoming Events</b></h4>
413                     </t>
414                     <div t-foreach="events[:5]" t-as="event_dict" class="oe_website_overflow_ellipsis mb8">
415                         <t t-if="not event_dict['event'].website_published">
416                             <span class="label label-danger"><i class="fa fa-ban"></i></span>
417                         </t>
418                         <t t-if="event_dict['event'].address_id">
419                             <i class="fa fa-map-marker"></i>
420                         </t>
421                         <t t-if="not event_dict['event'].address_id">
422                             <i class="fa fa-cloud"></i>
423                         </t>
424                         <b><span t-esc="event_dict['date']"/>: <span><a t-att-href="event_dict['url']"><t t-esc="event_dict['event'].name"/></a></span></b>
425                     </div>
426                     <t t-if="len(events) > 5">
427                         <div t-if="country">
428                             <b><a t-att-href="'/event?country='+str(country.id)">See all events from <span t-esc="country.name"></span></a></b>
429                         </div>
430                         <div t-if="not country">
431                             <b><a href="/event"> See all upcoming events </a></b>
432                         </div>
433                     </t>
434                 </div>
435             </div>
436         </t>
437     </t>
438 </template>
439
440 <template id="website.layout_footer_copyright" inherit_id="website.layout" name="Footer Copyright">
441   <xpath expr="//footer" position="inside">
442       <div class="container mt16 mb8">
443           <div class="pull-right" t-ignore="true" t-if="not editable">
444             Powered by <a class="label label-danger" href="http://www.odoo.com/page/website-builder">Odoo</a>.
445             Try the <a href="http://www.odoo.com/page/website-builder">open source website builder</a>.
446           </div>
447           <div class="pull-left text-muted">
448               Copyright &amp;copy; <span t-field="res_company.name">Company name</span>
449           </div>
450       </div>
451   </xpath>
452 </template>
453
454
455 <!-- User Navbar -->
456 <template id="content_new_event" inherit_id="website.user_navbar" groups="event.group_event_manager">
457     <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
458          <li><a href="#" data-action="new_event">New Event</a></li>
459     </xpath>
460 </template>
461 </data>
462 </openerp>