diff options
| author | Robot Odoo <xmo+roboto@odoo.com> | 2019-04-24 08:55:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-24 08:55:26 +0200 |
| commit | 8c931ffc2e6f31caac4c15050403a84ca92b8c82 (patch) | |
| tree | 3000ebd70f099c24a487ab43d36c6356c3d093ce /addons/web/static/src/xml/base.xml | |
| parent | a7ac71ed4404aa2630619c331d725f4f545626f8 (diff) | |
| parent | ee0a5ca4490ee83a0ed9d6e4f7382246b50da170 (diff) | |
[MERGE][IMP] account: usability if invoice form, portal and pdf
Impacted modules: account, mail and web. (The 2 last only for the upload widget).
The merge brings lots of small UI improvements for invoices:
- reorganize form view to group field by their puprose and information type they provide to the end user
- remove duplicate information
- clean labels and tooltips for some fields
It also makes the "upload multiple widget" (the cutom one from the chatter) generic for all form views, ... (notably for the email composer wizard).
Task-1930087
closes odoo/odoo#30600
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 63 |
1 files changed, 38 insertions, 25 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index f2b7c9653c6..6d00f21ab6f 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1089,33 +1089,46 @@ </t> </div> </div> -<div t-name="FieldBinaryFileUploader.files" class="oe_attachments" aria-atomic="true"> - <t t-if="widget.mode === 'readonly'"> - <div t-foreach="widget.value.data" t-as="file"> - <a target="_blank" t-att-href="widget.metadata[file.id].url" t-attf-title="#{(file.data.name || file.data.filename) + (file.data.date?' \n('+file.data.date+')':'' )}"><t t-raw="file.data.name || file.data.filename"/></a> - </div> - </t> - <t t-else="1"> - <div t-foreach="widget.value.data" t-as="file" class="oe_attachment"> - <t t-if="!file.data.upload"> - <div> - <a href="#" class="fa fa-times float-right oe_delete" title="Delete this file" aria-label="Delete this file" t-att-data-id="file.data.id"/> - <div class="caption"><t t-raw="file.data.name || file.data.filename"/></div> + +<t t-name="FieldBinaryFileUploader.attachment_preview"> + <t t-set="url" t-value="widget.metadata[file.id] ? widget.metadata[file.id].url : false"/> + <t t-if="file.data" t-set="file" t-value="file.data"/> + <t t-set="editable" t-value="widget.mode === 'edit'"/> + <t t-if="file.mimetype" t-set="mimetype" t-value="file.mimetype"/> + <div t-attf-class="o_attachment o_attachment_many2many #{ editable ? 'o_attachment_editable' : '' } #{upload ? 'o_attachment_uploading' : ''}" t-att-title="file.name"> + <div class="o_attachment_wrap"> + <t t-set="ext" t-value="file.name.replace(/^.*\./, '')"/> + <div class="o_image_box float-left" t-att-data-id="file.id"> + <a t-att-href="url" t-att-title="'Download ' + file.name" aria-label="Download"> + <span class="o_image o_hover" t-att-data-mimetype="mimetype" t-att-data-ext="ext" role="img"/> + </a> + </div> + + <div class="caption"> + <a class="ml4" t-att-href="url" t-att-title="'Download ' + file.name"><t t-esc='file.name'/></a> + </div> + <div class="caption small"> + <a class="ml4 small text-uppercase" t-att-href="url" t-att-title="'Download ' + file.name"><b><t t-esc='ext'/></b></a> + <div t-if="editable" class="progress o_attachment_progress_bar"> + <div class="progress-bar progress-bar-striped active" style="width: 100%">Uploading</div> </div> - <a class="o_image" target="_blank" t-att-href="widget.metadata[file.id] ? widget.metadata[file.id].url : false" - t-att-title="file.data.name" - t-att-aria-label="file.data.name" - t-att-data-mimetype="file.data.mimetype" - t-attf-data-src="/web/image/#{file.data.id}/100x80"/> - </t> - </div> - <div t-foreach="widget.uploadingFiles" t-as="file" class="oe_attachment"> - <div>Uploading...</div> - <a t-att-title="file.name" t-att-aria-label="file.name" t-att-name="file.name" class="o_image"> - <i class="fa fa-spinner fa-spin fa-5x fa-fw" role="img" aria-label="Loading, please wait..." title="Loading, please wait..."></i> - </a> - <div><t t-esc="file.name"/></div> + </div> + + <div t-if="editable" class="o_attachment_uploaded"><i class="text-success fa fa-check" role="img" aria-label="Uploaded" title="Uploaded"/></div> + <div t-if="editable" class="o_attachment_delete" t-att-data-id="file.id"><span class="text-white" role="img" aria-label="Delete" title="Delete">×</span></div> </div> + </div> +</t> + +<div t-name="FieldBinaryFileUploader.files" class="o_attachments" aria-atomic="true"> + <!-- uploaded files --> + <t t-foreach="widget.value.data" t-as="file"> + <t t-if="!file.data.upload" t-call="FieldBinaryFileUploader.attachment_preview"/> + </t> + <!-- uploading files --> + <t t-foreach="widget.uploadingFiles" t-as="file"> + <t t-set="upload" t-value="true"/> + <t t-call="FieldBinaryFileUploader.attachment_preview"/> </t> </div> |
