[FIX] website: order of script for editor and tours
[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="editor_head" inherit_id="website.editor_head" name="Event Editor" groups="base.group_website_designer">
6         <xpath expr="//script[last()]" position="after">
7             <script type="text/javascript" src="/website_event/static/src/js/website_event.editor.js"></script>
8             <script type="text/javascript" src="/website_event/static/src/js/website.tour.event.js"></script>
9         </xpath>
10     </template>
11
12     <!-- Layout add nav and footer -->
13     <template id="header_footer_custom" inherit_id="website.layout" name="Footer Events Link">
14         <xpath expr="//footer//ul[@name='products']" position="inside">
15             <li><a href="/event">Events</a></li>
16         </xpath>
17     </template>
18
19     <!-- Page -->
20     <template id="index" name="Events">
21         <t t-call="website.layout">
22           <div id="wrap">
23             <div class="oe_structure"/>
24             <div class="container">
25                 <div class="row mt8">
26                     <div class="col-sm-5">
27                         <ol class="breadcrumb mb0">
28                             <li class="active">
29                                 Our Events
30                             </li>
31                         </ol>
32                     </div><div class="col-sm-7">
33                         <t t-call="website.pager" >
34                             <t t-set="classname">pull-right</t>
35                         </t>
36                     </div>
37                 </div>
38                 <h3 class="text-center text-muted">
39                     <t t-esc="current_date or ''"/><span t-if="current_type"><t t-if="current_date">,</t>
40                       <t t-esc="current_type.name"/></span><span t-if="current_country"><t t-if="current_type or current_date">,</t>
41                       <t t-esc="current_country.name"/>
42                     </span>
43                 </h3>
44                 <div class="row mt32 mb32">
45                     <div class="col-md-3 col-sm-4 css_noprint" id="left_column">
46                         <ul class="nav nav-pills nav-stacked">
47                             <t t-foreach="dates" t-as="date">
48                                 <li t-att-class="searches.get('date') == date[0] and 'active' or ''" t-if="date[3] or (date[0] in ('old','all'))">
49                                     <a t-href="/event/#{ search_path }&amp;date=#{ date[0] }"><t t-esc="date[1]"/>
50                                         <span t-if="date[3]" class="badge pull-right"><t t-esc="date[3]"/></span>
51                                     </a>
52                                 </li>
53                             </t>
54                         </ul>
55                     </div>
56                     <div class="col-sm-7 col-md-6" id="middle_column">
57                         <t t-if="not event_ids">
58                             <p t-if="current_date or current_country or current_type">
59                                 No event found in this category, check <a href="/event">all events</a>.
60                             </p>
61                             <p t-if="(current_date is None) and (current_country is None) and (current_type is None)">
62                                 No events are planned for now on.
63                             </p>
64                         </t>
65                         <ul class="media-list">
66                             <li t-foreach="event_ids" t-as="event" class="media">
67                                 <div class="media-body">
68                                     <t t-if="event.event_ticket_ids">
69                                         <span t-if="not event.register_avail" class="label label-danger pull-right">Sold Out</span>
70                                         <span t-if="event.register_avail and event.register_avail &lt;= ((event.register_max or 0) / 4)" class="label pull-right label-info">
71                                             Only <t t-esc="event.register_avail"/> Remaining
72                                         </span>
73                                     </t>
74                                     <h4 class="media-heading">
75                                         <a t-href="/event/#{ slug(event) }/#{(not event.menu_id) and 'register/' or ''}"><span t-field="event.name"> </span></a>
76                                         <small t-if="not event.website_published" class="label label-danger">not published</small>
77                                     </h4>
78                                     <div>
79                                         <t t-if="event.organizer_id">
80                                             Organized by: <span t-field="event.organizer_id"> </span>
81                                         </t>
82                                     </div>
83                                     <div>
84                                         <i class="fa fa-clock-o"></i> <span t-field="event.date_begin"> </span> <i>to</i> <span t-field="event.date_end"> </span>
85                                     </div>
86                                     <div t-if="event.country_id">
87                                         <i class="fa fa-map-marker"></i> <span t-field="event.city"/>, <span t-field="event.country_id"/>
88                                     </div>
89                                     <div class="text-muted">
90                                         <i class="fa fa-tag"></i> <span t-field="event.type"/>
91                                     </div>
92                                 </div>
93                             </li>
94                         </ul>
95                     </div>
96                     <div class="col-sm-2 col-md-3 oe_structure" id="right_column">
97                     </div>
98                 </div>
99             </div>
100             <div class="oe_structure"/>
101           </div>
102         </t>
103     </template>
104
105     <template id="event_right_photos" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Photos">
106         <xpath expr="//div[@id='right_column']" position="inside">
107             <div class="row">
108                 <div class="col-md-12 mb16">
109                     <div class="oe_demo">
110                         <img src="/website_event/static/src/img/openerp_enterprise_of_the_year.png" class="img-rounded"/>
111                         <div class="text-center"><a href="/event">Photos of Past Events</a></div>
112                     </div>
113                 </div>
114                 <div class="col-md-12 mb16">
115                     <div class="oe_demo">
116                         <img src="/website_event/static/src/img/training.jpg" class="img-rounded"/>
117                         <div class="text-center"><a href="/event">Our Trainings</a></div>
118                     </div>
119                 </div>
120             </div>
121         </xpath>
122     </template>
123
124     <template id="event_right_quotes" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Quotes">
125         <xpath expr="//div[@id='right_column']" position="inside">
126             <div class="row">
127                 <div class="col-md-12 mb16">
128                     <blockquote class="oe_snippet_body">
129                         <p>
130                             Write here a quote from one of your attendees.
131                             It gives confidence in your
132                             events.
133                         </p>
134                         <small>Author</small>
135                     </blockquote>
136                 </div>
137             </div>
138         </xpath>
139     </template>
140
141     <template id="event_category" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Filter by Category">
142         <xpath expr="//div[@id='left_column']" position="inside">
143             <ul class="nav nav-pills nav-stacked mt32">
144                 <t t-foreach="types">
145                     <li t-if="type" t-att-class="searches.get('type') == str(type and type[0]) and 'active' or ''">
146                         <a t-href="/event/#{ search_path }&amp;type=#{ type[0] }"><t t-esc="type[1]"/>
147                             <span class="badge pull-right"><t t-esc="type_count"/></span>
148                         </a>
149                     </li>
150                 </t>
151             </ul>
152         </xpath>
153     </template>
154     <template id="event_location" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Filter by Country">
155         <xpath expr="//div[@id='left_column']" position="inside">
156             <ul class="nav nav-pills nav-stacked mt32">
157                 <t t-foreach="countries">
158                     <li t-if="country_id" t-att-class="searches.get('country') == str(country_id and country_id[0]) and 'active' or ''">
159                         <a t-href="/event/#{ search_path }&amp;country=#{ country_id[0] }"><t t-esc="country_id[1]"/>
160                             <span class="badge pull-right"><t t-esc="country_id_count"/></span>
161                         </a>
162                     </li>
163                 </t>
164             </ul>
165         </xpath>
166     </template>
167
168     <template id="layout">
169         <t t-call="website.layout">
170           <div id="wrap">
171             <div class="oe_structure"/>
172             <div class="container">
173                 <div class="row mt8">
174                     <div class="col-sm-7" id="event_menu">
175                         <ol class="breadcrumb mb0" t-if="not event.menu_id">
176                             <li><a href="/event">All Events</a></li>
177                             <li t-if="event.type">
178                                 <a t-href="/event?type=#{event.type.id}" t-esc="event.type.name"/>
179                             </li>
180                             <li t-if="event.country_id">
181                                 <a t-href="/event?country=#{event.country_id.id}" t-esc="event.country_id.name"/>
182                             </li>
183                             <li class="active">
184                                 <span t-field="event.name"/>
185                             </li>
186                         </ol>
187                         <ol class="breadcrumb mb0" id="event_menu" t-if="event.menu_id">
188                             <t t-foreach="event.menu_id.child_id" t-as="submenu">
189                                 <t t-call="website.submenu"/>
190                             </t>
191                         </ol>
192                     </div>
193                     <div class="col-sm-5">
194                         <t t-call="website.publish_management">
195                             <t t-set="object" t-value="event"/>
196                             <t t-set="publish_edit" t-value="True"/>
197                             <t t-set="publish_controller">/event/publish</t>
198                         </t>
199                     </div>
200                 </div>
201             </div>
202             <t t-raw="0"/>
203             <div class="oe_structure"/>
204           </div>
205         </t>
206     </template>
207
208     <template id="template_location">
209         <t t-call="website_event.layout">
210             <section class="container" data-snippet-id="title">
211                 <h1 class="text-center">Event Location</h1>
212             </section>
213             <div class="oe_structure oe_empty"/>
214         </t>
215     </template>
216
217     <template id="template_intro">
218         <t t-call="website_event.layout">
219             <section class="container" data-snippet-id="title">
220                 <h1 class="text-center">Event Introduction</h1>
221             </section>
222             <div class="oe_structure oe_empty"/>
223         </t>
224     </template>
225
226     <template id="event_details">
227         <t t-call="website_event.layout">
228             <div class="container">
229                 <h1 class="text-center" t-field="event.name"></h1>
230                 <h4 class="text-center text-muted">
231                     <i class="fa fa-clock-o"></i> <span t-field="event.date_begin"/> to
232                     <span t-field="event.date_end"/>
233                 </h4>
234                 <h4 t-if="event.city and event.country_id" class="text-center text-muted">
235                     <i class="fa fa-map-marker"/>
236                     <span t-field="event.city"/>,
237                     <span t-field="event.country_id"/>
238                 </h4>
239                 <div class="row mt32 mb32">
240                     <t t-raw="0"/>
241                 </div>
242             </div>
243         </t>
244     </template>
245
246     <template id="404">
247         <t t-call="website.layout">
248             <div id="wrap">
249                 <div class="oe_structure oe_empty">
250                     <div class="container">
251                         <h1 class="mt32">Event not found!</h1>
252                         <p>Sorry, the requested event is not available anymore.</p>
253                         <p><a t-href="/event/">Return to the event list.</a></p>
254                     </div>
255                 </div>
256             </div>
257         </t>
258     </template>
259
260     <template id="event_description_full">
261         <t t-call="website_event.event_details">
262             <div class="col-md-8">
263                 <form t-action="/event/add_cart?event_id=#{ event.id }" method="post" t-if="event.event_ticket_ids">
264                     <table class="table table-striped">
265                         <thead>
266                             <tr>
267                                 <th>Ticket Type</th>
268                                 <th style="min-width: 100px">Sales End</th>
269                                 <th style="min-width: 100px">Price</th>
270                                 <th></th>
271                                 <th>Quantity</th>
272                             </tr>
273                         </thead>
274                         <tbody>
275                             <tr t-foreach="event.event_ticket_ids" t-as="ticket">
276                                 <td>
277                                     <div t-field="ticket.name"/>
278                                     <div><small t-field="ticket.product_id.description_sale"/></div>
279                                 </td>
280                                 <td><span t-field="ticket.deadline"/></td>
281                                 <td>
282                                     <t t-if="ticket.price or editable"><span t-field="ticket.price" t-field-options='{
283                                            "widget": "monetary",
284                                            "display_currency": "website.pricelist_id.currency_id"
285                                       }'/>
286                                     </t>
287                                     <t t-if="not ticket.price and not editable">
288                                         <span>Free</span>
289                                     </t>
290                                 </td>
291                                 <td>
292                                     <span t-if="ticket.register_max and ((ticket.register_current or 0)*100 / ticket.register_max)&gt;75" class="text-muted">
293                                         <t t-esc="ticket.register_max - ticket.register_current"/> <span>left</span>
294                                     </span>
295                                 </td>
296                                 <td>
297                                     <select t-if="ticket.register_avail" t-attf-name="ticket-#{ ticket.id }" class="form-control">
298                                         <t t-foreach="range(0, ticket.register_avail > 9 and 10 or ticket.register_avail+1 )" t-as="nb"><option t-esc="nb"/></t>
299                                     </select>
300                                     <span t-if="not ticket.register_avail">Sold Out</span>
301                                 </td>
302                             </tr>
303                         </tbody>
304                     </table>
305                     <button type="submit" class="btn btn-primary btn-lg pull-right" t-if="event.register_avail">Order Now</button>
306                     <div class="clearfix"/>
307                     <hr/>
308                 </form>
309                 <div t-field="event.description"></div>
310                 <div class="clearfix"/>
311                 <ul class="media-list" id="comment">
312                     <li t-foreach="event.website_message_ids" t-as="comment" class="media">
313                         <div class="media-body">
314                             <t t-call="website.publish_management">
315                                 <t t-set="object" t-value="comment"/>
316                                 <t t-set="publish_edit" t-value="True"/>
317                                 <t t-set="publish_controller">/event/publish</t>
318                             </t>
319                             <t t-raw="comment.body"/>
320                             <small class="pull-right muted text-right">
321                                 <div t-field="comment.author_id"/>
322                                 <div t-field="comment.date"/>
323                             </small>
324                         </div>
325                     </li>
326                 </ul>
327             </div>
328             <div class="col-md-4 css_noprint">
329                 <div class="clearfix"/>
330
331                 <div class="panel panel-default" t-if="event.address_id">
332                     <div class="panel-heading">
333                         <h4>Where</h4>
334                     </div>
335                     <div class="panel-body">
336                         <a t-att-href="event.google_map_link()" target="_BLANK">
337                             <img t-att-src="event.google_map_img()" width="100%%"/>
338                         </a>
339                         <div class="mt16 mb8" t-field="event.address_id" t-field-options='{
340                             "widget": "contact",
341                             "fields": ["address", "phone", "mobile", "fax", "email"]
342                             }'/>
343                     </div>
344                 </div>
345
346                 <div class="panel panel-default">
347                     <div class="panel-heading">
348                         <h4>When</h4>
349                     </div>
350                     <div class="panel-body">
351                         <i class="fa fa-clock-o"></i> <span t-field="event.date_begin"> </span><br/>
352                         <i class="fa fa-clock-o"></i> <span t-field="event.date_end"> </span>
353                     </div>
354                 </div>
355
356                 <div class="panel panel-default" t-if="event.organizer_id">
357                     <div class="panel-heading">
358                         <h4>Organizer</h4>
359                     </div>
360                     <div class="panel-body" t-field="event.organizer_id" t-field-options='{
361                         "widget": "contact",
362                         "fields": ["name", "phone", "mobile", "fax", "email"]
363                         }'/>
364                 </div>
365
366                 <div class="panel panel-default">
367                     <div class="panel-heading">
368                         <h4>Social Stream</h4>
369                     </div>
370                     <div class="panel-body">
371                         <t t-call="website_mail.follow"><t t-set="object" t-value="event"/></t>
372                         <div t-if="event.twitter_hashtag" class="mt16">
373                             <p><strong>Participate on Twitter</strong></p>
374                             <p class="text-muted">
375                                 Find out what others are seeing and
376                                 saying about this event, and join the
377                                 conversation.
378                             </p>
379                             <p><strong>Use this tag:
380                                 <a t-att-href="'http://twitter.com/search?q=#'+event.twitter_hashtag" class="label label-primary">#<span t-field="event.twitter_hashtag"/></a>
381                             </strong></p>
382                         </div>
383                     </div>
384                 </div>
385             </div>
386         </t>
387     </template>
388 </data>
389 </openerp>