diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 98618cc4729..daa8594cba4 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -1,6 +1,3 @@ -.oe_mail_wall_threads{ - padding: 16px; -} /* ------------ MAIL WIDGET --------------- */ .openerp .oe_mail, .openerp .oe_mail *{ @@ -9,7 +6,7 @@ .openerp .oe_mail { display: inline-block; position: relative; - width: 740px; + width: 720px; margin: 0px; } .openerp .oe_mail .oe_thread{ @@ -27,6 +24,7 @@ border-radius: 2px; margin-bottom: 2px; min-height: 40px; + border: solid 1px rgba(0,0,0,0.03); } .openerp .oe_mail .oe_msg_indented{ background: #FFF; @@ -39,6 +37,9 @@ margin:1px; border-radius:2px; } +.openerp .oe_mail .oe_msg .oe_subtle{ + color: #B7B7D5; +} .openerp .oe_mail .oe_msg_indented .oe_msg_center{ margin-left:34px; } @@ -58,20 +59,11 @@ margin-left: 40px; } .openerp .oe_mail .oe_msg .oe_msg_footer{ - height: 16px; padding-left: 4px; overflow: hidden; - font-size: 11px; opacity:0.8; -webkit-transition: opacity 0.2s linear; } -.openerp .oe_mail .oe_thread:hover .oe_msg_footer{ - opacity: 1; - -webkit-transition: opacity 0.2s linear; -} -.openerp .oe_mail .oe_msg.oe_msg_composer .oe_msg_footer{ - height: auto; -} .openerp .oe_mail .oe_msg .oe_msg_content{ display: block; overflow: hidden; @@ -79,7 +71,7 @@ padding-bottom:1px; } .openerp .oe_mail .oe_msg .oe_msg_content .oe_msg_title{ - font-size: 16px; + font-size: 13px; margin-bottom: 0px; margin-top: 2px; } @@ -130,10 +122,11 @@ } .openerp .oe_mail .oe_msg .oe_msg_content textarea{ width: 100%; - height: 100%; + height: 32px; margin: 0px; padding: 0px; resize: vertical; + padding: 4px; } .openerp .oe_mail .oe_msg.oe_msg_composer_compact, .openerp .oe_mail .oe_msg.oe_msg_expandable{ @@ -228,11 +221,15 @@ border: none; text-shadow: none; } +.openerp .oe_mail .oe_attach_label{ + color: #7C7BAD; + margin-left: -3px; +} .openerp .oe_mail .oe_msg_footer .oe_attachment_file .oe_form_binary_file{ display: inline-block; - margin-left: -23px; - height: 24px; - width: 24px; + margin-left: -47px; + height: 28px; + width: 52px; margin-top: -6px; } .openerp .oe_mail .oe_mail_list_recipients{ @@ -254,11 +251,82 @@ -webkit-transition: opacity 0.2s linear; } -/* ---------------- MESSAGES BODY ------------------ */ +/* ---------------- FOLLOWERS ------------------ */ +.openerp .oe_followers{ + position: relative; + display: inline-block; + padding-top: 4px; + width: 120px; + float: right; +} + +/* a) THE FOLLOW BUTTON */ + +.openerp .oe_followers button.oe_follower{ + display: block; + text-align: center; + width:100%; +} +.openerp .oe_followers button.oe_follower.oe_following{ + background-color: #3465A4; + background-image: -webkit-linear-gradient(top, #729FCF, #3465A4); + color: white; +} + +.openerp .oe_followers button.oe_follower .oe_follow, +.openerp .oe_followers button.oe_follower .oe_unfollow, +.openerp .oe_followers button.oe_follower .oe_following{ + display: none; +} +/* a.1) when following, show 'following' */ +.openerp .oe_followers button.oe_follower.oe_following .oe_following{ + display: inline; +} +/* a.2) when following and hovering, show 'unfollow' */ +.openerp .oe_followers button.oe_follower.oe_following:hover .oe_following{ + display: none; +} +.openerp .oe_followers button.oe_follower.oe_following:hover .oe_unfollow{ + display: inline; +} +/* a.3) when not following show 'follow' */ +.openerp .oe_followers button.oe_follower.oe_notfollow .oe_follow{ + display: inline; +} + +.openerp .oe_followers .oe_subtype_list{ + margin-bottom: 4px; +} + +/* b) THE FOLLOWERS */ +.openerp .oe_followers .oe_follower_title{ + margin-top: 4px; +} +.openerp .oe_followers .oe_partner { + height: 32px; + overflow: hidden; +} +.openerp .oe_followers .oe_partner img{ + width: 32px; + margin-right:4px; + border-radius: 2px; +} + +/* ---------------- MESSAGES BODY ------------------ */ .openerp .oe_mail .oe_msg_content .oe_blockquote, .openerp .oe_mail .oe_msg_content blockquote { padding: 4px; border-radius: 2px; border: solid 1px rgba(124,123,173,0.14); } + +/* ----------- FORM INTEGRATION ------------ */ + + /* Nothing to do yay! */ + +/* ----------- INBOX INTEGRATION ----------- */ + +.openerp .oe_mail_wall .oe_mail{ + margin: 16px; +} diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 5339f92035b..78aa3e8513d 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -296,6 +296,7 @@ openerp.mail = function (session) { /* stack for don't close the compose form if the user click on a button */ this.$render_expandable.on('focus, mouseup', 'textarea', function () { self.stay_open = false; }); this.$render_expandable.on('mousedown', function () { self.stay_open = true; }); + this.$render_expandable.find('textarea').autosize(); } }, @@ -1591,7 +1592,7 @@ openerp.mail = function (session) { } ); - return this.root.appendTo( this.$('.oe_mail_wall_threads:first') ); + return this.root.replace(this.$('.oe_mail-placeholder')); }, }); @@ -1687,13 +1688,13 @@ openerp.mail = function (session) { } ); - return this.root.appendTo( this.$('.oe_mail_wall_threads:first') ); + return this.root.replace(this.$('.oe_mail-placeholder')); }, bind_events: function () { var self=this; - this.$("button.oe_write_full:first").click(function () { self.root.thread.ComposeMessage.on_compose_fullmail(); }); - this.$("button.oe_write_onwall:first").click(function () { self.root.thread.on_compose_message(); }); + this.$(".oe_write_full").click(function(){ self.root.thread.ComposeMessage.on_compose_fullmail(); }); + this.$(".oe_write_onwall").click(function(){ self.root.thread.on_compose_message(); }); } }); diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index f08991be2cc..bf913df0b04 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -24,10 +24,10 @@ openerp_mail_followers = function(session, mail) { init: function() { this._super.apply(this, arguments); - this.options.image = this.node.attrs.image || 'image_small'; - this.options.title = this.node.attrs.title || 'Followers'; - this.options.comment = this.node.attrs.help || false; - this.options.displayed_nb = this.node.attrs.displayed_nb || 10; + this.image = this.node.attrs.image || 'image_small'; + this.title = this.node.attrs.title || 'Followers'; + this.comment = this.node.attrs.help || false; + this.displayed_nb = this.node.attrs.displayed_nb || 10; this.ds_model = new session.web.DataSetSearch(this, this.view.model); this.ds_follow = new session.web.DataSetSearch(this, this.field.relation); this.ds_users = new session.web.DataSetSearch(this, 'res.users'); @@ -61,7 +61,7 @@ openerp_mail_followers = function(session, mail) { self.do_unfollow(); }); // event: click on a subtype, that (un)subscribe for this subtype - this.$el.on('click', 'ul.oe_subtypes input', self.do_update_subscription); + this.$el.on('click', '.oe_subtype_list input', self.do_update_subscription); // event: click on 'invite' button, that opens the invite wizard this.$('.oe_invite').on('click', function (event) { action = { @@ -119,16 +119,16 @@ openerp_mail_followers = function(session, mail) { /* Display generic info about follower, for people not having access to res_partner */ display_generic: function () { var self = this; - var node_user_list = this.$('ul.oe_mail_followers_display').empty(); + var node_user_list = this.$('.oe_follower_list').empty(); // format content: Followers (You and 0 other) // Followers (3) - var content = this.options.title; + var content = this.title; if (this.message_is_follower) { content += ' (You and ' + (this.get('value').length-1) + ' other)'; } else { content += ' (' + this.get('value').length + ')' } - this.$('div.oe_mail_recthread_followers h4').html(content); + this.$('.oe_follower_title').html(content); }, /** Display the followers */ @@ -137,16 +137,16 @@ openerp_mail_followers = function(session, mail) { records = records || []; this.message_is_follower = this.set_is_follower(records); // clean and display title - var node_user_list = this.$('ul.oe_mail_followers_display').empty(); - this.$('div.oe_mail_recthread_followers h4').html(this.options.title + ' (' + records.length + ')'); + var node_user_list = this.$('.oe_follower_list').empty(); + this.$('.oe_follower_title').html(this.title + ' (' + records.length + ')'); // truncate number of displayed followers - truncated = records.splice(0, this.options.displayed_nb); + truncated = records.splice(0, this.displayed_nb); _(truncated).each(function (record) { record.avatar_url = mail.ChatterUtils.get_image(self.session, 'res.partner', 'image_small', record.id); $(session.web.qweb.render('mail.followers.partner', {'record': record})).appendTo(node_user_list); }); - if (truncated.length < records.length) { - $('