[MERGE] from trunk-openchatter-DOM-chm

bzr revid: chm@openerp.com-20121029082648-z8jzv73rycrf2gqu
This commit is contained in:
Christophe Matthieu 2012-10-29 09:26:48 +01:00
commit 7e23faab09
35 changed files with 111 additions and 93 deletions

View File

@ -279,8 +279,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
@ -436,8 +436,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</form>
</field>

View File

@ -109,8 +109,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -240,8 +240,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
@ -512,8 +512,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -147,8 +147,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
@ -303,8 +303,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -54,8 +54,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -224,8 +224,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -223,8 +223,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
@ -525,8 +525,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -150,8 +150,8 @@
<field name="description" placeholder="Description..."/>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -132,8 +132,8 @@
</page>
</notebook>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers" help="Followers of this salesteam follow automatically all opportunities related to this salesteam."/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -179,8 +179,8 @@
</group>
</sheet>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</form>
</field>

View File

@ -204,8 +204,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</form>
</field>
@ -486,8 +486,8 @@
</group>
</sheet>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</form>
</field>

View File

@ -359,8 +359,8 @@
</div>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -210,8 +210,8 @@
</group>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -139,8 +139,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -121,8 +121,8 @@
</group>
</sheet>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</form>
</field>
@ -158,8 +158,8 @@
<field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..."/>
</sheet>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</form>
</field>

View File

@ -183,8 +183,8 @@
<field name="description" placeholder="Feedback of interviews..."/>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -79,8 +79,8 @@
<field name="description"/>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -82,9 +82,8 @@
</group>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"
options='{"thread_level": 1}'/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread" options='{"thread_level": 1}'/>
</div>
</form>
</field>

View File

@ -9,9 +9,8 @@
<field name="arch" type="xml">
<xpath expr="//sheet" position="after">
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"
options='{"thread_level": 1}'/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread" options='{"thread_level": 1}'/>
</div>
</xpath>
</field>

View File

@ -4,9 +4,8 @@
box-sizing: border-box;
}
.openerp .oe_mail {
display: inline-block;
display: block;
position: relative;
width: 720px;
margin: 0px;
}
.openerp .oe_mail .oe_thread{
@ -32,6 +31,9 @@
margin-bottom:0px;
min-height:34px;
}
.openerp .oe_msg .oe_msg_intented:last-child(){
margin-bottom: 4px;
}
.openerp .oe_mail .oe_msg_indented .oe_msg_icon{
width:32px;
margin:1px;
@ -242,13 +244,25 @@
.openerp .oe_mail .oe_msg_content.oe_msg_more_message{
text-align: right;
padding-right: 300px;
opacity: 0.5;
-webkit-transition: opacity 0.2s linear;
}
.openerp .oe_mail .oe_msg_more_message:hover{
opacity: 1;
-webkit-transition: opacity 0.2s linear;
.openerp .oe_mail .oe_msg_content.oe_msg_more_message .oe_separator{
height: 0;
border-bottom: dashed 1px #e6e6e6;
margin-left: -4px;
margin-right: 8px;
margin-top: 6px;
margin-bottom: -9px;
}
.openerp .oe_mail .oe_msg_more_message .oe_msg_fetch_more {
background: white;
margin-right: 280px;
padding-left: 8px;
padding-right: 8px;
text-decoration: none;
color: #b4b4b4;
}
.openerp .oe_mail .oe_msg_more_message .oe_msg_fetch_more:hover{
text-decoration: none;
}
/* ---------------- FOLLOWERS ------------------ */
@ -256,8 +270,8 @@
.openerp .oe_followers{
position: relative;
display: inline-block;
padding-top: 4px;
width: 120px;
padding-top: 5px;
width: 160px;
float: right;
}
@ -296,12 +310,19 @@
}
.openerp .oe_followers .oe_subtype_list{
margin-bottom: 4px;
margin-top: 4px;
}
/* b) THE FOLLOWERS */
.openerp .oe_followers .oe_follower_title{
margin-top: 4px;
display: inline;
}
.openerp .oe_followers .oe_follower_title_box{
margin-top: 12px;
margin-bottom: 4px;
}
.openerp .oe_followers .oe_invite{
float: right;
}
.openerp .oe_followers .oe_partner {
height: 32px;
@ -323,10 +344,14 @@
/* ----------- FORM INTEGRATION ------------ */
/* Nothing to do yay! */
.openerp .oe_record_thread{
display: block;
margin-right: 180px;
}
/* ----------- INBOX INTEGRATION ----------- */
.openerp .oe_mail_wall .oe_mail{
margin: 16px;
width: 720px;
}

View File

@ -469,14 +469,9 @@ openerp.mail = function (session) {
animated_destroy: function (fadeTime) {
var self=this;
//graphic effects
if (fadeTime) {
self.$el.fadeOut(options.fadeTime, function () {
self.destroy();
});
} else {
this.$el.fadeOut(fadeTime, function () {
self.destroy();
}
});
},
/*The selected thread and all childs (messages/thread) became read
@ -489,7 +484,7 @@ openerp.mail = function (session) {
}
this.flag_used = true;
this.animated_destroy(300);
this.animated_destroy(200);
this.parent_thread.message_fetch(this.domain, this.context);
return false;
},
@ -719,15 +714,10 @@ openerp.mail = function (session) {
*/
animated_destroy: function (fadeTime) {
var self=this;
//graphic effects
if (fadeTime) {
self.$el.fadeOut(fadeTime, function () {
self.parent_thread.message_to_expandable(self);
});
self.thread.$el.fadeOut(fadeTime);
} else {
this.$el.fadeOut(fadeTime, function () {
self.parent_thread.message_to_expandable(self);
}
});
this.thread.$el.fadeOut(fadeTime);
},
/**
@ -738,7 +728,7 @@ openerp.mail = function (session) {
event.stopPropagation();
if (! confirm(_t("Do you really want to delete this message?"))) { return false; }
this.animated_destroy(250);
this.animated_destroy(150);
// delete this message and his childs
var ids = [this.id].concat( this.get_child_ids() );
this.ds_message.unlink(ids);
@ -754,7 +744,7 @@ openerp.mail = function (session) {
if ( (this.to_read && this.options.typeof_thread == 'inbox') ||
(!this.to_read && this.options.typeof_thread == 'archives')) {
this.animated_destroy(250);
this.animated_destroy(150);
}
// if this message is read, all childs message display is read
@ -847,7 +837,7 @@ openerp.mail = function (session) {
} else {
button.removeClass('oe_starred');
if ( self.options.typeof_thread == 'stared' ) {
self.animated_destroy(250);
self.animated_destroy(150);
}
}
});

View File

@ -25,7 +25,6 @@ openerp_mail_followers = function(session, mail) {
init: function() {
this._super.apply(this, arguments);
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);
@ -115,20 +114,25 @@ openerp_mail_followers = function(session, mail) {
self.message_is_follower = (_.indexOf(self.get('value'), pid) != -1);
}).pipe(self.proxy('display_generic'));
},
_format_followers: function(count){
console.log('FORMAT FOLLWERS :',count);
function _t(str){return str;}
var str = '';
if(count <= 0){
str = _t('No followers');
}else if(count === 1){
str = _t('One follower');
}else{
str = ''+count+' '+_t('followers');
}
console.log('URGH:',str);
return str;
},
/* Display generic info about follower, for people not having access to res_partner */
display_generic: function () {
var self = this;
var node_user_list = this.$('.oe_follower_list').empty();
// format content: Followers (You and 0 other) // Followers (3)
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.$('.oe_follower_title').html(content);
this.$('.oe_follower_title').html(this._format_followers(this.get('value').length));
},
/** Display the followers */
@ -138,7 +142,7 @@ openerp_mail_followers = function(session, mail) {
this.message_is_follower = this.set_is_follower(records);
// clean and display title
var node_user_list = this.$('.oe_follower_list').empty();
this.$('.oe_follower_title').html(this.title + ' (' + records.length + ')');
this.$('.oe_follower_title').html(this._format_followers(records.length));
// truncate number of displayed followers
truncated = records.splice(0, this.displayed_nb);
_(truncated).each(function (record) {

View File

@ -176,10 +176,10 @@
Template used to display the communication history in documents
form view.
-->
<span t-name="mail.record_thread" class="oe_record_thread">
<div t-name="mail.record_thread" class="oe_record_thread">
<div class="oe_mail-placeholder">
</div>
</span>
</div>
<t t-name="mail.thread">
<div t-attf-class="oe_thread #{widget.root?'oe_root_thread':''}"/>
@ -236,8 +236,9 @@
<t t-name="mail.thread.expandable">
<div t-attf-class="oe_msg oe_msg_#{widget.type} #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} oe_msg_unread">
<div class="oe_msg_content oe_msg_more_message">
<a t-if="widget.nb_messages === 1" class="oe_msg_fetch_more">load one more message</a>
<a t-if="widget.nb_messages !== 1" class="oe_msg_fetch_more">load <t t-raw="widget.nb_messages" /> more messages</a>
<div class='oe_separator'></div>
<a t-if="widget.nb_messages === 1" class="oe_msg_fetch_more">show one more message</a>
<a t-if="widget.nb_messages !== 1" class="oe_msg_fetch_more">show <t t-raw="widget.nb_messages" /> more messages</a>
</div>
</div>
</t>

View File

@ -17,10 +17,10 @@
<t t-if="widget.comment">
<h5 class="oe_comment"><t t-raw="widget.comment"/></h5>
</t>
<button type="button" class="oe_invite"><span>Invite</span></button>
<t t-if="widget.title">
<h4 class='oe_follower_title'><t t-raw="widget.title"/></h4>
</t>
<div class='oe_follower_title_box'>
<h4 class='oe_follower_title'>Followers</h4>
<a href='#' class="oe_invite">Invite others</a>
</div>
<div class="oe_follower_list"></div>
</div>

View File

@ -409,8 +409,8 @@
</page>
</notebook>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</form>
</field>
@ -797,8 +797,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -107,8 +107,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -189,8 +189,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -103,8 +103,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -166,8 +166,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -151,8 +151,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers" help="Follow this project to automatically follow all related tasks and issues."/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
@ -466,8 +466,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -159,8 +159,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -287,8 +287,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -102,8 +102,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -309,8 +309,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>

View File

@ -912,8 +912,8 @@
</xpath>
<xpath expr="/form/sheet" position="after">
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</xpath>
</data>
@ -1038,8 +1038,8 @@
</xpath>
<xpath expr="/form/sheet" position="after">
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
</div>
</xpath>
</data>