From 86fe9e48b82642ce0abc9e1c5b609032d4908255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 13 Apr 2012 12:03:27 +0200 Subject: [IMP] mail.thread: improvement taken from trunk-form-v2-fme. mail.group: added demo data. thread widget: updated css and html structure. mail security: now for every users, not only employees. This will need to be reviewed in details. bzr revid: tde@openerp.com-20120413100327-2uimy9c1crnfzm6u --- addons/mail/static/src/js/mail.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'addons/mail/static/src/js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index fbe817c2c81..dc6bd74c345 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -58,10 +58,8 @@ openerp.mail = function(session) { } /* Add ThreadDisplay widget to registry */ - session.web.form.widgets.add( - 'Thread', 'openerp.mail.Thread'); - session.web.page.readonly.add( - 'Thread', 'openerp.mail.Thread'); + session.web.form.widgets.add( 'Thread', 'openerp.mail.Thread'); + session.web.page.readonly.add( 'Thread', 'openerp.mail.Thread'); /** * ThreadDisplay widget: this widget handles the display of a thread of @@ -464,10 +462,8 @@ openerp.mail = function(session) { /* Add ThreadView widget to registry */ - session.web.form.widgets.add( - 'ThreadView', 'openerp.mail.RecordThread'); - session.web.page.readonly.add( - 'ThreadView', 'openerp.mail.RecordThread'); + session.web.form.widgets.add( 'ThreadView', 'openerp.mail.RecordThread'); + session.web.page.readonly.add( 'ThreadView', 'openerp.mail.RecordThread'); /* ThreadView widget: thread of comments */ mail.RecordThread = session.web.form.Field.extend({ @@ -489,9 +485,11 @@ openerp.mail = function(session) { // bind buttons this.$element.find('button.oe_mail_button_followers').click(function () { self.do_toggle_followers(); }).hide(); this.$element.find('button.oe_mail_button_follow').click(function () { self.do_follow(); }) - .mouseover(function () { $(this).html('Follow'); }).mouseleave(function () { $(this).html('Not following'); }); + .mouseover(function () { $(this).html('Follow').addClass('following'); }) + .mouseleave(function () { $(this).html('Not following').removeClass('following'); }); this.$element.find('button.oe_mail_button_unfollow').click(function () { self.do_unfollow(); }) - .mouseover(function () { $(this).html('Unfollow'); }).mouseleave(function () { $(this).html('Following'); }); + .mouseover(function () { $(this).html('Unfollow').removeClass('following').addClass('unfollow'); }) + .mouseleave(function () { $(this).html('Following').removeClass('unfollow').addClass('following'); }); this.reinit(); }, @@ -642,7 +640,7 @@ openerp.mail = function(session) { load_search_view: function (view_id, defaults, hidden) { var self = this; this.searchview = new session.web.SearchView(this, this.ds_msg, view_id || false, defaults || {}, hidden || false); - var search_view_loaded = this.searchview.appendTo(this.$element.find('div.oe_mail_wall_search')); + var search_view_loaded = this.searchview.appendTo(this.$element.find('.oe_view_manager_row')); return $.when(search_view_loaded).then(function () { self.searchview.on_search.add(self.do_searchview_search); }); -- cgit v1.2.3 From 77ded11094688a8624e0a21b61d376d33534625c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 13 Apr 2012 13:41:26 +0200 Subject: [CLEAN] Thrad widget: cleaned CSS file. bzr revid: tde@openerp.com-20120413114126-4rls0wlbpe71m8ao --- addons/mail/static/src/js/mail.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'addons/mail/static/src/js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index dc6bd74c345..c29b81fc097 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -485,11 +485,11 @@ openerp.mail = function(session) { // bind buttons this.$element.find('button.oe_mail_button_followers').click(function () { self.do_toggle_followers(); }).hide(); this.$element.find('button.oe_mail_button_follow').click(function () { self.do_follow(); }) - .mouseover(function () { $(this).html('Follow').addClass('following'); }) - .mouseleave(function () { $(this).html('Not following').removeClass('following'); }); + .mouseover(function () { $(this).html('Follow').removeClass('oe_mail_button_mouseout').addClass('oe_mail_button_mouseover'); }) + .mouseleave(function () { $(this).html('Not following').removeClass('oe_mail_button_mouseover').addClass('oe_mail_button_mouseout'); }); this.$element.find('button.oe_mail_button_unfollow').click(function () { self.do_unfollow(); }) - .mouseover(function () { $(this).html('Unfollow').removeClass('following').addClass('unfollow'); }) - .mouseleave(function () { $(this).html('Following').removeClass('unfollow').addClass('following'); }); + .mouseover(function () { $(this).html('Unfollow').removeClass('oe_mail_button_mouseout').addClass('oe_mail_button_mouseover'); }) + .mouseleave(function () { $(this).html('Following').removeClass('oe_mail_button_mouseover').addClass('oe_mail_button_mouseout'); }); this.reinit(); }, -- cgit v1.2.3 From 0912faef4c4a122bcb3f4b48050e44cf7ef903c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 16 Apr 2012 10:18:05 +0200 Subject: [DOC] Small doc update. bzr revid: tde@openerp.com-20120416081805-wz85d6sxd90n472b --- addons/mail/static/src/js/mail.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/mail/static/src/js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index c29b81fc097..326225b6b24 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -388,6 +388,11 @@ openerp.mail = function(session) { return this.fetch_comments(this.params.limit, this.params.offset, domain); }, + /** + * + * var regex_login = new RegExp(/(^|\s)@((\w|@|\.)*)/g); + * var regex_intlink = new RegExp(/(^|\s)#(\w*[a-zA-Z_]+\w*)\.(\w+[a-zA-Z_]+\w*),(\w+)/g); + */ do_replace_internal_links: function (string) { var self = this; var icon_list = ['al', 'pinky'] @@ -427,7 +432,6 @@ openerp.mail = function(session) { /** * - * var regex_login = new RegExp(/(^|\s)@(\w*[a-zA-Z_.]+\w*\s)/g); * var regex_login = new RegExp(/(^|\s)@((\w|@|\.)*)/g); * var regex_intlink = new RegExp(/(^|\s)#(\w*[a-zA-Z_]+\w*)\.(\w+[a-zA-Z_]+\w*),(\w+)/g); */ -- cgit v1.2.3 From 8ef72c59e67d811119030b4c13afc92a2b09ee54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 19 Apr 2012 10:58:38 +0200 Subject: [FIX] Dates on message are now displayed according to the user timezone. bzr revid: tde@openerp.com-20120419085838-awmxdqjbsb8qyi38 --- addons/mail/static/src/js/mail.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'addons/mail/static/src/js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 8e507416a37..d99674f98a7 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -275,6 +275,8 @@ openerp.mail = function(session) { record.tr_body = this.do_truncate_string(record.body, this.params.msg_more_limit); record.body = this.do_replace_internal_links(record.body); if (record.tr_body) record.tr_body = this.do_replace_internal_links(record.tr_body); + // format date according to the user timezone + record.date = session.web.format_value(record.date, {type:"datetime"}); // render $(session.web.qweb.render('ThreadMsg', {'record': record, 'thread': this, 'params': this.params, 'display': this.display}) ).appendTo(this.$element.children('div.oe_mail_thread_display:first')); -- cgit v1.2.3