[IMP] empty screen for events
authorFabien Pinckaers <fp@openerp.com>
Mon, 11 Nov 2013 21:24:33 +0000 (22:24 +0100)
committerFabien Pinckaers <fp@openerp.com>
Mon, 11 Nov 2013 21:24:33 +0000 (22:24 +0100)
bzr revid: fp@openerp.com-20131111212433-xyvl14vhewsp2g14

addons/website_event/controllers/main.py
addons/website_event/views/website_event.xml

index f40d87d..b31abca 100644 (file)
@@ -98,7 +98,7 @@ class website_event(http.Controller):
             domain_search["country"] = [("country_id", "=", int(searches["country"]))]
 
         def dom_without(without):
-            domain = SUPERUSER_ID != request.uid and [('website_published', '=', True)] or [(1, "=", 1)]
+            domain = [('state', "in", ['draft','confirm','done'])]
             for key, search in domain_search.items():
                 if key != without:
                     domain += search
index 91488d2..461c91e 100644 (file)
@@ -28,7 +28,7 @@
                     <div class="col-md-3 col-sm-4 css_noprint" id="left_column">
                         <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]=='old')">
+                                <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/#{ search_path }&amp;date=#{ date[0] }"><t t-esc="date[1]"/>
                                         <span t-if="date[3]" class="badge pull-right"><t t-esc="date[3]"/></span>
                                     </a>
                         </t>
                         <div class="oe_structure">
                         </div>
+                        <t t-if="not event_ids">
+                            <p t-if="current_date or current_country or current_type">
+                                No event found in this category, check <a href="/event">all events</a>.
+                            </p>
+                            <p t-if="(current_date is None) and (current_country is None) and (current_type is None)">
+                                No events are planned for now on.
+                            </p>
+                        </t>
                         <ul class="media-list">
                             <li t-foreach="event_ids" t-as="event" class="media" data-publish="">
                                 <div class="media-body">