[IMP] event: improve views

# Purpose

- Improve the form and kanban view of event
- Improve the frontend view after posting a track

# Specifications

- The avatar is round and not square in the kanban view
- The kanban_state field is displayed on the form of an event in read_only and edit mode.
- When the user post a track he is redirect to the form page where the form is replaced by the confirmation message.

task-2198634

closes odoo/odoo#45599

Related: odoo/enterprise#8516
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Odoo's Mergebot
2020-02-26 21:26:19 +01:00
committed by GitHub
3 changed files with 66 additions and 60 deletions
+1 -1
View File
@@ -388,7 +388,7 @@
<div class="float-left"><field name="activity_ids" widget="kanban_activity"/></div>
<field name="kanban_state" widget="state_selection"/>
<t t-set="unassigned"><t t-esc="_t('Unassigned')"/></t>
<img class="oe_kanban_avatar o_event_fit_20 ml-2" t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
<img class="oe_kanban_avatar o_event_fit_20 ml-2 rounded-circle" t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
t-att-title="record.user_id.value || unassigned" t-att-alt="record.user_id.value"/>
</div>
</div>
@@ -161,4 +161,4 @@ class WebsiteEventTrackController(http.Controller):
partner = request.env['res.partner'].sudo().search([('email', '=', post['email_from'])])
if partner:
track.sudo().message_subscribe(partner_ids=partner.ids)
return request.render("website_event_track.event_track_proposal_success", {'track': track, 'event': event})
return request.render("website_event_track.event_track_proposal", {'track': track, 'event': event})
@@ -298,6 +298,8 @@
inclusion in the programme.
</p>
</section>
</div>
<div t-if="not track">
<section class="mt-5">
<h3 class="o_page_header">Application</h3>
<p>
@@ -308,70 +310,73 @@
You can add multiple speakers by separating names, emails and phones with commas.
</div>
</section>
</div>
<section id="forms" t-if="event.website_track_proposal">
<form class="mt32 js_website_submit_form" t-attf-action="/event/#{event.id}/track_proposal/post" method="post" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="track_name">Talk Title</label>
<div class="col-lg-7 col-md-8">
<input type="text" class="form-control" name="track_name" required="True"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="description">Talk Introduction</label>
<div class="col-lg-7 col-md-8">
<textarea class="form-control" name="description"/>
</div>
</div>
<div class="form-group row" t-if="len(event.allowed_track_tag_ids)">
<label class="col-lg-3 col-md-4 col-form-label" for="phone">Tags</label>
<div class="col-lg-9 col-md-8">
<div class="row">
<label class="col-md-4" t-foreach="event.allowed_track_tag_ids" t-as="tag">
<input type="checkbox" value="1" t-attf-name="tag_#{str(tag.id)}"/>
<t t-esc="tag.name"/>
</label>
<section id="forms" t-if="event.website_track_proposal">
<form class="mt32 js_website_submit_form" t-attf-action="/event/#{event.id}/track_proposal/post" method="post" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="track_name">Talk Title</label>
<div class="col-lg-7 col-md-8">
<input type="text" class="form-control" name="track_name" required="True"/>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="partner_name">Speaker(s) Name</label>
<div class="col-lg-7 col-md-8">
<input type="text" class="form-control" name="partner_name" required="True"/>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="description">Talk Introduction</label>
<div class="col-lg-7 col-md-8">
<textarea class="form-control" name="description"/>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="email_from">Speaker(s) Email</label>
<div class="col-lg-7 col-md-8">
<input type="email" class="form-control" name="email_from" required="True" multiple="multiple"/>
<div class="form-group row" t-if="len(event.allowed_track_tag_ids)">
<label class="col-lg-3 col-md-4 col-form-label" for="phone">Tags</label>
<div class="col-lg-9 col-md-8">
<div class="row">
<label class="col-md-4" t-foreach="event.allowed_track_tag_ids" t-as="tag">
<input type="checkbox" value="1" t-attf-name="tag_#{str(tag.id)}"/>
<t t-esc="tag.name"/>
</label>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="phone">Speaker(s) Phone</label>
<div class="col-lg-7 col-md-8">
<input type="text" class="form-control" name="phone" required="True"/>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="partner_name">Speaker(s) Name</label>
<div class="col-lg-7 col-md-8">
<input type="text" class="form-control" name="partner_name" required="True"/>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="biography">Speaker(s) Biography</label>
<div class="col-lg-7 col-md-8">
<textarea class="form-control" name="biography" rows="5"/>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="email_from">Speaker(s) Email</label>
<div class="col-lg-7 col-md-8">
<input type="email" class="form-control" name="email_from" required="True" multiple="multiple"/>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="image">Speaker(s) Picture</label>
<div class="col-lg-7 col-md-8">
<input name="image" type="file" accept="image/*"/>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="phone">Speaker(s) Phone</label>
<div class="col-lg-7 col-md-8">
<input type="text" class="form-control" name="phone" required="True"/>
</div>
</div>
</div>
<div class="form-group row o_form_buttons">
<div class="offset-lg-3 offset-md-4 col-md-8 col-lg-7">
<button type="submit" class="btn btn-primary">Submit Proposal</button>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="biography">Speaker(s) Biography</label>
<div class="col-lg-7 col-md-8">
<textarea class="form-control" name="biography" rows="5"/>
</div>
</div>
</div>
</form>
</section>
<div class="form-group row">
<label class="col-lg-3 col-md-4 col-form-label" for="image">Speaker(s) Picture</label>
<div class="col-lg-7 col-md-8">
<input name="image" type="file" accept="image/*"/>
</div>
</div>
<div class="form-group row o_form_buttons">
<div class="offset-lg-3 offset-md-4 col-md-8 col-lg-7">
<button type="submit" class="btn btn-primary">Submit Proposal</button>
</div>
</div>
</form>
</section>
</div>
<div t-else="">
<t t-call="website_event_track.event_track_proposal_success"/>
</div>
<div class="oe_structure" id="oe_structure_website_event_track_proposal_2"/>
</div>
<div class="col-lg-3">
@@ -414,13 +419,14 @@
</template>
<template id="event_track_proposal_success">
<t t-call="website_event.event_details">
<section class="mt-5">
<h3 class="o_page_header">Application</h3>
<p>
Thank you for your proposal.
</p><p>
We will evaluate your proposition and get back to you shortly.
</p>
</t>
</section>
</template>
<!-- Chatter templates -->