[ADD] website_event_meet_quiz: integrate quiz within meet "Community" page
RATIONALE Events are sometimes held online, gathering a community. In this merge we improve Event application to better support full-online events with improved tracks, wishlists, chat rooms, ... PURPOSE This bridge module enables a better integration of the quiz features within the website_event_meet "Community" frontend page. SPECS As both quiz and meet share the "Community" frontend page, this bridge adds a small block on the existing meet template to display the top 3 of the quiz leaderboard. A link on that block allows users to reach the full leaderboard page where they can see their own position and perform a simple search for other attendees. LINKS Task ID-2252655 (Main Online Event task) Task ID-2283771 (Quizzes on Talks, Leaderboard) Task ID-2283742 (Community gathering on chat rooms) Co-Authored-By: Aurélien Warnon <awa@odoo.com> Co-Authored-By: David Beguin <dbe@odoo.com> Co-Authored-By: Quentin Mourier <qmo@odoo.com> Co-Authored-By: Stéphane Debauche <std@odoo.com> Co-Authored-By: Thibault Delavallée <tde@odoo.com>
This commit is contained in:
committed by
Thibault Delavallée
co-authored by
Aurélien Warnon
David Beguin
Stéphane Debauche
Thibault Delavallée
parent
92caab1901
commit
10e162d3f1
@@ -1,2 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import controllers
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
'website_event_track_quiz',
|
||||
],
|
||||
'data': [
|
||||
'views/event_meet_templates.xml',
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import community
|
||||
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import http
|
||||
|
||||
from odoo.addons.website_event_track_online.controllers.community import WebsiteEventCommunityController
|
||||
from odoo.http import request
|
||||
from werkzeug.exceptions import Forbidden
|
||||
|
||||
|
||||
class WebsiteEventTrackQuizMeetController(WebsiteEventCommunityController):
|
||||
|
||||
@http.route(['/event/<model("event.event"):event>/community'], type='http', auth="public", website=True, sitemap=False)
|
||||
def community(self, event, page=1, lang=None, **kwargs):
|
||||
if not event.can_access_from_current_website():
|
||||
raise Forbidden()
|
||||
|
||||
# website_event_track_quiz
|
||||
values = self._get_community_leaderboard_render_values(event, kwargs.get('search'), page)
|
||||
|
||||
# website_event_meet
|
||||
values.update(self._event_meeting_rooms_get_values(event, lang=lang))
|
||||
return request.render('website_event_meet.event_meet', values)
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="community_aside" name="Community: Aside (Leaderboard)"
|
||||
inherit_id="website_event_meet.community_aside">
|
||||
<xpath expr="//div[hasclass('o_wevent_community_aside')]" position="inside">
|
||||
<t t-if="top3_visitors" t-call="website_event_meet_quiz.community_leaderboard_small"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="community_leaderboard_small" name="Small Leaderboard">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="w-100 d-flex justify-content-between align-items-end o_page_header">
|
||||
<h1 class="m-0">Leaderboard</h1>
|
||||
<a t-attf-href="#{'/event/%s/community/leaderboard' % (slug(event))}">View all</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<t t-foreach="top3_visitors" t-as="visitor">
|
||||
<t t-call="website_event_meet_quiz.visitor_quiz_points_card"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id='visitor_quiz_points_card' name="User Quick Quiz Points Card">
|
||||
<div class="d-flex mb-3 align-items-center justify-content-between">
|
||||
<div class="d-flex align-items-center">
|
||||
<b class="mr-2 text-muted" t-esc="visitor['position']"/>
|
||||
<img class="rounded-circle float-left"
|
||||
style="width: 32px; height: 32px; object-fit: cover;"
|
||||
t-att-src="image_data_uri(visitor['visitor'].partner_image) if visitor['visitor'].partner_image else '/web/static/src/img/user_placeholder.jpg'"
|
||||
t-att-alt="visitor['visitor'].display_name"/>
|
||||
<div style="line-height:1.3">
|
||||
<span class="font-weight-bold" t-esc="visitor['visitor'].display_name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
<span><t t-esc="visitor['points']"/> Points</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user