[IMP] Event improvement in views
[odoo/odoo.git] / addons / website_event / views / website_event.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4
5     <!-- Layout add nav and footer -->
6     <template id="header_footer_custom" inherit_id="website.layout" name="Footer Events Link">
7         <xpath expr="//footer//ul[@name='products']" position="inside">
8             <li><a t-href="/event">Events</a></li>
9         </xpath>
10     </template>
11
12     <!-- Page -->
13     <template id="index" name="Events">
14         <t t-call="website.layout">
15           <div id="wrap">
16             <div class="oe_structure"/>
17             <div class="container">
18                 <h1 class="text-center">
19                     Next Events
20                 </h1>
21                 <h3 class="text-center text-muted">
22                     <t t-esc="current_date or ''"/><span t-if="current_type"><t t-if="current_date">,</t>
23                       <t t-esc="current_type.name"/></span><span t-if="current_country"><t t-if="current_type or current_date">,</t>
24                       <t t-esc="current_country.name"/>
25                     </span>
26                 </h3>
27                 <div class="row mt16 mb32">
28                     <div class="col-md-3 col-sm-4 css_noprint" id="left_column">
29                         <ul class="nav nav-pills nav-stacked">
30                             <t t-foreach="dates" t-as="date">
31                                 <li t-att-class="searches.get('date') == date[0] and 'active' or ''" t-if="date[3]">
32                                     <a t-href="/event/#{ search_path }&amp;date=#{ date[0] }"><t t-esc="date[1]"/>
33                                         <span t-if="date[3]" class="badge pull-right"><t t-esc="date[3]"/></span>
34                                     </a>
35                                 </li>
36                             </t>
37                         </ul>
38                     </div>
39                     <div class="col-sm-7 col-md-6" id="middle_column">
40                         <t t-call="website.pager" >
41                             <t t-set="classname">pull-left</t>
42                         </t>
43                         <div class="oe_structure">
44                         </div>
45                         <ul class="media-list">
46                             <li t-foreach="event_ids" t-as="event" class="media" data-publish="">
47                                 <div class="media-body">
48                                     <t t-if="event.event_ticket_ids">
49                                         <span t-if="not event.register_avail" class="label label-danger pull-right">Sold Out</span>
50                                         <span t-if="event.register_avail and event.register_avail &lt;= ((event.register_max or 0) / 4)" class="label pull-right label-info">
51                                             Only <t t-esc="event.register_avail"/> Remaining
52                                         </span>
53                                     </t>
54                                     <h4 class="media-heading"><a t-href="/event/#{ event.id }/"><span t-field="event.name"> </span></a></h4>
55                                     <div>
56                                         <t t-if="event.organizer_id">
57                                             Organized by: <span t-field="event.organizer_id"> </span>
58                                         </t>
59                                     </div>
60                                     <div>
61                                         <i class="icon-time"></i> <span t-field="event.date_begin"> </span> <i>to</i> <span t-field="event.date_end"> </span>
62                                     </div>
63                                     <div t-if="event.country_id">
64                                         <i class="icon-map-marker"></i> <span t-field="event.city"/>, <span t-field="event.country_id"/>
65                                     </div>
66                                     <div class="text-muted">
67                                         <i class="icon-tag"></i> <span t-field="event.type"/>
68                                     </div>
69                                 </div>
70                             </li>
71                         </ul>
72                     </div>
73                     <div class="col-sm-2 col-md-3 oe_structure" id="right_column">
74
75
76                     </div>
77                     <div class="col-md-8 col-lg-offset-4 text-center">
78                         <t t-call="website.pager" />
79                     </div>
80                 </div>
81             </div>
82             <div class="oe_structure"/>
83           </div>
84         </t>
85     </template>
86
87     <template id="event_right_photos" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Photos">
88         <xpath expr="//div[@id='right_column']" position="inside">
89             <div class="row">
90                 <div class="col-md-12 mb16">
91                     <div class="oe_demo">
92                         <img src="http://ebmedia.eventbrite.com/s3-build/17022-rc2013-11-04-acfb89e/django/images/pages/home/featcats_bizpro.jpg"/>
93                         <div class="text-center"><a href="/">Photos of Events</a></div>
94                     </div>
95                 </div>
96                 <div class="col-md-12 mb16">
97                     <div class="oe_demo">
98                         <img src="http://ebmedia.eventbrite.com/s3-build/17022-rc2013-11-04-acfb89e/django/images/pages/home/featcats_bizpro.jpg"/>
99                         <div class="text-center"><a href="/">Customer Quotes</a></div>
100                     </div>
101                 </div>
102             </div>
103         </xpath>
104     </template>
105
106     <template id="event_right_quotes" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Quotes">
107         <xpath expr="//div[@id='right_column']" position="inside">
108             <div class="row">
109                 <div class="col-md-12 mb16">
110                     <blockquote class="oe_snippet_body">
111                         <p>
112                             Write here a quote from one of your attendees.
113                             It gives confidence in your
114                             events.
115                         </p>
116                         <small>Author</small>
117                     </blockquote>
118                 </div>
119             </div>
120         </xpath>
121     </template>
122
123     <template id="event_category" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Filter by Category">
124         <xpath expr="//div[@id='left_column']" position="inside">
125             <ul class="nav nav-pills nav-stacked mt32">
126                 <t t-foreach="types">
127                     <li t-if="type" t-att-class="searches.get('type') == str(type and type[0]) and 'active' or ''">
128                         <a t-href="/event/#{ search_path }&amp;type=#{ type[0] }"><t t-esc="type[1]"/>
129                             <span class="badge pull-right"><t t-esc="type_count"/></span>
130                         </a>
131                     </li>
132                 </t>
133             </ul>
134         </xpath>
135     </template>
136     <template id="event_location" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Filter by Country">
137         <xpath expr="//div[@id='left_column']" position="inside">
138             <ul class="nav nav-pills nav-stacked mt32">
139                 <t t-foreach="countries">
140                     <li t-if="country_id" t-att-class="searches.get('country') == str(country_id and country_id[0]) and 'active' or ''">
141                         <a t-href="/event/#{ search_path }&amp;country=#{ country_id[0] }"><t t-esc="country_id[1]"/>
142                             <span class="badge pull-right"><t t-esc="country_id_count"/></span>
143                         </a>
144                     </li>
145                 </t>
146             </ul>
147         </xpath>
148     </template>
149
150     <template id="event_description_full">
151         <t t-call="website.layout">
152           <t t-set="additional_title">Events</t>
153           <div id="wrap">
154             <div class="container">
155
156                 <h1 class="text-center" t-field="event_id.name"></h1>
157                 <h4 class="text-center text-muted">
158                     <i class="icon-time"></i> <span t-field="event_id.date_begin"/> to
159                     <span t-field="event_id.date_end"/>
160                 </h4>
161                 <h4 t-if="event_id.city and event_id.country_id" class="text-center text-muted">
162                     <i class="icon-map-marker"/>
163                     <span t-field="event_id.city"/>,
164                     <span t-field="event_id.country_id"/>
165                 </h4>
166
167                 <div class="row mt32 mb32">
168                     <div class="col-md-8">
169                         <form t-action="/event/#{ event_id.id }/add_cart" method="post" t-if="event_id.event_ticket_ids">
170                             <table class="table table-striped">
171                                 <thead>
172                                     <tr>
173                                         <th>Ticket Type</th>
174                                         <th style="min-width: 100px">Sales End</th>
175                                         <th style="min-width: 100px">Price</th>
176                                         <th></th>
177                                         <th>Quantity</th>
178                                     </tr>
179                                 </thead>
180                                 <tbody>
181                                     <tr t-foreach="event_id.event_ticket_ids" t-as="ticket">
182                                         <td>
183                                             <div t-field="ticket.name"/>
184                                             <div><small t-field="ticket.product_id.description_sale"/></div>
185                                         </td>
186                                         <td><span t-field="ticket.deadline"/></td>
187                                         <td><span t-field="ticket.price"/></td>
188                                         <td>
189                                             <span t-if="ticket.register_max and (float(ticket.register_current or 0) / ticket.register_max)&lt;=0.2" class="text-muted">
190                                                 <t t-esc="ticket.register_max - ticket.register_current"/> <span>left</span>
191                                             </span>
192                                         </td>
193                                         <td>
194                                             <select t-if="ticket.register_avail" t-attf-name="ticket-#{ ticket.id }" class="form-control">
195                                                 <t t-foreach="range(0, ticket.register_avail > 9 and 10 or ticket.register_avail+1 )" t-as="nb"><option t-esc="nb"/></t>
196                                             </select>
197                                             <span t-if="not ticket.register_avail">Sold Out</span>
198                                         </td>
199                                     </tr>
200                                 </tbody>
201                             </table>
202                             <button type="submit" class="btn btn-primary btn-lg pull-right" t-if="event_id.register_avail">Order Now</button>
203                             <div class="clearfix"/>
204                             <hr/>
205                         </form>
206                         <div t-field="event_id.description"></div>
207                         <div class="clearfix"/>
208                         <ul class="media-list" id="comment">
209                             <li t-foreach="event_id.website_message_ids" t-as="comment" class="media">
210                                 <div class="media-body">
211                                     <t t-call="website.publish_management">
212                                         <t t-set="object" t-value="comment"/>
213                                         <t t-set="publish_edit" t-value="True"/>
214                                         <t t-set="publish_controller">/event/publish</t>
215                                     </t>
216                                     <t t-raw="comment.body"/>
217                                     <small class="pull-right muted text-right">
218                                         <div t-field="comment.author_id"/>
219                                         <div t-field="comment.date"/>
220                                     </small>
221                                 </div>
222                             </li>
223                         </ul>
224                     </div>
225                     <div class="col-md-4 css_noprint">
226                         <div class="clearfix"/>
227
228                         <div class="panel panel-default" t-if="event_id.address_id">
229                             <div class="panel-heading">
230                                 <t t-call="website.publish_management">
231                                     <t t-set="object" t-value="event_id"/>
232                                     <t t-set="publish_edit" t-value="True"/>
233                                     <t t-set="publish_controller">/event/publish</t>
234                                     <t t-set="style">position: relative; top: -80px;</t>
235                                 </t>
236                                 <h4>Where</h4>
237                             </div>
238                             <div class="panel-body">
239                                 <a t-att-href="event_id.google_map_link()" target="_BLANK">
240                                     <img t-att-src="event_id.google_map_img()" width="100%%"/>
241                                 </a>
242                                 <address class="mt16 mb8">
243                                     <strong t-field="event_id.address_id.name"/>
244                                     <p t-field="event_id.address_id"/>
245                                     <div t-if="event_id.address_id.phone">
246                                         <span class="icon-phone"/> <span t-field="event_id.address_id.phone"/>
247                                     </div>
248                                     <div t-if="event_id.address_id.email">
249                                         <span class="icon-envelope"/>
250                                         <a t-att-href="'mailto:'+event_id.address_id.email">
251                                           <span t-field="event_id.address_id.email"/>
252                                         </a>
253                                     </div>
254                                 </address>
255                             </div>
256                         </div>
257
258                         <div class="panel panel-default" t-if="event_id.address_id">
259                             <div class="panel-heading">
260                                 <h4>When</h4>
261                             </div>
262                             <div class="panel-body">
263                                 <i class="icon-time"></i> <span t-field="event_id.date_begin"> </span><br/>
264                                 <i class="icon-time"></i> <span t-field="event_id.date_end"> </span>
265                             </div>
266                         </div>
267
268                         <div class="panel panel-default" t-if="event_id.organizer_id">
269                             <div class="panel-heading">
270                                 <h4>Organizer</h4>
271                             </div>
272                             <div class="panel-body">
273                                 <p><strong t-field="event_id.organizer_id.display_name"/></p>
274                                 <div t-if="event_id.phone">
275                                     <span class="icon-phone"/> <span t-field="event_id.phone"/>
276                                 </div>
277                                 <div t-if="event_id.email">
278                                     <i class="icon-envelope"/> <span t-field="event_id.email"/>
279                                 </div>
280                             </div>
281                         </div>
282
283                         <div class="panel panel-default">
284                             <div class="panel-heading">
285                                 <h4>Social Stream</h4>
286                             </div>
287                             <div class="panel-body">
288                                 <t t-call="website_mail.follow"><t t-set="object" t-value="event_id"/></t>
289                                 <div t-if="event_id.twitter_hashtag">
290                                     <p><strong>Join the Experience</strong></p>
291                                     <p class="text-muted">
292                                         Find out what others are seeing and
293                                         saying about this event, and join the
294                                         conversation.
295                                     </p>
296                                     <p><strong>Use this tag:
297                                         <a t-att-href="'twitter.com/search?q=#'+event_id.twitter_hashtag" class="label label-primary">#<span t-field="event_id.twitter_hashtag"/></a>
298                                     </strong></p>
299                                 </div>
300                             </div>
301                         </div>
302
303                         <ul class="list-unstyled">
304                             <li t-if="event_id.type">
305                                 <a t-href="/event?type=#{event_id.type.id}"><strong><span class="icon-double-angle-right"/> Other <t t-esc="event_id.type.name"/></strong></a>
306                             </li>
307                             <li t-if="event_id.country_id">
308                                 <a t-href="/event?country=#{event_id.country_id.id}"><strong><span class="icon-double-angle-right"/> Other Events in <span t-esc="event_id.country_id.name"/></strong></a>
309                             </li>
310                             <li><a t-href="/event"><strong><span class="icon-double-angle-right"/> All Events</strong></a></li>
311                         </ul>
312                     </div>
313                 </div>
314             </div>
315           </div>
316         </t>
317     </template>
318  </data>
319 </openerp>