[FW][IMP] website_event_track(_session): display speaker function in its bio

It allows to better know who the speaker is. This is done through a related
on the speaker function and partner_name fields. It allows to display a
sentence like "Director at Azure Interior", which gives information on both
its position and its company.

LINKS

Coming from internal feedback while deploying online support
Task ID-2314778
PR #558877
X-original-commit 69cf94cec0913db4132ae96d2bc82be4f465d6db
This commit is contained in:
Thibault Delavallée
2020-08-14 14:53:38 +00:00
parent 62bda18d1a
commit 0b3fbfcb38
2 changed files with 13 additions and 1 deletions
@@ -17,6 +17,12 @@ class Track(models.Model):
partner_biography = fields.Html(
string='Biography', compute='_compute_partner_biography',
readonly=False, store=True)
partner_function = fields.Char(
'Job Position', related='partner_id.function',
compute_sudo=True, readonly=True)
partner_company_name = fields.Char(
'Company Name', related='partner_id.parent_name',
compute_sudo=True, readonly=True)
image = fields.Image(
string="Speaker Photo", compute="_compute_speaker_image",
readonly=False, store=True,
@@ -100,6 +100,12 @@
t-options="{'widget': 'image', 'class': 'rounded-circle', 'max_width': '96'}"/>
<div class="px-3 d-flex flex-column">
<span t-field="track.partner_name" class="font-weight-bold mb-2"/>
<span class="mb-1 d-flex align-items-baseline text-break" t-if="track.partner_function">
<i class="fa fa-briefcase mr-2"/><span t-esc="track.partner_function"/>
<t t-if="track.partner_company_name">
<span>&amp;nbsp;at&amp;nbsp;</span><span t-esc="track.partner_company_name"/>
</t>
</span>
<span class="mb-1 d-flex align-items-baseline text-break" t-if="track.partner_id.website">
<i class="fa fa-home mr-2"/><a t-att-href="track.partner_id.website"><span t-field="track.partner_id.website"/></a>
</span>
@@ -183,7 +189,7 @@
<template id="event_track_aside_other_track">
<span t-esc="track_other.name" class="w-100"/>
<div class="d-flex align-items-center">
<small class="text-muted" t-esc="track_other.partner_id.name"/>
<small class="text-muted" t-esc="track_other.partner_name"/>
<div class="d-inline-block ml-auto o_wesession_track_aside_info text-truncate">
<small t-if="track_other.is_track_live and not track_other.is_track_done"
class="badge badge-danger">Live</small>