Browse Source

[PORT] Fixes porting 8.0 to 9.0

pull/66/head
GabbasovDinar 8 years ago
committed by Ivan Yelizariev
parent
commit
82870f7447
  1. 6
      mail_attachment_popup/README.rst
  2. 10
      mail_attachment_popup/static/src/css/styles.css
  3. 24
      mail_attachment_popup/static/src/xml/mail_attachment_popup.xml
  4. 2
      mail_attachment_popup/views/mail_attachment_popup_template.xml

6
mail_attachment_popup/README.rst

@ -18,12 +18,12 @@ Sponsors
Further information Further information
=================== ===================
Demo: http://runbot.it-projects.info/demo/mail-addons/8.0
Demo: http://runbot.it-projects.info/demo/mail-addons/9.0
HTML Description: https://apps.odoo.com/apps/modules/8.0/mail_attachment_popup/
HTML Description: https://apps.odoo.com/apps/modules/9.0/mail_attachment_popup/
Usage instructions: `<doc/index.rst>`_ Usage instructions: `<doc/index.rst>`_
Changelog: `<doc/changelog.rst>`_ Changelog: `<doc/changelog.rst>`_
Tested on Odoo 8.0 6682bde8a202794740b9756542b5b119db7606f3
Tested on Odoo 9.0 021878f9c41c6d652abf345c3c5537fe92f8bc5b

10
mail_attachment_popup/static/src/css/styles.css

@ -2,9 +2,15 @@
display: none; display: none;
} }
.box-modal img { .box-modal img {
max-width: 1100px;
max-width: 900px;
width: 100%; width: 100%;
} }
.oe_attachment.oe_preview {
.box-modal-li li {
list-style-type: none;
}
.box-modal-li {
padding-left: 0;
}
.o_attachment .o_image {
cursor: pointer; cursor: pointer;
} }

24
mail_attachment_popup/static/src/xml/mail_attachment_popup.xml

@ -1,19 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<template> <template>
<t t-extend="mail.thread.message.attachments">
<t t-jquery="t[t-if='attachment.file_type_icon === 'webimage''] a[t-att-href='attachment.url']" t-operation="replace">
<t t-extend="mail.Attachment">
<t t-jquery="div[t-att-title='attachment.name'] .o_image" t-operation="replace">
<t t-if="attachment.mimetype == 'image/png'">
<span class="m-dotted" t-attf-onclick="$('#ImageModal{{ attachment.id }}').arcticmodal()"> <span class="m-dotted" t-attf-onclick="$('#ImageModal{{ attachment.id }}').arcticmodal()">
<img t-att-src="widget.attachments_resize_image(attachment.id, [100,80])"></img>
<div class='oe_name'><t t-raw='attachment.name' /></div>
<div class="o_image" target="_blank" t-att-data-mimetype="attachment.mimetype" t-attf-data-src="/web/image/#{attachment.id}/100x80">
<span class='o_attachment_name'><t t-esc='attachment.name'/></span>
</div>
</span> </span>
<div class="g-hidden"> <div class="g-hidden">
<div class="box-modal" t-attf-id="ImageModal{{ attachment.id }}"> <div class="box-modal" t-attf-id="ImageModal{{ attachment.id }}">
<div class="box-modal_close arcticmodal-close">X</div> <div class="box-modal_close arcticmodal-close">X</div>
<img t-att-src="widget.attachments_resize_image(attachment.id, [100,80])"></img>
<div class='oe_name'><t t-raw='attachment.name' /></div>
<div class='oe_download_original_img'><a t-att-href='attachment.url' target="_blank">Download</a></div>
<img t-att-data-mimetype="attachment.mimetype" t-attf-src="/web/image/#{attachment.id}"></img>
<ul class="box-modal-li">
<li><span class='o_attachment_name'><t t-esc='attachment.name'/></span></li>
<li><span class='oe_download_original_img'><a t-att-href='attachment.url' target="_blank">Download</a></span></li>
</ul>
</div> </div>
</div> </div>
</t> </t>
<t t-if="attachment.mimetype != 'image/png'">
<a class="o_image" t-att-href='attachment.url' target="_blank" t-att-data-mimetype="attachment.mimetype" t-attf-data-src="/web/image/#{attachment.id}/100x80">
<span class='o_attachment_name'><t t-esc='attachment.name'/></span>
</a>
</t>
</t>
</t> </t>
</template> </template>

2
mail_attachment_popup/views/mail_attachment_popup_template.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp> <openerp>
<data> <data>
<template id="assets_backend" name="account assets" inherit_id="web.assets_backend">
<template id="assets_backend" name="mail attachment popup assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" href="/mail_attachment_popup/static/src/css/jquery.arcticmodal.css"/> <link rel="stylesheet" href="/mail_attachment_popup/static/src/css/jquery.arcticmodal.css"/>
<link rel="stylesheet" href="/mail_attachment_popup/static/src/css/simple.css"/> <link rel="stylesheet" href="/mail_attachment_popup/static/src/css/simple.css"/>

Loading…
Cancel
Save