[IMP] integrate mail client actions with search view
authorGéry Debongnie <ged@odoo.com>
Tue, 7 Oct 2014 14:32:22 +0000 (16:32 +0200)
committerGéry Debongnie <ged@odoo.com>
Tue, 21 Oct 2014 07:33:50 +0000 (09:33 +0200)
The mail client actions did not integrate with the search view.  (it is actually an ugly hack to fake a view manager and instantiate a search view. of course it was broken when the search view was refactored)

addons/mail/static/src/js/mail.js
addons/mail/static/src/xml/mail.xml

index 2a71c42..ef5cab9 100644 (file)
@@ -1968,11 +1968,16 @@ openerp.mail = function (session) {
          * @param {Object} defaults ??
          */
         load_searchview: function (defaults) {
+            var self = this;
             var ds_msg = new session.web.DataSetSearch(this, 'mail.message');
-            this.searchview = new session.web.SearchView(this, ds_msg, false, defaults || {}, false);
+            var options = {
+                $buttons: this.$('.oe-search-options')
+            };
+            this.searchview = new session.web.SearchView(this, ds_msg, false, defaults || {}, options);
             this.searchview.on('search_data', this, this.do_searchview_search);
-            this.searchview.appendTo(this.$('.oe_view_manager_view_search'), 
-                                   this.$('.oe_searchview_drawer_container'));
+            this.searchview.appendTo(this.$('.oe-view-manager-search-view')).then(function () {
+                self.searchview.toggle_visibility(true);
+            });
             if (this.searchview.has_defaults) {
                 this.searchview.ready.then(this.searchview.do_search);
             }
index 761091d..5338a1d 100644 (file)
         wall main template
         Template used to display the communication history in the wall.
         -->
-    <div t-name="mail.wall" class="oe_view_manager oe_mail_wall oe_view_manager_current">
-        <table class="oe_view_manager_header">
-          <colgroup>
-            <col width="33%"/>
-            <col width="33%"/>
-            <col width="34%"/>
-          </colgroup>
-          <tbody>
-            <tr class="oe_header_row oe_header_row_top">
-                <td colspan="2">
-                    <h2 class="oe_view_title">
-                        <span class="oe_view_title_text">
-                            <t t-esc="widget.action.name"/>
-                        </span>
-                    </h2>
-                    <t t-if="widget.action.params.header_description">
-                        <br/>
-                        <span class="oe_view_subtitle_text">
-                            <t t-raw="widget.action.params.header_description"/>
-                        </span>
-                    </t>
-                </td>
-                <td><div class="oe_view_manager_view_search"/></td>
-            </tr>
-          </tbody>
-        </table>
-        <div class="oe_view_manager_wrapper">
-            <div>
-                <div class="oe_view_manager_body">
-                    <div class="oe_searchview_drawer_container"/>
+    <div t-name="mail.wall" class="oe-view-manager oe_mail_wall oe_view_manager_current">
+        <div class="oe-view-manager-header container-fluid">
+            <div class="row">
+                <div class="col-md-6 oe-header-title">
+                    <ol class="oe-view-title breadcrumb">
+                        <li class="active"><t t-esc="widget.action.name"/></li>
+                    </ol>
+                </div>
+                <div class="oe-view-manager-search-view col-md-6" />
+            </div>
+            <div class="row">
+                <div class="col-sm-6 col-sm-offset-6">
+                    <div class="oe-search-options btn-group"/>
+                </div>
+            </div>
+        </div>
+        <div class="oe-view-manager-content">
+            <div class="oe-view-manager-body">
+                <div>
                     <div class="oe_mail-placeholder"></div>
                     <aside class="oe_mail_wall_aside"></aside>
                 </div>