diff options
| author | sri-odoo <sri@odoo.com> | 2018-09-14 11:42:07 +0200 |
|---|---|---|
| committer | XavierDo <xdo@odoo.com> | 2018-09-18 13:44:00 +0200 |
| commit | ed2773e381585ee3fd0c6b90e6f97f8f1237e6f4 (patch) | |
| tree | a536d6d14787abf00319c4c95ae8ad9cde917781 /addons/mail/static/src/xml | |
| parent | 47496b9fe5555ef23932fcfc3f2d6d6ee945daae (diff) | |
[REF] mail: activities list, ‘mark as done’ sliding panel
Refactor ‘mark as done’ popup JS in order to use a sliding panel layout instead.
Sliding panels are currently needed in kanban views, where activities are listed in a dropdown that can't handle popups because of CSS overflow and lack of space.
Since this new system check for default bootstrap data-toggle attributes, it could be easily used elsewhere changing the buttons's data-toggle and providing the necessary container for the “mark as done” form.
Diffstat (limited to 'addons/mail/static/src/xml')
| -rw-r--r-- | addons/mail/static/src/xml/web_kanban_activity.xml | 77 |
1 files changed, 42 insertions, 35 deletions
diff --git a/addons/mail/static/src/xml/web_kanban_activity.xml b/addons/mail/static/src/xml/web_kanban_activity.xml index 25d25c1d09b..eb71ba044c2 100644 --- a/addons/mail/static/src/xml/web_kanban_activity.xml +++ b/addons/mail/static/src/xml/web_kanban_activity.xml @@ -20,58 +20,65 @@ <span role="menuitem" t-if="_.isEmpty(records)" class="dropdown-item-text text-center o_no_activity"> No activities planned. </span> - <div t-else="" aria-haspopup="true" role="menu"> - <ul class="nav o_activity_log" role="menu"> + <div t-else="" aria-haspopup="true" role="menu" class="o_activity_log_container dropdown-item bg-100 p-0"> + <ul class="o_activity_log list-group list-group-flush mb-2" role="menu"> <t t-foreach="_.keys(records)" t-as="key"> <t t-set="logs" t-value="records[key]" /> - <li role="menuitem" class="nav-item o_activity_label"> - <strong t-attf-class="o_activity_color_#{key}"> - <t t-esc="selection[key]" /> (<t t-esc="logs.length"/>) - </strong> + <t t-set="contextual_class" t-value="key == 'planned' ? 'success' : (key == 'today' ? 'warning' : 'danger') "/> + + <li role="menuitem" t-attf-class="o_activity_label list-group-item list-group-item list-group-item-light d-flex justify-content-between align-items-center o_activity_color_{{key}} {{!key_first ? 'mt-2' : ''}}"> + <strong><t t-esc="selection[key]"/></strong> + <span t-attf-class="badge badge-pill badge-{{contextual_class}} border-0 mr-0"><t t-esc="logs.length"/></span> </li> <t t-foreach="logs" t-as="log"> <t t-set="edit_class" t-value="'o_edit_activity'"/> <t t-if="log.force_next"> <t t-set="edit_class" t-value=""/> </t> - <li t-att-data-activity-id="log.id" t-attf-class="nav-item o_log_activity #{edit_class}" role="menuitem"> - <div class="o_activity_title float-left"> - <span t-attf-class="fa #{log.icon} fa-fw" role="img" aria-label="Log" title="Log"/> - <strong> - <t t-esc="log.title_action or log.activity_type_id[1]" /> - </strong> - <div> - <span class="fa fa-clock-o fa-fw" role="img" aria-label="Deadline" title="Deadline"/> - <span t-att-title="log.date_deadline"><t t-esc="log.label_delay" /></span> - <div class="mt16" t-att-data-activity-id="log.id" t-att-data-force-next-activity="log.force_next" t-att-data-previous-activity-type-id="log.activity_type_id[0]"> - <t t-if="log.mail_template_ids"> - <t t-foreach="log.mail_template_ids" t-as="mail_template"> - <div> - <i class="fa fa-envelope-o" aria-label="Mail" title="Mail" role="img"></i> - <span t-esc="mail_template.name"/>: - <span class="o_activity_template_preview" t-att-data-template-id="mail_template.id">Preview</span> - <span class="text-muted">or</span> - <span class="o_activity_template_send" t-att-data-template-id="mail_template.id">Send Now</span> - </div> - </t> - </t> + <li t-att-data-activity-id="log.id" t-attf-class="list-group-item o_log_activity d-flex #{edit_class} #{log_last ? 'border-bottom' : ''}" role="menuitem"> + <div class="o_activity_title"> + <div t-attf-class="o_activity_title_entry {{! log.force_next ? 'align-items-center' : 'mb-1'}}"> + <span t-attf-class="fa #{log.icon ? log.icon : 'fa-bell' } fa-fw mr-2 text-center text-muted" role="img" aria-label="Log" title="Log"/> + <strong class="text-dark"><t t-esc="log.title_action or log.activity_type_id[1]"/></strong> + <button t-if="! log.force_next" class="btn btn-sm btn-link py-0 o_edit_button"><i class="fa fa-pencil"/></button> + </div> + <div class="o_activity_title_entry mt-1" t-if="log.state != 'today'"> + <span class="fa fa-clock-o fa-fw mr-2 text-center text-muted" role="img" aria-label="Deadline" title="Deadline"/> + <small t-att-title="log.date_deadline"><t t-esc="log.label_delay" /></small> + </div> + <t t-if="log.mail_template_ids"> + <div t-foreach="log.mail_template_ids" t-as="mail_template" class="o_activity_title_entry mt-2" t-att-data-activity-id="log.id" t-att-data-force-next-activity="log.force_next" t-att-data-previous-activity-type-id="log.activity_type_id[0]"> + <i class="fa fa-envelope-o fa-fw mr-2 text-center text-muted" aria-label="Mail" title="Mail" role="img"></i> + <small> + <div class="mb-1" t-esc="mail_template.name + ':'"/> + <a class="o_activity_template_preview" t-att-data-template-id="mail_template.id" href="#"><b>Preview</b></a> + <small>or</small> + <a class="o_activity_template_send" t-att-data-template-id="mail_template.id" href="#"><b>Send Now</b></a> + </small> </div> - <t t-if="log.user_id[0] != uid"> - <span class="ml4 fa fa-user" role="img" aria-label="User" title="User"/> - <span><t t-esc="log.user_id[1]" /></span> - </t> + </t> + <div t-if="log.user_id[0] != uid and log.mail_template_ids" class="o_activity_title_entry"> + <span class="fa fa-user fa-fw mr-2 text-center text-muted" role="img" aria-label="User" title="User"/> + <span><t t-esc="log.user_id[1]" /></span> </div> </div> - <div class="float-right"> - <span class="o_mark_as_done o_activity_link o_activity_link_kanban fa fa-check-circle fa-2x mt4" t-att-data-force-next-activity="log.force_next" t-att-data-previous-activity-type-id="log.activity_type_id[0]" t-att-data-activity-id="log.id" title="Mark as done" role="img" aria-label="Mark as done"/> + <div class="flex-grow-1 text-right"> + <a t-att-data-force-next-activity="log.force_next" + t-att-data-previous-activity-type-id="log.activity_type_id[0]" + t-att-data-activity-id="log.id" + t-attf-href="#o_mark_done_form{{log.id}}" + class="o_mark_as_done o_activity_link o_activity_link_kanban fa fa-check-circle" + data-toggle="collapse" title="Mark as done" role="img" aria-label="Mark as done"/> </div> </li> + <li t-attf-id="o_activity_form_{{log.id}}" class="o_activity_form list-group-item border-top-0 py-0 mb-2 collapse"></li> </t> </t> </ul> </div> - <div role="menuitem" class="o_schedule_activity text-center"> - <a role="button" class="btn btn-link btn-block"> + <div class="dropdown-divider mt-0"/> + <div role="menuitem" class="o_schedule_activity dropdown-header py-1 text-center"> + <a role="button" class="btn btn-secondary mb-1"> <i class="fa fa-plus fa-fw"></i><strong>Schedule an activity</strong> </a> </div> |
