Browse Source

Merge pull request #112 from dbo-odoo/10.0-mig-mail_full_expand

[IMP] mail_full_expand: Migrated to 10.0
pull/147/head
Pedro M. Baeza 8 years ago
committed by GitHub
parent
commit
9e2fbebc18
  1. 4
      mail_full_expand/__manifest__.py
  2. 12
      mail_full_expand/static/src/css/mail_full_expand.css
  3. 25
      mail_full_expand/static/src/css/mail_full_expand.less
  4. 43
      mail_full_expand/static/src/js/mail_full_expand.js
  5. 9
      mail_full_expand/static/src/xml/mail_full_expand.xml
  6. 2
      mail_full_expand/views/assets.xml
  7. 72
      mail_full_expand/views/mail_full_expand.xml

4
mail_full_expand/__manifest__.py

@ -5,13 +5,13 @@
{
"name": "Mail full expand",
"summary": "Expand mail in a big window",
"version": "8.0.3.0.0",
"version": "10.0.1.0.0",
"category": "Social Network",
"website": "http://www.grupoesoc.es, https://odoo-community.org/",
"author": "Grupo ESOC, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
'installable': False,
'installable': True,
"depends": [
"mail",
"web",

12
mail_full_expand/static/src/css/mail_full_expand.css

@ -1,12 +0,0 @@
/* © 2014-2015 Grupo ESOC <http://www.grupoesoc.es>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
.openerp .oe_mail .oe_msg .oe_msg_icons .oe_full_expand:hover a{
color: #BBBAFF;
text-shadow: 0px 1px #7C7BAD,
0px -1px #7C7BAD,
-1px 0px #7C7BAD,
1px 0px #7C7BAD,
0px 3px 3px rgba(0, 0, 0, 0.1);
}

25
mail_full_expand/static/src/css/mail_full_expand.less

@ -0,0 +1,25 @@
/* © 2014-2015 Grupo ESOC <http://www.grupoesoc.es>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
.o_mail_thread .o_thread_message {
.o_full_expand {
cursor: pointer;
opacity: 0;
margin-right: -5px;
padding: 4px;
}
&.o_thread_selected_message .o_full_expand {
opacity: 0.6;
}
&:hover {
.o_full_expand {
opacity: 0.6;
&:hover {
opacity: 1;
}
}
}
}

43
mail_full_expand/static/src/js/mail_full_expand.js

@ -1,26 +1,29 @@
/* © 2014-2015 Grupo ESOC <http://www.grupoesoc.es>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
odoo.define('mail_full_expand.expand', function (require) {
"use strict";
openerp.mail_full_expand = function (instance) {
instance.mail.ThreadMessage.include({
bind_events: function () {
this._super.apply(this, arguments);
this.$('.oe_full_expand').on('click', this.on_message_full_expand);
},
var Thread = require('mail.ChatThread');
on_message_full_expand: function() {
// Get the action data and execute it to open the full view
var do_action = this.do_action,
msg_id = this.id;
Thread.include({
events: _.defaults({
"click .o_full_expand": "on_message_full_expand",
}, Thread.prototype.events),
on_message_full_expand: function(event) {
// Get the action data and execute it to open the full view
var do_action = this.do_action,
msg_id = $(event.currentTarget).data('message-id');
this.rpc("/web/action/load", {
"action_id": "mail_full_expand.act_window",
})
.done(function(action) {
action.res_id = msg_id;
do_action(action);
});
}
});
};
this.rpc("/web/action/load", {
"action_id": "mail_full_expand.mail_message_action",
})
.done(function(action) {
action.res_id = msg_id;
do_action(action);
});
}
});
});

9
mail_full_expand/static/src/xml/mail_full_expand.xml

@ -4,11 +4,10 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<template>
<t t-extend="mail.thread.message">
<t t-jquery=".oe_msg_icons" t-operation="append">
<span class="oe_full_expand">
<a title="Fully expand" class="oe_e">Ñ</a>
</span>
<t t-extend="mail.ChatThread.Message">
<t t-jquery=".o_thread_message_needaction" t-operation="after">
<i class="fa o_full_expand fa-arrows-alt"
t-att-data-message-id="message.id" title="Fully Expand"/>
</t>
</t>
</template>

2
mail_full_expand/views/assets.xml

@ -11,7 +11,7 @@
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet"
href="/mail_full_expand/static/src/css/mail_full_expand.css"/>
href="/mail_full_expand/static/src/css/mail_full_expand.less"/>
<script type="text/javascript"
src="/mail_full_expand/static/src/js/mail_full_expand.js"/>
</xpath>

72
mail_full_expand/views/mail_full_expand.xml

@ -3,44 +3,38 @@
<!-- © 2014-2015 Grupo ESOC <http://www.grupoesoc.es>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp>
<data>
<record id="view" model="ir.ui.view">
<field name="name">mail.message.full_expand</field>
<field name="model">mail.message</field>
<field name="arch" type="xml">
<form string="Message" version="7.0">
<group>
<field name="author_id" readonly="1"/>
<field name="email_from" readonly="1"/>
<field name="date" readonly="1"/>
<field name="partner_ids"
widget="many2many_tags"
readonly="1"/>
<field name="notified_partner_ids"
widget="many2many_tags"
<odoo>
<record id="mail_message_view_form" model="ir.ui.view">
<field name="name">mail.message.full_expand</field>
<field name="model">mail.message</field>
<field name="priority">30</field>
<field name="arch" type="xml">
<form string="Message">
<group>
<field name="author_id" readonly="1"/>
<field name="email_from" readonly="1"/>
<field name="date" readonly="1"/>
<field name="partner_ids"
widget="many2many_tags"
readonly="1"/>
</group>
<h1><field name="subject" readonly="1"/></h1>
<field name="body" readonly="1"/>
<field name="attachment_ids"
widget="many2many_binary"
readonly="1"/>
</group>
<h1><field name="subject" readonly="1"/></h1>
<field name="body" readonly="1"/>
<field name="attachment_ids"
widget="many2many_binary"
readonly="1"/>
</form>
</field>
</record>
<record id="act_window" model="ir.actions.act_window">
<field name="name">Read Full Email</field>
<field name="res_model">mail.message</field>
<field name="src_model">mail.message</field>
<field name="type">ir.actions.act_window</field>
<field name="view_id" ref="view"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</form>
</field>
</record>
</data>
</openerp>
<record id="mail_message_action" model="ir.actions.act_window">
<field name="name">Read Full Email</field>
<field name="res_model">mail.message</field>
<field name="src_model">mail.message</field>
<field name="type">ir.actions.act_window</field>
<field name="view_id" ref="mail_message_view_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>
Loading…
Cancel
Save