[IMP] removing static style
[odoo/odoo.git] / addons / website_event / views / website_event.xml
index 52c84b3..d38d490 100644 (file)
@@ -2,8 +2,14 @@
 <openerp>
 <data>
 
-<template id="editor_head" inherit_id="website.editor_head" name="Event Editor" groups="event.group_event_manager">
-    <xpath expr="//script[@id='website_tour_js']" position="after">
+<template id="event_script" inherit_id="website.assets_frontend" name="Country Events Snippet Script">
+    <xpath expr="/t" position="inside">
+        <script type="text/javascript" src="/website_event/static/src/js/website_geolocation.js"></script>
+    </xpath>
+</template>
+
+<template id="editor_head" inherit_id="website.assets_editor" name="Event Editor" groups="event.group_event_manager">
+    <xpath expr="." position="inside">
         <script type="text/javascript" src="/website_event/static/src/js/website_event.editor.js"></script>
         <script type="text/javascript" src="/website_event/static/src/js/website.tour.event.js"></script>
     </xpath>
             <div class="row mt8">
                 <div class="col-sm-5">
                     <ol class="breadcrumb mb0">
-                        <li class="active">
-                            Our Events
+                        <li>
+                            <a href="/event">Our Events</a>
                         </li>
+                        <li t-if="current_date"><t t-esc="current_date"/></li>
+                        <li t-if="current_type"><t t-esc="current_type.name"/></li>
+                        <li t-if="current_country"><t t-esc="current_country.name"/></li>
                     </ol>
                 </div><div class="col-sm-7">
                     <t t-call="website.pager" >
                     </t>
                 </div>
             </div>
-            <h3 class="text-center text-muted">
-                <t t-esc="current_date or ''"/><span t-if="current_type"><t t-if="current_date">,</t>
-                  <t t-esc="current_type.name"/></span><span t-if="current_country"><t t-if="current_type or current_date">,</t>
-                  <t t-esc="current_country.name"/>
-                </span>
-            </h3>
             <div class="row mt32 mb32">
                 <div class="col-md-9" id="middle_column">
-                    <t t-if="not event_ids">
-                        <div class="text-center text-muted">
-                          <h3 class="css_editable_display">No event found</h3>
-                          <h3 class="css_editable_hidden">There isn't available events right now, <t t-if="current_date or current_country or current_type">click <a t-href="/event">here</a> to check all events or</t> click <a t-href="/page/website.contactus">here</a> to contact us</h3>
-                          <t groups="base.group_website_publisher">
-                            <t groups="event.group_event_manager">
-                                <p>Click on "Content" to define a new event or "Help" for more informations.</p>
-                                <img src="/website/static/src/img/content_here.png"/>
-                                <p>In the backend's event form contains information to customize your events: location, oranizer, tikets, registrations, etc.</p>
-                              </t>
-                          </t>
-                        </div>
-                    </t>
+                    <div class="text-center text-muted" t-if="not event_ids">
+                      <h1>No event found</h1>
+                      <t groups="base.group_website_publisher">
+                          <p groups="event.group_event_manager">Use the top menu <i>'Content'</i> to create your first event.</p>
+                      </t>
+                    </div>
                     <ul class="media-list">
                         <li t-foreach="event_ids" t-as="event" class="media">
-                            <div class="media-body">
+                            <div itemscope="itemscope" itemtype="http://schema.org/Event" class="media-body">
                                 <h4 class="media-heading">
-                                    <a t-att-class="event.state == 'done' and 'text-success'" t-href="/event/#{ slug(event) }/#{(not event.menu_id) and 'register/' or ''}"><span t-field="event.name"> </span></a>
+                                    <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>
                                     <small t-if="not event.website_published" class="label label-danger">not published</small>
                                 </h4>
                                 <div>
                                     </t>
                                 </div>
                                 <div>
-                                    <i class="fa fa-clock-o"></i> <span t-field="event.date_begin"> </span> <i>to</i> <span t-field="event.date_end"> </span>
+                                    <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>
                                 </div>
-                                <div t-field="event.address_id" t-field-options='{
+                                <div itemprop="location" t-field="event.address_id" t-field-options='{
                                     "widget": "contact",
                                     "fields": ["city"]
                                     }'/>
-                                <div class="text-muted">
+                                <div class="text-muted" t-if="event.type">
                                     <i class="fa fa-tag"></i> <span t-field="event.type"/>
                                 </div>
                             </div>
     </xpath>
 </template>
 
-<template id="event_left_column" inherit_option_id="website_event.index" name="Filters">
+<template id="event_right_country_event" inherit_option_id="website_event.index" name="Country Events">
+    <xpath expr="//div[@id='right_column']" position="inside">
+        <div class="row">
+            <div class="col-md-12 mb16 mt16 country_events">
+                <div class="country_events_list">
+                    <div class="text-muted text-center">
+                        <h1>
+                            <i class="fa fa-flag fa-5x"></i>
+                        </h1>
+                        <h1>Events from Your Country</h1>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </xpath>
+</template>
+
+<template id="event_left_column" inherit_option_id="website_event.index" inherit_id="website_event.index" name="Filters">
     <xpath expr="//div[@id='middle_column']" position="attributes">
         <attribute name="class">col-md-6</attribute>
     </xpath>
             <ul class="nav nav-pills nav-stacked">
                 <t t-foreach="dates" t-as="date">
                     <li t-att-class="searches.get('date') == date[0] and 'active' or ''" t-if="date[3] or (date[0] in ('old','all'))">
-                        <a t-href="/event/?date=#{ date[0] }" t-keep-query="country,type"><t t-esc="date[1]"/>
+                        <a t-attf-href="/event?{{ keep_query('country', 'type', date=date[0]) }}"><t t-esc="date[1]"/>
                             <span t-if="date[3]" class="badge pull-right"><t t-esc="date[3]"/></span>
                         </a>
                     </li>
         <ul class="nav nav-pills nav-stacked mt32">
             <t t-foreach="types">
                 <li t-if="type" t-att-class="searches.get('type') == str(type and type[0]) and 'active' or ''">
-                    <a t-href="/event/?type=#{ type[0] }" t-keep-query="country,date"><t t-esc="type[1]"/>
+                    <a t-attf-href="/event?{{ keep_query('country', 'date', type=type[0]) }}"><t t-esc="type[1]"/>
                         <span class="badge pull-right"><t t-esc="type_count"/></span>
                     </a>
                 </li>
         </ul>
     </xpath>
 </template>
+
 <template id="event_location" inherit_option_id="website_event.event_left_column" name="Filter by Country">
     <xpath expr="//div[@id='left_column']" position="inside">
         <ul class="nav nav-pills nav-stacked mt32">
             <t t-foreach="countries">
                 <li t-if="country_id" t-att-class="searches.get('country') == str(country_id and country_id[0]) and 'active' or ''">
-                    <a t-href="/event/?country=#{ country_id[0] }" t-keep-query="type,date"><t t-esc="country_id[1]"/>
+                    <a t-attf-href="/event?{{ keep_query('type', 'data', country=country_id[0]) }}"><t t-esc="country_id[1]"/>
                         <span class="badge pull-right"><t t-esc="country_id_count"/></span>
                     </a>
                 </li>
 <template id="layout">
     <t t-call="website.layout">
       <div id="wrap" class="js_event">
-        <div class="oe_structure"/>
         <div class="container">
             <div class="row mt8">
                 <div class="col-sm-7" id="event_menu">
                     <ol class="breadcrumb mb0" t-if="not event.menu_id">
                         <li><a href="/event">All Events</a></li>
                         <li t-if="event.type">
-                            <a t-href="/event?type=#{event.type.id}" t-esc="event.type.name"/>
+                            <a t-attf-href="/event?type=#{event.type.id}" t-esc="event.type.name"/>
                         </li>
                         <li t-if="event.country_id">
-                            <a t-href="/event?country=#{event.country_id.id}" t-esc="event.country_id.name"/>
+                            <a t-attf-href="/event?country=#{event.country_id.id}" t-esc="event.country_id.name"/>
                         </li>
                         <li class="active">
                             <span t-field="event.name"/>
                 </div>
                 <div class="col-sm-5" groups="event.group_event_manager">
                     <t t-call="website.publish_management">
-                        <t t-set="object" t-value="event"/>
-                        <t t-set="publish_edit" t-value="True"/>
-                        <t t-set="publish_controller">/event/publish</t>
+                      <t t-set="object" t-value="event"/>
+                      <t t-set="publish_edit" t-value="True"/>
+                      <t t-set="action" t-value="'event.action_event_view'"/>
                     </t>
                 </div>
             </div>
 
 <template id="event_details">
     <t t-call="website_event.layout">
-        <div class="container">
-            <h1 class="text-center" t-field="event.name"></h1>
+        <div itemscope="itemscope" itemtype="http://schema.org/Event" class="container">
+            <h1 itemprop="name" class="text-center" t-field="event.name"></h1>
             <h4 class="text-center text-muted">
-                <i class="fa fa-clock-o"></i> <span t-field="event.date_begin"/> to
-                <span t-field="event.date_end"/>
+                <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="event.date_begin" t-field-options='{"hide_seconds":"True"}'/> to
+                <span itemprop="endDate" t-field="event.date_end" t-field-options='{"hide_seconds":"True"}'/>
             </h4>
             <h4 class="text-center text-muted"
                 t-field="event.address_id" t-field-options='{
                 <div class="container">
                     <h1 class="mt32">Event not found!</h1>
                     <p>Sorry, the requested event is not available anymore.</p>
-                    <p><a t-href="/event/">Return to the event list.</a></p>
+                    <p><a t-attf-href="/event">Return to the event list.</a></p>
                 </div>
             </div>
         </div>
 <template id="event_description_full">
     <t t-call="website_event.event_details">
         <div class="col-md-8">
-            <div t-field="event.description"></div>
+            <div itemprop="description" t-field="event.description"></div>
             <div class="clearfix"/>
             <ul class="media-list" id="comment">
                 <li t-foreach="event.website_message_ids" t-as="comment" class="media">
                         <t t-call="website.publish_management">
                             <t t-set="object" t-value="comment"/>
                             <t t-set="publish_edit" t-value="True"/>
-                            <t t-set="publish_controller">/event/publish</t>
                         </t>
                         <t t-raw="comment.body"/>
                         <small class="pull-right muted text-right">
                             <div t-field="comment.author_id"/>
-                            <div t-field="comment.date"/>
+                            <div t-field="comment.date" t-field-options='{"hide_seconds":"True"}'/>
                         </small>
                     </div>
                 </li>
                     <a t-att-href="event.google_map_link()" target="_BLANK">
                         <img t-att-src="event.google_map_img()" width="100%%"/>
                     </a>
-                    <div class="mt16 mb8" t-field="event.address_id" t-field-options='{
+                    <div itemprop="location" class="mt16 mb8" t-field="event.address_id" t-field-options='{
                         "widget": "contact",
                         "fields": ["address", "phone", "mobile", "fax", "email"]
                         }'/>
                     <h4>When</h4>
                 </div>
                 <div class="panel-body">
-                    <i class="fa fa-clock-o"></i> <span t-field="event.date_begin"> </span><br/>
-                    <i class="fa fa-clock-o"></i> <span t-field="event.date_end"> </span>
+                    <i class="fa fa-clock-o"></i> From <span t-field="event.date_begin" t-field-options='{"hide_seconds":"True"}'> </span><br/>
+                    <i class="fa fa-clock-o"></i> To <span t-field="event.date_end" t-field-options='{"hide_seconds":"True"}'> </span>
                 </div>
             </div>
 
                             and join the conversation.
                         </p>
                         <p><strong>Use this tag:
-                            <a t-att-href="'http://twitter.com/search?q=#'+event.twitter_hashtag" class="label label-primary">#<span t-field="event.twitter_hashtag"/></a>
+                            <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>
                         </strong></p>
                     </div>
                 </div>
         </div>
     </t>
 </template>
+
+<template id="country_events" name="Country Events" inherit_id="website.snippets">
+    <xpath expr="//div[@id='snippet_content']" position="inside">
+        <div>
+            <div class="oe_snippet_thumbnail">
+                <div style="background: white;box-shadow:none;-webkit-box-shadow:none;" class="oe_snippet_thumbnail_img" >
+                    <i class="fa fa-flag fa-5x text-muted"></i>
+                </div>
+                <span class="oe_snippet_thumbnail_title">Local Events</span>
+            </div>
+            <div class="oe_snippet_body oe_country_events mb16 mt16">
+                <div class="country_events_list">
+                    <div class="text-muted text-left">
+                        <div>
+                            <img class="img-rounded img-responsive" src="/website_event/static/src/img/world_map.jpg"></img>
+                        </div>
+                        <div>Events in visitor's country</div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </xpath>
+    <xpath expr="//div[@id='snippet_options']" position="inside">
+        <div data-snippet-option-id='country_events'
+            data-selector=".oe_country_events"
+            data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel"
+            data-selector-children=".content"
+           >
+        </div>
+    </xpath>
+</template>
+
+<template id="country_events_list" name="Country">
+    <t t-ignore="true">
+        <t t-if="events">
+            <div class="country_events_list">
+                <div>
+                    <t t-if="country">
+                        <img class="img-rounded img-responsive" t-att-src="'/website/image?model=res.country&amp;field=image&amp;id='+str(country.id)"></img>
+                        <h4><b>Events: <span t-esc="country.name"></span></b></h4>
+                    </t>
+                    <t t-if="not country">
+                        <img class="img-rounded img-responsive" src="/website_event/static/src/img/world_map.jpg"></img>
+                        <h4><b>Upcoming Events</b></h4>
+                    </t>
+                    <div t-foreach="events[:5]" t-as="event_dict" class="oe_website_overflow_ellipsis mb8">
+                        <t t-if="not event_dict['event'].website_published">
+                            <span class="label label-danger"><i class="fa fa-ban"></i></span>
+                        </t>
+                        <t t-if="event_dict['event'].address_id">
+                            <i class="fa fa-map-marker"></i>
+                        </t>
+                        <t t-if="not event_dict['event'].address_id">
+                            <i class="fa fa-cloud"></i>
+                        </t>
+                        <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>
+                    </div>
+                    <t t-if="len(events) > 5">
+                        <div t-if="country">
+                            <b><a t-att-href="'/event?country='+str(country.id)">See all events from <span t-esc="country.name"></span></a></b>
+                        </div>
+                        <div t-if="not country">
+                            <b><a href="/event"> See all upcoming events </a></b>
+                        </div>
+                    </t>
+                </div>
+            </div>
+        </t>
+    </t>
+</template>
 </data>
 </openerp>