<data name="My Task" inherit_id="portal.portal_sidebar" primary="True">
        <xpath expr="//t[@t-call='portal.portal_layout']" position="attributes">
            <attribute name="t-call">project.task_link_preview_portal_layout</attribute>
        </xpath>
        <xpath expr="//div[hasclass('o_portal_sidebar')]" position="inside">
            <t t-set="title" t-value="task.name"/>
            <t t-set="o_portal_fullwidth_alert" groups="project.group_project_user">
                <t t-call="portal.portal_back_in_edit_mode">
                    <t t-set="backend_url" t-value="'/odoo/action-project.action_view_my_task/%s' % (task.id)"/>
                </t>
            </t>

            <div class="row o_project_portal_sidebar">
                <t t-call="portal.portal_record_sidebar">
                    <t t-set="classes" t-value="'col-lg-4 col-xxl-3 d-print-none'"/>

                    <t t-set="entries">
                        <div class="d-flex flex-wrap flex-column gap-4">
                            <div id="task-nav" class="d-flex align-items-center flex-grow-1 p-0" t-ignore="true" role="complementary">
                                <ul class="nav flex-column">
                                    <li class="nav-item" id="nav-header">
                                        <a class="nav-link p-0" href="#card_header">
                                            Task
                                        </a>
                                    </li>
                                    <li class="nav-item" id="nav-chat">
                                        <a class="nav-link p-0" href="#task_chat">
                                            History
                                        </a>
                                    </li>
                                </ul>
                            </div>
                            <div id="task-links" t-if="task_link_section" class="d-flex align-items-center flex-grow-1 ps-0" t-ignore="true" role="complementary">
                                <ul class="nav flex-column">
                                    <t t-foreach="task_link_section" t-as="task_link">
                                        <li class="nav-item">
                                            <a class="nav-link p-0" t-att-href="task_link['access_url']" t-att-target="task_link.get('target', '_self')">
                                                <t t-out="task_link['title']"/>
                                            </a>
                                        </li>
                                    </t>
                                </ul>
                            </div>

                            <div t-if="task.user_ids or task.partner_id" class="d-flex flex-column gap-4 mt-3">
                                <div t-if="task.user_ids">
                                    <h6 class="flex-basis-100"><small class="text-muted">Assignees</small></h6>
                                    <t t-foreach="task.user_ids" t-as="user">
                                        <t t-call="portal.portal_my_contact">
                                            <t t-set="_spacingClass" t-value="'mb-3' if len(task.user_ids) &gt; 1 else ''"/>
                                            <t t-set="_contactAvatar" t-value="image_data_uri(user.avatar_128)"/>
                                            <t t-set="_contactName" t-value="user.name"/>
                                            <div t-out="user" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;email&quot;, &quot;phone&quot;]}"/>
                                        </t>
                                    </t>
                                </div>
                                <div class="col-12 d-flex flex-column" t-if="task.partner_id">
                                    <h6><small class="text-muted">Customer</small></h6>
                                    <t t-if="task.partner_id">
                                        <t t-call="portal.portal_my_contact">
                                            <t t-set="_contactAvatar" t-value="image_data_uri(task.partner_id.avatar_512)"/>
                                            <t t-set="_contactName" t-value="task.partner_id.display_name"/>
                                            <div t-field="task.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;email&quot;, &quot;phone&quot;]}"/>
                                        </t>
                                    </t>
                                </div>
                            </div>
                        </div>
                    </t>
                </t>
                <div id="task_content" class="o_portal_content col-12 col-lg-8 col-xxl-9">
                    <div id="card">
                        <div id="card_header" data-anchor="true">
                            <div class="row justify-content-between mb-3">
                                <div class="col-12 col-md-9">
                                    <div class="d-flex gap-2">
                                        <h3 class="my-0">
                                            <t t-call="project.portal_my_tasks_priority_widget_template"/>
                                            <span t-field="task.name"/>
                                            <small class="text-muted d-none d-md-inline">(#<span t-field="task.id"/>)</small>
                                        </h3>
                                    </div>
                                </div>
                                <div class="col-auto">
                                    <small class="text-end">Stage:</small>
                                    <span t-field="task.stage_id.name" class=" badge rounded-pill text-bg-info" title="Current stage of this task"/>
                                </div>
                            </div>
                        </div>
                        <div id="card_body">
                            <div class="float-end">
                                <t t-call="project.portal_my_tasks_state_widget_template">
                                    <t t-set="path" t-value="'task'"/>
                                </t>
                            </div>
                            <div class="row mb-4 container">
                                <div class="col-12 col-md-6 flex-grow-1">
                                    <div t-if="project_accessible"><strong>Project:</strong> <a t-attf-href="/my/projects/#{task.project_id.id}" t-field="task.project_id"/></div>
                                    <div t-else=""><strong>Project:</strong> <a t-field="task.project_id"/></div>
                                    <div t-if="task.date_deadline"><strong>Deadline:</strong> <span t-field="task.date_deadline" t-options="{&quot;widget&quot;: &quot;datetime&quot;}"/></div>
                                    <div t-if="task.milestone_id and task.allow_milestones"><strong>Milestone:</strong> <span t-field="task.milestone_id"/></div>
                                    <div name="portal_my_task_allocated_hours">
                                        <strong t-if="task.allocated_hours &gt; 0">Allocated Time:</strong>
                                        <t t-call="project.portal_my_task_allocated_hours_template"/>
                                    </div>
                                </div>
                                <div class="col-12 col-md-6 d-empty-none" name="portal_my_task_second_column"/>
                            </div>

                            <div class="row" t-if="task.description or task.attachment_ids">
                                <div t-if="not is_html_empty(task.description)" class="mb-4 mb-md-0">
                                    <h5 class="mb-1">Description</h5>
                                    <hr class="mt-1 mb-2"/>
                                    <div class="py-1 px-2 bg-100 small overflow-auto table-responsive mb-4" t-field="task.description"/>
                                </div>
                                <div t-if="task.attachment_ids" class="o_project_portal_attachments">
                                    <h5 class="mb-1">Attachments</h5>
                                    <hr class="mt-1 mb-2"/>
                                    <div class="row">
                                        <t t-foreach="task.attachment_ids" t-as="attachment">
                                            <div class="col-md-6">
                                                <ul class="list-unstyled">
                                                    <li class="oe_attachments">
                                                        <a t-attf-href="/web/content/#{attachment.id}?download=true&amp;access_token=#{attachment.access_token}" target="_blank" data-no-post-process="" class="d-flex align-items-center rounded bg-light p-2">
                                                            <div class="oe_attachment_embedded o_image o_image_small me-2 me-lg-3" t-att-title="attachment.name" t-att-data-mimetype="attachment.mimetype" t-attf-data-src="/web/image/#{attachment.id}/50x40?access_token=#{attachment.access_token}">
                                                            </div>
                                                            <div class="oe_attachment_name text-truncate"><t t-esc="attachment.name"/></div>
                                                        </a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </t>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <hr/>
                    <div id="task_chat" data-anchor="true">
                        <h3>Communication history</h3>
                        <t t-call="portal.message_thread">
                            <t t-set="token" t-value="task.access_token"/>
                        </t>
                    </div>
                </div>
            </div>
        </xpath>
    <xpath expr="." position="attributes"><attribute name="t-name">project.portal_my_task</attribute></xpath></data>