Browse Source

[ADD] mail_read_new_window addon

pull/30/head
Peter Hahn 9 years ago
parent
commit
9f5fbab27d
  1. 56
      mail_read_new_window/README.rst
  2. 0
      mail_read_new_window/__init__.py
  3. 42
      mail_read_new_window/__openerp__.py
  4. 32
      mail_read_new_window/i18n/de.po
  5. 31
      mail_read_new_window/i18n/mail_read_new_window.pot
  6. 13
      mail_read_new_window/mail_read_new_window_view.xml
  7. BIN
      mail_read_new_window/static/description/icon.png
  8. 9
      mail_read_new_window/static/src/css/mail_read_new_window.css
  9. 27
      mail_read_new_window/static/src/js/mail_read_new_window.js
  10. 10
      mail_read_new_window/static/src/xml/mail_read_new_window.xml

56
mail_read_new_window/README.rst

@ -0,0 +1,56 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
=======================
Mail open in new window
=======================
This module was written to extend the functionality of messaging to support
opening messages in a new window and allow you to read its full content.
This module adds a button to all messages to open them in a new browser window
with their full contents.
Usage
=====
To use this module, you need to:
* Go to any view with a message thread.
* Click the *Open in new window* button (two overlayed windows indicating a new window).
For further information, please visit:
* https://www.odoo.com/forum/help-1
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
`here <https://github.com/OCA/social/issues/new?body=module:%20mail_full_expand%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Peter Hahn <peter.hahn@initos.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.

0
mail_read_new_window/__init__.py

42
mail_read_new_window/__openerp__.py

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2015 initOS GmbH (<http://www.initos.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
{
'name': 'Mail open in new window',
'summary': 'Open mail in new window',
'version': '1.0',
"category": "Social Network",
'website': 'http://www.initos.com, https://odoo-community.org',
'author': 'initOS GmbH, Odoo Community Association (OCA)',
"license": "AGPL-3",
'application': False,
'installable': True,
'auto_install': False,
'depends': [
'mail',
'web',
],
'data': [
'mail_read_new_window_view.xml',
],
'qweb': [
'static/src/xml/mail_read_new_window.xml',
],
}

32
mail_read_new_window/i18n/de.po

@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_read_new_window
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-12-17 11:19+0000\n"
"PO-Revision-Date: 2015-12-17 12:21+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.4\n"
"Language: de\n"
"X-Poedit-SourceCharset: UTF-8\n"
#. module: mail_read_new_window
#. openerp-web
#: code:addons/mail_read_new_window/static/src/xml/mail_read_new_window.xml:6
#, python-format
msgid "Open in new window"
msgstr "In neuem Fenster öffnen"
#. module: mail_read_new_window
#. openerp-web
#: code:addons/mail_read_new_window/static/src/js/mail_read_new_window.js:18
#, python-format
msgid "Open message in new window"
msgstr "Nachricht in neuem Fenster öffnen"

31
mail_read_new_window/i18n/mail_read_new_window.pot

@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_read_new_window
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-12-17 11:19+0000\n"
"PO-Revision-Date: 2015-12-17 11:19+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: mail_read_new_window
#. openerp-web
#: code:addons/mail_read_new_window/static/src/xml/mail_read_new_window.xml:6
#, python-format
msgid "Open in new window"
msgstr ""
#. module: mail_read_new_window
#. openerp-web
#: code:addons/mail_read_new_window/static/src/js/mail_read_new_window.js:18
#, python-format
msgid "Open message in new window"
msgstr ""

13
mail_read_new_window/mail_read_new_window_view.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="custom bar assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/mail_read_new_window/static/src/css/mail_read_new_window.css"/>
<script type="text/javascript" src="/mail_read_new_window/static/src/js/mail_read_new_window.js"></script>
</xpath>
</template>
</data>
</openerp>

BIN
mail_read_new_window/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

9
mail_read_new_window/static/src/css/mail_read_new_window.css

@ -0,0 +1,9 @@
.openerp .oe_mail .oe_msg .oe_msg_icons .oe_mail_open:hover a {
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);
}

27
mail_read_new_window/static/src/js/mail_read_new_window.js

@ -0,0 +1,27 @@
openerp.mail_read_new_window = function (instance) {
var _t = instance.web._t,
_lt = instance.web._lt;
instance.mail.ThreadMessage.include({
bind_events: function(){
this._super.apply(this, arguments);
this.$('.oe_mail_open').on('click', this.on_read_new_window)
},
on_read_new_window: function(event){
var self = this;
var _url = _.str.sprintf('#id=%s&view_type=form&model=mail.message',
this.id);
var action = {
name: _t('Open message in new window'),
type: 'ir.actions.act_url',
url: _url,
target: 'new',
};
self.do_action(action);
}
});
}

10
mail_read_new_window/static/src/xml/mail_read_new_window.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<template>
<t t-extend="mail.thread.message">
<t t-jquery=".oe_msg_icons" t-operation="append">
<span t-attf-class="oe_mail_open">
<a title="Open in new window" class="oe_e">ò</a>
</span>
</t>
</t>
</template>
Loading…
Cancel
Save