summaryrefslogtreecommitdiff
path: root/addons/project/static/src/xml/project.xml
diff options
context:
space:
mode:
authorVandan Shah <vas@odoo.com>2017-07-03 16:46:12 +0530
committerYannick Tivisse <yti@odoo.com>2017-10-19 11:26:34 +0200
commit77f30a261903174dd0106c93086805cbfead37aa (patch)
tree465579802a829bf867f9f4cc62659e6449fb96b9 /addons/project/static/src/xml/project.xml
parent8f88c0336f881dd59d7c25b64c5bcba1989f998b (diff)
[IMP] project: Improve the cover image mechanism
Purpose ======= If there is no picture attached to a task, the user doesn't understand how to add a cover image. Sepecification ============== - "Select" button to select image => Display only if we have images - "Remove Cover Image" => Display only if image already set - "Upload and Set" => Always visible , highlight button if no images. Image uploaded via dailog box should automatically set on task kanban and add to the "Attachments" in task.
Diffstat (limited to 'addons/project/static/src/xml/project.xml')
-rw-r--r--addons/project/static/src/xml/project.xml19
1 files changed, 16 insertions, 3 deletions
diff --git a/addons/project/static/src/xml/project.xml b/addons/project/static/src/xml/project.xml
index a2d222784b9..0406bb9f855 100644
--- a/addons/project/static/src/xml/project.xml
+++ b/addons/project/static/src/xml/project.xml
@@ -1,9 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="project.SetCoverModal">
- <div t-if="attachment_ids.length > 0" class="o_kanban_task_cover_image">
- <img t-foreach="attachment_ids" t-as="attachment" t-attf-class="img-responsive#{cover_id == attachment['id'] ? ' o_selected' : ''}" t-attf-src="/web/image/#{attachment['id']}?unique=1" t-att-data-id="attachment['id']" t-att-data-name="attachment['name']"/>
+ <div t-if="attachment_ids.length > 0" class="ml32 mr0 o_kanban_task_cover_container">
+ <t t-foreach="attachment_ids" t-as="attachment">
+ <div t-attf-class="o_kanban_task_cover_image#{cover_id == attachment['id'] ? ' o_selected' : ''}">
+ <img t-attf-src="/web/image/#{attachment['id']}?unique=1" t-att-data-id="attachment['id']" t-att-data-name="attachment['name']"/>
+ </div>
+ </t>
</div>
- <div t-if="attachment_ids.length == 0">There is no available image to be set as cover. Send a message on the task with an attached image.</div>
+ <div t-if="attachment_ids.length == 0">There is no available image to be set as cover.</div>
+ <span class="hide">
+ <t t-call="HiddenInputFile">
+ <t t-set="fileupload_id" t-value="widget.imageUploadID" />
+ <t t-set="fileupload_action" t-translation="off">/web/binary/upload_attachment</t>
+ <input type="hidden" name="model" t-att-value="widget.modelName" />
+ <input type="hidden" name="id" t-att-value="widget.id" />
+ <input type="hidden" name="session_id" t-att-value="widget.getSession().session_id" />
+ </t>
+ </span>
</t>
</templates>