Browse Source

[PORT] Insert "Move to thread" button in mail_move_message_main.xml and updated his behavior in css file

pull/36/head
x620 9 years ago
parent
commit
991765e22b
  1. 202
      mail_move_message/mail_move_message_views.xml
  2. 25
      mail_move_message/static/src/css/mail_move_message.css
  3. 6
      mail_move_message/static/src/xml/mail_move_message_main.xml

202
mail_move_message/mail_move_message_views.xml

@ -8,115 +8,115 @@
</xpath>
</template>
<record id="view_wizard" model="ir.ui.view">
<field name="name">mail_move_message.wizard.view</field>
<field name="model">mail_move_message.wizard</field>
<field name="arch" type="xml">
<form string="Move Message">
<!--<record id="view_wizard" model="ir.ui.view">-->
<!--<field name="name">mail_move_message.wizard.view</field>-->
<!--<field name="model">mail_move_message.wizard</field>-->
<!--<field name="arch" type="xml">-->
<!--<form string="Move Message">-->
<field name="can_move" invisible="1"/>
<field name="message_is_moved" invisible="1"/>
<field name="message_name_from" invisible="1"/>
<field name="message_email_from" invisible="1"/>
<field name="message_to_read" invisible="1"/>
<field name="uid" invisible="1"/>
<!--<field name="can_move" invisible="1"/>-->
<!--<field name="message_is_moved" invisible="1"/>-->
<!--<field name="message_name_from" invisible="1"/>-->
<!--<field name="message_email_from" invisible="1"/>-->
<!--<field name="message_to_read" invisible="1"/>-->
<!--<field name="uid" invisible="1"/>-->
<p attrs="{'invisible':[('can_move', '!=', False)]}">You cannot move this message. It was already moved with a message bellow. Open one and apply changes there.</p>
<group attrs="{'invisible':[('can_move', '!=', False)]}">
<field name="message_moved_by_message_id" context="{'extended_name':1}"/>
<field name="message_moved_by_user_id"/>
<button name="open_moved_by_message_id" string="Open message" type="object" class="oe_highlight"/>
</group>
<!--<p attrs="{'invisible':[('can_move', '!=', False)]}">You cannot move this message. It was already moved with a message bellow. Open one and apply changes there.</p>-->
<!--<group attrs="{'invisible':[('can_move', '!=', False)]}">-->
<!--<field name="message_moved_by_message_id" context="{'extended_name':1}"/>-->
<!--<field name="message_moved_by_user_id"/>-->
<!--<button name="open_moved_by_message_id" string="Open message" type="object" class="oe_highlight"/>-->
<!--</group>-->
<group attrs="{'invisible':[('can_move', '=', False)]}" colspan="2">
<label for="model"/>
<div>
<field name="model" widget="polymorphic" polymorphic="res_id" class="oe_inline"/>
</div>
<label for="filter_by_partner"/>
<div>
<field name="filter_by_partner"/>
<field name="partner_id" style="width:50%"/>
<button string="Create Partner" attrs="{'invisible':[('partner_id','!=',False)]}" class="oe_highlight" special="quick_create" field="partner_id" context="{'force_email':True,'default_email':message_email_from,'default_name':message_name_from, 'update_message_author':True}"/>
</div>
<label for="res_id"/>
<div>
<field name="res_id" context="{'extended_name_with_contact':1}" widget="many2one" attrs="{'readonly': [('model','=',False)]}" style="width:50%"/>
<button string="Create new record" name="create_record" type="object" class="oe_highlight" attrs="{'invisible':['|',('model','=',False)]}" special="quick_create" field="res_id" use_for_mail_move_message="True"/>
</div>
<label for="move_back" attrs="{'invisible':[('message_is_moved','=',False)]}"/>
<div attrs="{'invisible':[('message_is_moved','=',False)]}">
<field name="move_back"/>
</div>
<label for="move_followers"/>
<div>
<field name="move_followers"/>
</div>
</group>
<button name="move" string="Move" type="object" class="oe_highlight" attrs="{'invisible':[('can_move', '=', False)]}"/>
<button string="Close" class="" special="cancel" />
<separator string="Message"/>
<group>
<field name="message_subject"/>
<field name="message_from"/>
<field name="message_id" invisible="1"/>
</group>
<div class="openerp mail_move_message">
<div class="oe_mail">
<div class="oe_msg">
<div class="oe_msg_content">
<div class="oe_msg_body">
<!-- use built-in css for messages -->
<field name="message_body"/>
</div>
</div>
</div>
</div>
</div>
<footer>
<button name="read_close" string="Mark as read and Close" type="object" class="oe_highlight"/> or
<button special="cancel" string="Close" class="oe_link"/>
<!--<group attrs="{'invisible':[('can_move', '=', False)]}" colspan="2">-->
<!--<label for="model"/>-->
<!--<div>-->
<!--<field name="model" widget="polymorphic" polymorphic="res_id" class="oe_inline"/>-->
<!--</div>-->
<!--<label for="filter_by_partner"/>-->
<!--<div>-->
<!--<field name="filter_by_partner"/>-->
<!--<field name="partner_id" style="width:50%"/>-->
<!--<button string="Create Partner" attrs="{'invisible':[('partner_id','!=',False)]}" class="oe_highlight" special="quick_create" field="partner_id" context="{'force_email':True,'default_email':message_email_from,'default_name':message_name_from, 'update_message_author':True}"/>-->
<!--</div>-->
<!--<label for="res_id"/>-->
<!--<div>-->
<!--<field name="res_id" context="{'extended_name_with_contact':1}" widget="many2one" attrs="{'readonly': [('model','=',False)]}" style="width:50%"/>-->
<!--<button string="Create new record" name="create_record" type="object" class="oe_highlight" attrs="{'invisible':['|',('model','=',False)]}" special="quick_create" field="res_id" use_for_mail_move_message="True"/>-->
<!--</div>-->
<!--<label for="move_back" attrs="{'invisible':[('message_is_moved','=',False)]}"/>-->
<!--<div attrs="{'invisible':[('message_is_moved','=',False)]}">-->
<!--<field name="move_back"/>-->
<!--</div>-->
<!--<label for="move_followers"/>-->
<!--<div>-->
<!--<field name="move_followers"/>-->
<!--</div>-->
<!--</group>-->
<!--<button name="move" string="Move" type="object" class="oe_highlight" attrs="{'invisible':[('can_move', '=', False)]}"/>-->
<!--<button string="Close" class="" special="cancel" />-->
<!--<separator string="Message"/>-->
<!--<group>-->
<!--<field name="message_subject"/>-->
<!--<field name="message_from"/>-->
<!--<field name="message_id" invisible="1"/>-->
<!--</group>-->
<!--<div class="openerp mail_move_message">-->
<!--<div class="oe_mail">-->
<!--<div class="oe_msg">-->
<!--<div class="oe_msg_content">-->
<!--<div class="oe_msg_body">-->
<!--&lt;!&ndash; use built-in css for messages &ndash;&gt;-->
<!--<field name="message_body"/>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<footer>-->
<!--<button name="read_close" string="Mark as read and Close" type="object" class="oe_highlight"/> or-->
<!--<button special="cancel" string="Close" class="oe_link"/>-->
<button name="delete" string="Delete message" type="object" class="oe_highlight oe_right" confirm="Do you really want to delete this message?" attrs="{'invisible':[('uid','!=',1)]}"/>
</footer>
</form>
</field>
</record>
<!--<button name="delete" string="Delete message" type="object" class="oe_highlight oe_right" confirm="Do you really want to delete this message?" attrs="{'invisible':[('uid','!=',1)]}"/>-->
<!--</footer>-->
<!--</form>-->
<!--</field>-->
<!--</record>-->
<!-- Relocation config wizard -->
<record id="view_mail_move_message_config_settings" model="ir.ui.view">
<field name="name">relocation settings</field>
<field name="model">mail_move_message.config.settings</field>
<field name="arch" type="xml">
<form string="Configure Mail Relocation" class="oe_form_configuration">
<header>
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
or
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header>
<div name="general">
<separator string="Models"/>
<field name="model_ids" widget="many2many_tags"/>
<separator string="Options"/>
<label for="move_followers"/>
<field name="move_followers"/>
</div>
</form>
</field>
</record>
<!--&lt;!&ndash; Relocation config wizard &ndash;&gt;-->
<!--<record id="view_mail_move_message_config_settings" model="ir.ui.view">-->
<!--<field name="name">relocation settings</field>-->
<!--<field name="model">mail_move_message.config.settings</field>-->
<!--<field name="arch" type="xml">-->
<!--<form string="Configure Mail Relocation" class="oe_form_configuration">-->
<!--<header>-->
<!--<button string="Apply" type="object" name="execute" class="oe_highlight"/>-->
<!--or-->
<!--<button string="Cancel" type="object" name="cancel" class="oe_link"/>-->
<!--</header>-->
<!--<div name="general">-->
<!--<separator string="Models"/>-->
<!--<field name="model_ids" widget="many2many_tags"/>-->
<!--<separator string="Options"/>-->
<!--<label for="move_followers"/>-->
<!--<field name="move_followers"/>-->
<!--</div>-->
<!--</form>-->
<!--</field>-->
<!--</record>-->
<record id="action_mail_move_message_config" model="ir.actions.act_window">
<field name="name">Mail Relocation</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mail_move_message.config.settings</field>
<field name="view_id" ref="view_mail_move_message_config_settings"/>
<field name="view_mode">form</field>
<field name="target">inline</field>
</record>
<!--<record id="action_mail_move_message_config" model="ir.actions.act_window">-->
<!--<field name="name">Mail Relocation</field>-->
<!--<field name="type">ir.actions.act_window</field>-->
<!--<field name="res_model">mail_move_message.config.settings</field>-->
<!--<field name="view_id" ref="view_mail_move_message_config_settings"/>-->
<!--<field name="view_mode">form</field>-->
<!--<field name="target">inline</field>-->
<!--</record>-->
<!-- Add menu entry in Settings/Email -->
<menuitem name="Mail Relocation" id="menu_mail_move_message" parent="base.menu_email" sequence="99" action="action_mail_move_message_config"/>
<!--&lt;!&ndash; Add menu entry in Settings/Email &ndash;&gt;-->
<!--<menuitem name="Mail Relocation" id="menu_mail_move_message" parent="base.menu_email" sequence="99" action="action_mail_move_message_config"/>-->
</data>
</openerp>

25
mail_move_message/static/src/css/mail_move_message.css

@ -1,13 +1,26 @@
.openerp .oe_mail .oe_msg .oe_msg_icons .oe_move.oe_moved a {
color: #ffefe;
i.fa.fa-arrows-alt.oe_move.oe_moved {
color: #ffefef;
text-shadow: 0px 1px #961b1b,0px -1px #961b1b, -1px 0px #961b1b, 1px 0px #961b1b, 0px 3px 3px rgba(0,0,0,0.1);
}
.openerp .oe_mail .oe_msg .oe_msg_icons .oe_move:hover a {
i.fa.fa-arrows-alt.oe_move:hover {
color: #ffa1a1;
text-shadow: 0px 1px #ff0000,0px -1px #ff0000, -1px 0px #ff0000, 1px 0px #ff0000, 0px 3px 3px rgba(0,0,0,0.1);
}
.openerp.mail_move_message{
width: 864px;
}
.mail_move_message {
width: 864px;
}
.o_mail_thread .o_thread_message i.oe_move {
cursor: pointer;
opacity: 0;
padding: 4px;
}
.o_mail_thread .o_thread_message:hover i.oe_move {
opacity: 0.6;
}
.o_mail_thread .o_thread_message:hover i.oe_move:hover {
opacity: 1;
}

6
mail_move_message/static/src/xml/mail_move_message_main.xml

@ -11,10 +11,8 @@
<template>
<t t-extend="mail.ChatThread.Message">
<t t-jquery='.fa.fa-lg.o_thread_message_star.fa-star-o' t-operation="before">
<!--<t t-jquery='i[class="fa fa-lg o_thread_message_star fa-star-o"]' t-operation="replace">-->
<!--<t t-jquery='.o_mail_subject' t-operation="replace">-->
<i class="fa fa-arrows-alt"
<t t-jquery='p.o_mail_info>span>i:first-child' t-operation="before">
<i t-att-class="'fa fa-arrows-alt oe_move' + (message.is_moved ? 'oe_moved' : '')"
t-att-data-message-id="message.id" title="Move to thread"/>
</t>
</t>

Loading…
Cancel
Save