This commit adds a right panel in the project update view. This is done by extending each View and Controller by mixins handling the RightPanel functionnality. In the RightPanelControllerMixin, we use the component Adapter to launch the Owl RightPanel Component from a Legacy Controller. This solution is based on SearchPanel and ControlPanel implementation. In the RendererMixin we handle some styling just as it's done for the SearchPanel. In the ViewMixin, we add the handling of a RightSidePanel config parameter which is passed to the Controller via params. The Project RightPanel Component gets information about the active project in the context through a rpc call and render the resulting data in a owl template. This template doen't have the ambition to be generic but only specific to this view. Serverside, the data are collected in a dict through few methods in order to be easily extended. Mixins are used in kanban and list views, each time a project update view is added, the developper will have to extend the dedicated View, Renderer and Controller. PR: #68899 task-2393768
137 lines
6.0 KiB
XML
137 lines
6.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<templates id="template" xml:space="preserve">
|
|
<t t-name="day_of_week_widget">
|
|
<table class="o_dow_widget">
|
|
<thead>
|
|
<tr>
|
|
<th t-foreach="widget.labels" t-as="label">
|
|
<t t-esc="label"/>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="o_dow_days" />
|
|
</tbody>
|
|
</table>
|
|
</t>
|
|
|
|
<span t-name="project.statusWithColor" t-att-class="'o_status_bubble o_color_bubble_' + color"></span>
|
|
|
|
<div t-name="project.ControlPanel" t-inherit="web.ControlPanel" t-inherit-mode="extension" owl="1">
|
|
<xpath expr="//ol[hasclass('breadcrumb')]" position="inside">
|
|
<t t-call="project.ControlPanelContent"/>
|
|
</xpath>
|
|
</div>
|
|
|
|
<t t-name="project.ControlPanelContent" owl="1">
|
|
<t t-if="show_project_update">
|
|
<li t-if="is_project_manager" class="o_project_updates_breadcrumb o_project_updates_clickable" t-on-click="onStatusClick">
|
|
<span t-attf-class="o_status_bubble o_color_bubble_{{data.color}} position-relative'"/>
|
|
<span class="font-italic"><t t-esc="data.status"/></span>
|
|
</li>
|
|
<li t-else="" class="o_project_updates_breadcrumb">
|
|
<span t-attf-class="o_status_bubble o_color_bubble_{{data.color}} position-relative'"/>
|
|
<span class="font-italic"><t t-esc="data.status"/></span>
|
|
</li>
|
|
</t>
|
|
</t>
|
|
|
|
<t t-name="project.ProjectRightPanel" owl="1">
|
|
<div class="o_rightpanel">
|
|
<t t-set="tasksAnalysis" t-value="state.data.tasks_analysis"/>
|
|
<div class="o_rightpanel_section">
|
|
<div class="o_rightpanel_header">
|
|
<div class="o_rightpanel_title">
|
|
Tasks Analysis
|
|
</div>
|
|
</div>
|
|
|
|
<div class="o_rightpanel_data">
|
|
<div t-foreach="tasksAnalysis.data" t-as="analysis" t-key="analysis.name" class="o_rightpanel_data_row">
|
|
<a t-if="state.data.user.is_project_manager" class="btn btn-link o_rightpanel_left_col o_rightpanel_left_button" t-on-click="onProjectActionClick"
|
|
t-att-data-action="analysis.action.action"
|
|
t-att-data-additional_context="analysis.action.additional_context"
|
|
data-type="action">
|
|
<t t-esc="analysis.name"/>
|
|
</a>
|
|
<span t-else="" class="o_rightpanel_left_col o_rightpanel_left_text"><t t-esc="analysis.name"/></span>
|
|
<span class="o_rightpanel_right_col"><t t-esc="analysis.value"/></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<t t-set="milestones" t-value="state.data.milestones"/>
|
|
<div class="o_rightpanel_section">
|
|
<div class="o_rightpanel_header">
|
|
<div class="o_rightpanel_title">
|
|
Milestones
|
|
</div>
|
|
<span class="o_rightpanel_button">
|
|
<AddMilestone context="context"/>
|
|
</span>
|
|
</div>
|
|
<div class="o_rightpanel_data">
|
|
<div t-foreach="milestones.data" t-as="milestone" t-key="milestone.id" class="o_rightpanel_data_row">
|
|
<OpenMilestone context="context" milestone="milestone" t-key="milestone.id"/>
|
|
</div>
|
|
<span t-if="milestones.data.length === 0" class="text-muted font-italic">
|
|
Track major progress points that must be reached to achieve success.
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
|
|
<t t-name="project.AddMilestone" owl="1">
|
|
<div class="o_add_milestone">
|
|
<a t-on-click="onAddMilestoneClick">Add Milestone</a>
|
|
<span t-if="state.openDialog" class="o_rightpanel_hidden">
|
|
<FormViewDialogComponentAdapter
|
|
Component="FormViewDialog"
|
|
params="{
|
|
context: context,
|
|
on_saved: _onDialogSaved,
|
|
res_id: false,
|
|
res_model: 'project.milestone',
|
|
title: NEW_PROJECT_MILESTONE,
|
|
disable_multiple_selection: true,
|
|
}"
|
|
t-ref="dialog"
|
|
/>
|
|
</span>
|
|
</div>
|
|
</t>
|
|
|
|
<t t-name="project.OpenMilestone" owl="1">
|
|
<div class="o_open_milestone" t-att-class="state.colorClass">
|
|
<span class="o_milestone_checkbox" t-on-click="onMilestoneClick">
|
|
<i class="fa" t-att-class="state.checkboxIcon"></i>
|
|
</span>
|
|
<div class="o_milestone_detail" t-on-click="onOpenMilestone">
|
|
<t t-esc="milestone.name"/>
|
|
<span class="o_rightpanel_right_col">
|
|
<t t-esc="deadline"/>
|
|
</span>
|
|
</div>
|
|
<span class="o_rightpanel_right_col">
|
|
<a class="o_delete_icon" t-on-click="onDeleteMilestone" title="Delete Milestone"><i class="fa fa-trash"></i></a>
|
|
</span>
|
|
<span t-if="state.openDialog" class="o_rightpanel_hidden">
|
|
<FormViewDialogComponentAdapter
|
|
Component="FormViewDialog"
|
|
params="{
|
|
context: context,
|
|
on_saved: _onDialogSaved,
|
|
res_id: milestone.id,
|
|
res_model: 'project.milestone',
|
|
title: OPEN_PROJECT_MILESTONE,
|
|
disable_multiple_selection: true,
|
|
deletable: true
|
|
}"
|
|
t-ref="dialog"
|
|
/>
|
|
</span>
|
|
</div>
|
|
</t>
|
|
|
|
</templates>
|