[MERGE] from trunk
[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
7     <template id="header_footer" inherit_id="website_sale.header_footer">
8         <xpath expr="//header//ul[@id='top_menu']/li" position="before">
9             <li><a href="/event">Events</a></li>
10         </xpath>
11         <xpath expr="//footer//ul[@name='products']/li" position="after">
12             <li><a href="/event">Events</a></li>
13         </xpath>
14     </template>
15
16     <template id="event_website_sale_mycart" inherit_id="website_sale.mycart">
17         <xpath expr="//small[@class='text-error']" position="replace">
18             <t t-if="(not line.event_id or line.event_ticket_id and line.event_ticket_id.price == line.product_id.lst_price)">
19                 <small class="text-error" style="text-decoration: line-through;"><t t-esc="line.product_id.lst_price" /> €</small>
20             </t>
21         </xpath>
22     </template>
23
24     <!-- Page --> 
25  
26     <template id="index" name="Events" page="True">
27         <t t-call="website.layout">
28           <t t-set="head">
29               <t t-raw="head or ''"/>
30           </t>
31           <t t-set="title">Events</t>
32           <div id="wrap">
33             <div class="oe_structure">
34                 <h1 class="text-center">Our Events</h1>
35             </div>
36             <div class="container">
37                 <div class="row">
38                     <div class="col-md-4 css_noprint" id="left_column">
39                         <ul class="nav nav-pills nav-stacked">
40                             <li class="nav-header">Date</li>
41                             <t t-foreach="dates" t-as="date">
42                                 <li t-att-class="searches.get('date') == date[0] and 'active' or ''">
43                                     <a t-attf-href="/event/#{ search_path }&amp;date=#{ date[0] }"><t t-esc="date[1]"/> <small t-if="date[3]">(<t t-esc="date[3]"/>)</small></a>
44                                 </li>
45                             </t>
46                         </ul>
47                     </div>
48                     <div class="col-md-8">
49                         <t t-call="website.pager" >
50                             <t t-set="classname">pull-left</t>
51                         </t>
52                     </div>
53                     <div class="col-md-8">
54                         <ul class="media-list">
55                             <li t-foreach="event_ids" t-as="event" class="media" data-publish="">
56                                 <t t-call="website.publish"><t t-set="object" t-value="event"/></t>
57                                 <div class="media-body">
58                                     <span t-if="not event.event_ticket_ids" class="label label-default pull-right">No tickets needed.</span>
59                                     <t t-if="event.event_ticket_ids">
60                                         <span t-if="event.register_avail == 9999" class="label label-default pull-right label-info">Tickets availables.</span>
61                                         <span t-if="not event.register_avail" class="label label-default pull-right">No ticket available.</span>
62                                         <span t-if="event.register_avail and event.register_avail != 9999" t-attf-class="label label-default pull-right label-#{ event.register_avail &lt;= 10 and 'warning' or 'info' }">
63                                             <t t-if="event.register_avail &lt;= 10">Only</t>
64                                             <t t-esc="event.register_avail"/>
65                                             <t t-if="event.register_avail &gt; 1">tickets</t>
66                                             <t t-if="event.register_avail == 1">ticket</t>
67                                             available.
68                                         </span>
69                                     </t>
70                                     <h4 class="media-heading"><a t-attf-href="/event/#{ event.id }/"><span t-field="event.name"> </span></a></h4>
71                                     <div>
72                                         <span t-field="event.type">: </span>
73                                         <t t-if="event.organizer_id">
74                                             Organized by: <span t-field="event.organizer_id"> </span>
75                                         </t>
76                                     </div>
77                                     <div>
78                                         <i class="icon-time"></i> <span t-field="event.date_begin"> </span> <i>to</i> <span t-field="event.date_end"> </span>
79                                     </div>
80                                     <div t-if="event.country_id">
81                                         <i class="icon-map-marker"></i> <span t-field="event.city"> </span>  <span t-field="event.zip"> </span>, <span t-field="event.country_id"> </span>
82                                     </div>
83                                 </div>
84                             </li>
85                         </ul>
86                     </div>
87                     <div class="col-md-8 col-lg-offset-4 text-center">
88                         <t t-call="website.pager" />
89                     </div>
90                 </div>
91             </div>
92             <div class="oe_structure"/>
93           </div>
94         </t>
95     </template>
96
97     <template id="event_category" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Category">
98         <xpath expr="//div[@id='left_column']" position="inside">
99             <ul class="nav nav-pills nav-stacked mt32">
100                 <li class="nav-header">Category</li>
101                 <t t-foreach="types">
102                     <li t-if="type" t-att-class="searches.get('type') == str(type and type[0]) and 'active' or ''">
103                         <a t-attf-href="/event/#{ search_path }&amp;type=#{ type[0] }"><t t-esc="type[1]"/> <small>(<t t-esc="type_count"/>)</small></a>
104                     </li>
105                 </t>
106             </ul>
107         </xpath>
108     </template>
109     <template id="event_location" inherit_id="website_event.index" inherit_option_id="website_event.index" name="Location">
110         <xpath expr="//div[@id='left_column']" position="inside">
111             <ul class="nav nav-pills nav-stacked mt32">
112                 <li class="nav-header">Location</li>
113                 <t t-foreach="countries">
114                     <li t-if="country_id" t-att-class="searches.get('country') == str(country_id and country_id[0]) and 'active' or ''">
115                         <a t-attf-href="/event/#{ search_path }&amp;country=#{ country_id[0] }"><t t-esc="country_id[1]"/><small>(<t t-esc="country_id_count"/>)</small></a>
116                     </li>
117                 </t>
118             </ul>
119         </xpath>
120     </template>
121
122     <template id="detail">
123         <t t-call="website.layout">
124           <t t-set="head">
125               <script type="text/javascript" src="/website_event/static/src/js/website_event.js"></script>
126               <t t-raw="head or ''"/>
127           </t>
128           <t t-set="title">Events</t>
129           <div id="wrap">
130             <div class="container">
131                 <t t-call="website.publish"><t t-set="object" t-value="event_id"/></t>
132                 <div class="row">
133                     <div class="col-md-4">
134                         <form action="./subscribe" method="POST" class="form-inline" t-if="not subscribe">
135                             <div class="col-lg-7">
136                                 <input placeholder="Email Address" type="email" name="email" class="form-control" t-if="is_public_user"/>
137                             </div>
138                             <button type="submit" class="btn btn-primary" name="subscribe">Subscribe</button>
139                         </form>
140                         <form action="./unsubscribe" method="POST" class="form-inline" t-if="subscribe">
141                             <input type="hidden" name="email" t-att-value="subscribe"/>
142                             <button type="submit" class="btn btn-default" name="unsubscribe">Unsubscribe</button>
143                         </form>
144                     </div>
145                         <div class="col-md-8">
146                         <h1 class="text-center" t-field="event_id.name"></h1>
147                         <h4 class="text-center">
148                             <i class="icon-time"></i> <span t-field="event_id.date_begin"/> to 
149                             <span t-field="event_id.date_end"/>
150                         </h4>
151                         <h5 class="text-center" t-field="event_id.address_id"/>
152                     </div>
153
154                     <div class="col-md-4 css_noprint">
155                         <h4>When &amp; Where</h4>
156                         <a t-att-href="event_id.google_map_link()" target="_BLANK">
157                             <img class="thumbnail" t-att-src="event_id.google_map_img()"/>
158                         </a>
159                         <address>
160                             <pre t-field="event_id.address_id"/>
161                             <i class="icon-time"></i> <span t-field="event_id.date_begin"> </span><br/>
162                             <i class="icon-time"></i> <span t-field="event_id.date_end"> </span>
163                             <t t-if="event_id.organizer_id">
164                                 <h6>Organized by:</h6>
165                                 <pre><t t-field="event_id.organizer_id"/><t t-if="event_id.phone"><br/><span>&amp;#x2706;</span> <span t-field="event_id.phone"></span></t><t t-if="event_id.email"><br/><i class="icon-envelope"></i> <span t-field="event_id.email"></span></t></pre>
166                             </t>
167                         </address>
168                     </div>
169                     <div class="col-md-8">
170                         <t t-if="event_id.event_ticket_ids">
171                         <hr/>
172                         <form t-attf-action="/event/#{ event_id.id }/add_cart" method="post">
173                             <table class="table">
174                                 <thead>
175                                     <tr>
176                                         <th>Ticket</th>
177                                         <th>Sales End</th>
178                                         <th>Price</th>
179                                         <th>Seats</th>
180                                         <th>Quantity</th>
181                                     </tr>
182                                 </thead>
183                                 <tbody>
184                                     <tr t-foreach="event_id.event_ticket_ids" t-as="ticket">
185                                         <td><span t-field="ticket.name"/></td>
186                                         <td><span t-field="ticket.deadline"/></td>
187                                         <td><span t-field="ticket.price"/></td>
188                                         <td><span t-if="ticket.register_max"><t t-esc="ticket.register_current"/>/<t t-field="ticket.register_max"/></span></td>
189                                         <td>
190                                             <select t-if="ticket.register_avail" t-attf-name="ticket-#{ ticket.id }" class="form-control">
191                                                 <t t-foreach="range(0, ticket.register_avail > 9 and 10 or ticket.register_avail+1 )" t-as="nb"><option t-esc="nb"/></t>
192                                             </select>
193                                             <span t-if="not ticket.register_avail">No tickets available</span>
194                                         </td>
195                                     </tr>
196                                 </tbody>
197                             </table>
198                             <button type="submit" class="btn btn-primary" t-if="event_id.register_avail">Order Now</button>
199                         </form>
200                         </t>
201                         <hr/>
202                         <div t-field="event_id.description_website"></div>
203                         <hr/>
204                         <ul class="media-list" id="comment">
205                             <li t-foreach="message_ids" t-as="comment" class="media">
206                                 <div class="media-body">
207                                     <t t-call="website.publish"><t t-set="object" t-value="comment"/></t>
208                                     <t t-raw="comment.body"/>
209                                     <small class="pull-right muted text-right">
210                                         <div t-field="comment.author_id"/>
211                                         <div t-field="comment.date"/>
212                                     </small>
213                                 </div>
214                             </li>
215                         </ul>
216                     </div>
217                 </div>
218             </div>
219           </div>
220         </t>
221     </template>
222  </data>
223 </openerp>