Skip to content

Commit

Permalink
www.dashboard: Remove expired webinar banners
Browse files Browse the repository at this point in the history
  • Loading branch information
rsebille committed Jul 18, 2024
1 parent 2c767d5 commit 929a897
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
20 changes: 0 additions & 20 deletions itou/templates/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,6 @@ <h2>Statistiques</h2>
<div class="c-banner c-banner--pilotage rounded-3 p-3 py-md-5 mt-3 mt-md-4 mb-3 mb-md-5">
<img src="{% static_theme_images 'logo-pilotage-inclusion.svg' %}" height="80" alt="Le pilotage de l'inclusion">
</div>

{% for banner in pilotage_webinar_banners %}
<div class="alert alert-important alert-dismissible fade show" role="status">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Fermer"></button>
<div class="row">
<div class="col-auto pe-0">
<i class="ri-information-line ri-xl text-important" aria-hidden="true"></i>
</div>
<div class="col">
<p class="mb-2">
<strong>{{ banner.title }}</strong>
</p>
<p class="mb-0">{{ banner.description }}</p>
</div>
<div class="col-12 col-md-auto mt-3 mt-md-0 d-flex align-items-center justify-content-center">
<a class="btn btn-sm btn-primary btn-block btn-ico" href="{{ banner.url }}" target="_blank" rel="noopener"><span>Je m’inscris</span> <i class="ri-external-link-line font-weight-medium" aria-hidden="true"></i></a>
</div>
</div>
</div>
{% endfor %}
<div class="row row-cols-1 row-cols-md-2 mt-3 mt-md-4">
{% if can_view_stats_dashboard_widget %}
{% include "dashboard/includes/stats.html" %}
Expand Down
31 changes: 0 additions & 31 deletions itou/www/dashboard/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import datetime

from allauth.account.views import PasswordChangeView
from dateutil.relativedelta import relativedelta
from django.conf import settings
Expand Down Expand Up @@ -162,37 +160,12 @@ def dashboard(request, template_name="dashboard/dashboard.html"):
"show_mobilemploi_prescriber_banner": False,
"siae_suspension_text_with_dates": None,
"siae_search_form": SiaeSearchForm(),
"pilotage_webinar_banners": [],
}

if request.user.is_employer:
context.update(_employer_dashboard_context(request))
elif request.user.is_prescriber:
if current_org := request.current_organization:
if stats_utils.can_view_stats_ph(request):
if current_org.kind in [PrescriberOrganizationKind.ML, PrescriberOrganizationKind.CAP_EMPLOI]:
context["pilotage_webinar_banners"].append(
{
"title": "Inscrivez-vous à un webinaire pour découvrir votre tout nouveau tableau de bord !", # noqa: E501
"description": "En juin, deux sessions vous sont proposées pour vous familiariser avec votre nouvel outil de suivi et d'analyse des résultats de vos prescriptions.", # noqa: E501
"url": "https://app.livestorm.co/itou/le-pilotage-de-linclusion-professionnels-missions-locales-et-cap-emploi-decouvrez-votre-nouveau-tableau-de-bord-personnalise-et-faites-le-point-sur-vos-prescriptions?type=detailed", # noqa: E501
"is_displayable": lambda: timezone.localdate() <= datetime.date(2024, 6, 11),
}
)
elif current_org.kind in [
PrescriberOrganizationKind.CHRS,
PrescriberOrganizationKind.CHU,
PrescriberOrganizationKind.OIL,
PrescriberOrganizationKind.RS_FJT,
]:
context["pilotage_webinar_banners"].append(
{
"title": "Inscrivez-vous à un webinaire pour découvrir votre tout nouveau tableau de bord !", # noqa: E501
"description": "En juin, deux sessions vous sont proposées pour vous familiariser avec votre nouvel outil de suivi et d'analyse des résultats de vos prescriptions.", # noqa: E501
"url": "https://app.livestorm.co/itou/le-pilotage-de-linclusion-prescripteurs-de-laccueil-de-lhebergement-et-de-linsertion-decouvrez-votre-nouveau-tableau-de-bord-personnalise-et-faites-le-point-sur-vos-prescriptions?type=detailed", # noqa: E501
"is_displayable": lambda: timezone.localdate() <= datetime.date(2024, 6, 13),
}
)
if current_org.is_authorized:
context["can_view_gps_card"] = True
context["pending_prolongation_requests"] = ProlongationRequest.objects.filter(
Expand Down Expand Up @@ -260,10 +233,6 @@ def dashboard(request, template_name="dashboard/dashboard.html"):
.exists()
)

context["pilotage_webinar_banners"] = [
banner for banner in context["pilotage_webinar_banners"] if banner["is_displayable"]()
]

return render(request, template_name, context)


Expand Down

0 comments on commit 929a897

Please sign in to comment.