diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py
index f8e7c74e5f8..a644caea5e7 100644
--- a/addons/mail/__openerp__.py
+++ b/addons/mail/__openerp__.py
@@ -72,6 +72,7 @@ The main features are:
'images/customer_history.jpeg',
'images/messages_form.jpeg',
'images/messages_list.jpeg',
+ 'static/src/img/email_icong.png',
],
'css': [
'static/src/css/mail.css',
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css
index d4eb2373b66..be02336da41 100644
--- a/addons/mail/static/src/css/mail.css
+++ b/addons/mail/static/src/css/mail.css
@@ -77,8 +77,26 @@
}
.oe_mail_thread_msg, .oe_mail_thread_act {
+ width: 80%;
white-space: normal;
margin-bottom: 5px;
+ border-bottom: 1px solid #D2D9E7;
+}
+
+.notification {
+ background: #E0E0E0;
+}
+
+.email {
+ background: #E0E0E0;
+}
+
+.oe_mail_thread_msg_more {
+ margin-left: 20%;
+ margin-right: 40%;
+ border: 1px solid #D2D9E7;
+ background: #E0E0E0;
+ text-align: center;
}
.oe_mail_thread_msg:after, .oe_mail_thread_act:after {
@@ -99,8 +117,8 @@
.oe_mail_msg_image {
float: left;
- width: 60px;
- height: 60px;
+ width: 45px;
+ height: 40px;
text-align: center;
overflow: hidden;
-moz-border-radius: 3px;
@@ -115,14 +133,13 @@
}
.oe_mail_msg_image img {
- width: 60px;
+ width: 40px;
height: auto;
clip: rect(10px, 100px, 110px, 0px);
}
.oe_mail_msg_content {
- width: 89%;
- margin-left: 11%;
+ margin-left: 50px;
}
.oe_mail_msg_p {
@@ -130,10 +147,18 @@
margin: 0;
}
+.oe_mail_msg_p_email_header {
+ border-bottom: 1px solid #D2D9E7;
+}
+
.oe_mail_msg_body {
}
-.oe_mail_msg_author, .oe_mail_msg_author a {
+.oe_mail_msg_author {
+ color: #747474;
+}
+
+.oe_mail_msg_author a {
color: #4E43E7;
}
@@ -141,6 +166,6 @@
color: #C03000;
}
-.oe_mail_msg_date, .oe_mail_msg_date a {
- color: #4E43E7;
+.oe_mail_msg_date {
+ color: #747474;
}
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index c20eafd6c6b..31e1df75f35 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -20,6 +20,7 @@ openerp.mail = function(session) {
this.uid = params['uid'];
this.limit = params['limit'] || 10;
this.offset = params['offset'] || 0;
+ this.cur_limit = this.limit;
this.records = params['records'] || false;
// tmp
this.map_hash = {'res.users': []};
@@ -58,12 +59,6 @@ openerp.mail = function(session) {
return this.ds.call('message_load', [[this.res_id]]).then(this.proxy('display_comments'));
},
- display_current_user: function () {
- $('
').html(
- '
 + ')
'
- ).appendTo(this.$element.find('div.oe_mail_msg_image'));
- },
-
display_comments: function (records) {
var self = this;
this.$element.find('div.oe_mail_thread_display').empty();
@@ -73,13 +68,23 @@ openerp.mail = function(session) {
});
//console.log(this.map_hash);
_(records).each(function (record) {
- record.mini_url = self.thread_get_avatar_mini('res.users', 'avatar_mini', record.user_id[0]);
+ if (record.type == 'email') { record.mini_url = ('/mail/static/src/img/email_icon.png'); }
+ else { record.mini_url = self.thread_get_avatar_mini('res.users', 'avatar_mini', record.user_id[0]); }
record.body_text = self.do_replace_internal_links(record.body_text);
var render_res = session.web.qweb.render('ThreadMsg', {
'record': record,
});
- $('
').html(render_res).appendTo(self.$element.find('div.oe_mail_thread_display'));
+ $(render_res).appendTo(self.$element.find('div.oe_mail_thread_display'));
});
+ // add and bind "more button"
+ $(session.web.qweb.render('MoreButton', {})).appendTo(self.$element.find('div.oe_mail_thread_display'));
+ this.$element.find('button.oe_mail_button_more').bind('click', function () { self.do_more(); });
+ },
+
+ display_current_user: function () {
+ $('
').html(
+ '
 + ')
'
+ ).appendTo(this.$element.find('div.oe_mail_msg_image'));
},
do_comment: function () {
@@ -88,26 +93,8 @@ openerp.mail = function(session) {
this.proxy('fetch_comments'));
},
- /* check for internal links, and map them to limitate number of queries -- WIP, probably not useful */
- check_internal_links: function(string) {
- /* shortcut to user: @login */
- var regex_login = new RegExp(/(^|\s)@(\w*[a-zA-Z_.]+\w*\s)/g);
- var regex_res = regex_login.exec(string);
- while (regex_res != null) {
- var login = regex_res[2];
- this.map_hash['res.users'].push(login);
- regex_res = regex_login.exec(string);
- }
- /* internal links: @res.model,name */
- var regex_intlink = new RegExp(/(^|\s)@(\w*[a-zA-Z_]+\w*)\.(\w+[a-zA-Z_]+\w*),(\w+)/g);
- regex_res = regex_intlink.exec(string);
- while (regex_res != null) {
- var res_model = regex_res[2] + '.' + regex_res[3];
- var res_name = regex_res[4];
- if (! (res_model in this.map_hash)) { this.map_hash[res_model] = []; }
- this.map_hash[res_model].push(res_name);
- regex_res = regex_intlink.exec(string);
- }
+ do_more: function () {
+ console.log('do more !');
},
do_replace_internal_links: function (string) {
@@ -135,6 +122,28 @@ openerp.mail = function(session) {
return string;
},
+ /* check for internal links, and map them to limitate number of queries -- WIP, probably not useful */
+ check_internal_links: function(string) {
+ /* shortcut to user: @login */
+ var regex_login = new RegExp(/(^|\s)@(\w*[a-zA-Z_.]+\w*\s)/g);
+ var regex_res = regex_login.exec(string);
+ while (regex_res != null) {
+ var login = regex_res[2];
+ this.map_hash['res.users'].push(login);
+ regex_res = regex_login.exec(string);
+ }
+ /* internal links: @res.model,name */
+ var regex_intlink = new RegExp(/(^|\s)@(\w*[a-zA-Z_]+\w*)\.(\w+[a-zA-Z_]+\w*),(\w+)/g);
+ regex_res = regex_intlink.exec(string);
+ while (regex_res != null) {
+ var res_model = regex_res[2] + '.' + regex_res[3];
+ var res_name = regex_res[4];
+ if (! (res_model in this.map_hash)) { this.map_hash[res_model] = []; }
+ this.map_hash[res_model].push(res_name);
+ regex_res = regex_intlink.exec(string);
+ }
+ },
+
thread_get_avatar_mini: function(model, field, id) {
return this.session.prefix + '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + (id || '');
},
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index 393ab9d49b3..9f0448a9469 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -25,6 +25,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
- OpenERP System Notification
-
-
-
-
-
-
-
-
- - Need action by
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ OpenERP System Notification
+
+
+
+
+
+
+
+ - Need action by
+
+ wrote on
+
+
+
-
-
-
-
-
+
+
+
+
+
+