[IMP] website_event_track: improves ui for unpublished event_tracks

Unpublished tag not shown if track is not accepted, although track is not
published. Unpublished tracks was also visible for portal user. opacity
was not available on tracks, even track is unpublished.

unpublished tag added into event agenda next to 'not accepted', also
added blurry effect and unpublished tag into agenda which is
shows in details page. used normal text in place of badge for
unpublished track, because that red badge is already used by live
tag. Onwards now, unpublished track will not show to portal user.

TaskID - 2346612
This commit is contained in:
Sunil Shrimali
2021-07-06 04:44:46 +00:00
committed by Dharmraj Jhala
parent a3f6bf9cf1
commit 7ff89c188c
4 changed files with 16 additions and 6 deletions
@@ -96,7 +96,7 @@ class EventTrackController(http.Controller):
now_tz = utc.localize(fields.Datetime.now().replace(microsecond=0), is_dst=False).astimezone(timezone(event.date_tz))
today_tz = now_tz.date()
event = event.with_context(tz=event.date_tz or 'UTC')
tracks_sudo = event.env['event.track'].sudo().search(search_domain, order='date asc')
tracks_sudo = event.env['event.track'].sudo().search(search_domain, order='is_published desc, date asc')
tag_categories = request.env['event.track.tag.category'].sudo().search([])
# filter on wishlist (as post processing due to costly search on is_reminder_on)
@@ -134,6 +134,11 @@
> div {
padding: 0.3em;
}
// For unpublished tracks, opacity is already reduced
[data-publish='off'] .o_weagenda_track_badges > .o_wevent_online_badge_unpublished {
opacity: unset;
}
}
// Remove me in master
@@ -156,16 +156,16 @@
</template>
<template id="agenda_main_track" name="Track Agenda: Track">
<div class="d-flex flex-column h-100">
<div class="d-flex flex-column h-100" t-att-data-publish="track.website_published and 'on' or 'off'">
<div class="d-flex justify-content-end flex-wrap-reverse align-items-center o_weagenda_track_badges">
<small t-if="track.is_track_live and not track.is_track_done and track.website_published"
class="mx-1 badge badge-danger rounded-sm">Live
</small>
<small t-if="not track.website_published and is_event_user and track.stage_id.is_accepted"
<small t-if="not track.website_published and is_event_user"
title="Unpublished"
class="ml-1 badge badge-danger o_wevent_online_badge_unpublished rounded-sm">Unpublished</small>
class="ml-1 mt-1 mt-md-0 badge badge-danger o_wevent_online_badge_unpublished">Unpublished</small>
<small t-if="not track.stage_id.is_accepted" title="Not Accepted"
class="ml-1 badge badge-danger o_wevent_online_badge_unpublished rounded-sm">Not Accepted</small>
class="ml-1 mt-1 mt-md-0 badge badge-danger o_wevent_online_badge_unpublished">Not Accepted</small>
<span t-if="option_track_wishlist">
<t t-call="website_event_track.track_widget_reminder">
<t t-set="reminder_light" t-value="True"/>
@@ -174,12 +174,15 @@
<ul class="list-unstyled mb-0">
<li t-foreach="tracks_other" t-as="track_other" class="w-100">
<a t-if="is_event_user or track_other.is_published"
t-att-data-publish="track_other.website_published and 'on' or 'off'"
class="d-block w-100 h-100 px-2 pt-2 pb-1 text-decoration-none"
t-att-href="track_other.website_url">
<t t-call="website_event_track.event_track_aside_other_track"/>
</a>
<div t-else="" class="text-muted px-2 pt-2 pb-1">
<t t-call="website_event_track.event_track_aside_other_track"/>
<div t-att-data-publish="track_other.website_published and 'on' or 'off'">
<t t-call="website_event_track.event_track_aside_other_track"/>
</div>
</div>
</li>
</ul>
@@ -194,6 +197,8 @@
<div class="d-flex align-items-center">
<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="not track_other.website_published and user_event_manager"
class="badge badge-danger">Unpublished</small>
<small t-if="track_other.is_track_live and not track_other.is_track_done"
class="badge badge-danger">Live</small>
<small t-elif="track_other.is_track_done"