Thibault Delavallée (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-social-tde into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-social-tde/+merge/100760
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-social-tde/+merge/100760
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-social-tde.
=== modified file 'addons/web/controllers/main.py'
--- addons/web/controllers/main.py	2012-04-02 14:00:20 +0000
+++ addons/web/controllers/main.py	2012-04-05 17:02:25 +0000
@@ -875,13 +875,13 @@
         context = req.session.eval_context(req.context)
         Menus = req.session.model('ir.ui.menu')
 
-        menu_roots = Menus.read(self.do_get_user_roots(req), ['name', 'sequence', 'parent_id', 'action'], context)
+        menu_roots = Menus.read(self.do_get_user_roots(req), ['name', 'sequence', 'parent_id', 'action', 'needaction_enabled', 'needaction_counter'], context)
         menu_root = {'id': False, 'name': 'root', 'parent_id': [-1, ''], 'children' : menu_roots}
 
         # menus are loaded fully unlike a regular tree view, cause there are a
         # limited number of items (752 when all 6.1 addons are installed)
         menu_ids = Menus.search([], 0, False, False, context)
-        menu_items = Menus.read(menu_ids, ['name', 'sequence', 'parent_id', 'action'], context)
+        menu_items = Menus.read(menu_ids, ['name', 'sequence', 'parent_id', 'action', 'needaction_enabled', 'needaction_counter'], context)
         # adds roots at the end of the sequence, so that they will overwrite
         # equivalent menu items from full menu read when put into id:item
         # mapping, resulting in children being correctly set on the roots.

=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css	2012-03-28 10:04:02 +0000
+++ addons/web/static/src/css/base.css	2012-04-05 17:02:25 +0000
@@ -220,6 +220,19 @@
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
   -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
 }
+.openerp2 .oe_secondary_submenu .oe_menu_counter {
+  float: right;
+  background: #8a89ba;
+  color: #eeeeee;
+  font-size: 12px;
+  border: 1px solid lightgray;
+  padding: 0px 4px 0px 4px;
+  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
+  margin: 0px;
+  -moz-border-radius: 4px;
+  -webkit-border-radius: 4px;
+  border-radius: 4px;
+}
 .openerp2 .oe_secondary_submenu .oe_active {
   background: #8a89ba;
   border-top: 1px solid lightGray;
@@ -240,6 +253,10 @@
   -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
   -box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
 }
+.openerp2 .oe_secondary_submenu .oe_active .oe_menu_counter {
+  background: #eeeeee;
+  color: #8a89ba;
+}
 .openerp2 .oe_secondary_submenu .oe_menu_toggler:before {
   width: 0;
   height: 0;

=== modified file 'addons/web/static/src/css/base.sass'
--- addons/web/static/src/css/base.sass	2012-03-28 10:04:02 +0000
+++ addons/web/static/src/css/base.sass	2012-04-05 17:02:25 +0000
@@ -238,6 +238,16 @@
                 text-shadow: 0 1px 1px rgba(0,0,0,0.2)
                 @include radius(4px)
                 @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.2))
+        .oe_menu_counter 
+            float: right
+            background: #8a89ba
+            color: #eee
+            font-size: 12px
+            border: 1px solid lightgray
+            padding: 0px 4px 0px 4px
+            text-shadow: 0 1px 1px rgba(0,0,0,0.2)
+            margin: 0px
+            @include radius(4px)
         .oe_active
             background: $colour4
             border-top: 1px solid lightGray
@@ -251,6 +261,9 @@
                 color: $colour4
                 text-shadow: 0 1px 1px white
                 @include box-shadow(0 1px 1px rgba(0, 0, 0, 0.2))
+            .oe_menu_counter 
+                background: #eee
+                color: #8a89ba
         .oe_menu_toggler:before
             width: 0
             height: 0

=== modified file 'addons/web/static/src/css/base_old.css'
--- addons/web/static/src/css/base_old.css	2012-03-29 11:43:27 +0000
+++ addons/web/static/src/css/base_old.css	2012-04-05 17:02:25 +0000
@@ -1354,45 +1354,6 @@
     text-decoration: underline;
     color: inherit;
 }
-.openerp .oe-view-manager-logs {
-    clear: both;
-    background: #fff;
-    margin: 0.25em 0;
-    font-size: 85%;
-    color: #4C4C4C;
-    position: relative;
-    overflow: hidden;
-}
-.openerp .oe-view-manager-logs ul {
-    margin: 0;
-    padding: 0 10px;
-    list-style: none;
-}
-.openerp .oe-view-manager-logs li:before {
-    content: '\2192 ';
-}
-.openerp .oe-view-manager-logs a {
-    text-decoration: none;
-    color: inherit;
-}
-/* only display first three log items of a folded logs list */
-.openerp .oe-view-manager-logs.oe-folded li:nth-child(n+4) {
-    display: none;
-}
-/* display link to more logs if there are more logs to view and the logview is
-   currently folded */
-.openerp .oe-view-manager-logs a.oe-more-logs {
-    display: none;
-}
-.openerp .oe-view-manager-logs.oe-folded.oe-has-more a.oe-more-logs {
-    display: block;
-}
-.openerp .oe-view-manager-logs a.oe-remove-everything {
-    position: absolute;
-    top: 0;
-    right: 0;
-    cursor: pointer;
-}
 
 .openerp .view-manager-main-sidebar {
     width: 180px;

=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js	2012-04-05 16:21:31 +0000
+++ addons/web/static/src/js/views.js	2012-04-05 17:02:25 +0000
@@ -548,17 +548,6 @@
             }
         }
 
-        var $res_logs = this.$element.find('.oe-view-manager-logs:first');
-        $res_logs.delegate('a.oe-more-logs', 'click', function () {
-            $res_logs.removeClass('oe-folded');
-            return false;
-        }).delegate('a.oe-remove-everything', 'click', function () {
-            $res_logs.removeClass('oe-has-more').find('ul').empty();
-            $res_logs.css('display','none');
-            return false;
-        });
-        $res_logs.css('display','none');
-
         return manager_ready;
     },
     on_debug_changed: function (evt) {
@@ -662,8 +651,6 @@
         return $.when(this._super(view_type, no_store)).then(function () {
             self.shortcut_check(self.views[view_type]);
 
-            self.$element.find('.oe-view-manager-logs:first').addClass('oe-folded').removeClass('oe-has-more').css('display','none').find('ul').empty();
-
             var controller = self.views[self.active_view].controller,
                 fvg = controller.fields_view,
                 view_id = (fvg && fvg.view_id) || '--';
@@ -745,43 +732,6 @@
                 }
             });
     },
-    /**
-     * Intercept do_action resolution from children views
-     */
-    on_action_executed: function () {
-        return new session.web.DataSet(this, 'res.log')
-                .call('get', [], this.do_display_log);
-    },
-    /**
-     * @param {Array<Object>} log_records
-     */
-    do_display_log: function (log_records) {
-        var self = this;
-        var cutoff = 3;
-        var $logs = this.$element.find('.oe-view-manager-logs:first').addClass('oe-folded').css('display', 'block');
-        var $logs_list = $logs.find('ul').empty();
-        $logs.toggleClass('oe-has-more', log_records.length > cutoff);
-        _(log_records.reverse()).each(function (record) {
-            var context = {};
-            if (record.context) {
-                try { context = py.eval(record.context); }
-                catch (e) { /* TODO: what do I do now? */ }
-            }
-            $(_.str.sprintf('<li><a href="#">%s</a></li>', record.name))
-                .appendTo($logs_list)
-                .delegate('a', 'click', function () {
-                    self.do_action({
-                        type: 'ir.actions.act_window',
-                        res_model: record.res_model,
-                        res_id: record.res_id,
-                        // TODO: need to have an evaluated context here somehow
-                        context: context,
-                        views: [[context.view_id || false, 'form']]
-                    });
-                    return false;
-                });
-        });
-    },
     display_title: function () {
         return this.action.name;
     }

=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml	2012-03-28 10:04:02 +0000
+++ addons/web/static/src/xml/base.xml	2012-04-05 17:02:25 +0000
@@ -368,6 +368,11 @@
         t-att-data-action-model="menu.action ? menu.action.split(',')[0] : ''"
         t-att-data-action-id="menu.action ? menu.action.split(',')[1] : ''">
         <t t-esc="menu.name"/>
+        <t t-if="menu.needaction_enabled">
+            <div class="oe_menu_counter">
+                <t t-esc="menu.needaction_counter"/>
+            </div>
+        </t>
     </a>
 </t>
 
@@ -452,13 +457,6 @@
     <t t-jquery="h2.oe_view_title" t-operation="after">
         <select t-if="self.session.debug" class="oe_debug_view"/>
     </t>
-    <t t-jquery=".oe-view-manager-header" t-operation="after">
-        <div class="oe-view-manager-logs oe-folded">
-            <ul></ul>
-            <a class="oe-more-logs" href="#">More…</a>
-            <a class="oe-remove-everything ui-icon ui-icon-closethick"/>
-        </div>
-    </t>
 </t>
 <t t-name="ViewManagerDebug">
     <option value="">Debug View#<t t-esc="view.fields_view.view_id"/></option>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to