Skip to content

Commit

Permalink
dashboard: Remove mobil'emploi banners
Browse files Browse the repository at this point in the history
Revert 26da453 and 4e2abfb
  • Loading branch information
rsebille committed Aug 1, 2024
1 parent 58b569e commit c35a9f4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 92 deletions.
61 changes: 0 additions & 61 deletions itou/templates/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,67 +18,6 @@
{% block title_messages %}
{{ block.super }}

{% if show_mobilemploi_banner %}
<div class="alert alert-info alert-dismissible-once fade show d-none" role="status" id="showMobilEmploiBanner">
<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-info"></i>
</div>
<div class="col">
<p class="mb-2">
<strong>Mobil’Emploi : dernières places disponibles !</strong>
</p>
<p class="mb-0">
Vous êtes en recherche d’emploi ou de formation ?
<br>
L’équipe Mobil’Emploi vous propose un accompagnement gratuit et sur mesure.
</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-ico"
href="https://docs.google.com/forms/d/e/1FAIpQLSfTA5LAu39-hPyHBlAuVsgFn4o4IM--B0VJBqT4DhYjjhEtEw/viewform"
rel="noopener"
aria-label="Demander à l’équipe Mobil’Emploi de me rappeler"
target="_blank">
<span>Je souhaite être rappelé(e)</span>
<i class="ri-external-link-line ri-lg"></i>
</a>
</div>
</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Fermer"></button>
</div>
{% endif %}
{% if show_mobilemploi_prescriber_banner %}
<div class="alert alert-info alert-dismissible-once fade show d-none" role="status" id="showMobilEmploiPrescriberBanner">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Fermer"></button>
<div class="row">
<div class="col">
<p class="mb-2">
<strong>Mobil’Emploi : dernières places disponibles !</strong>
</p>
<p class="mb-0">
L’équipe Mobil’Emploi propose aux publics éloignés de
l’emploi, un accompagnement gratuit et sur mesure vers
l’emploi durable. Des informations collectives sont prévues
pendant tout le mois de mars.
</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-ico"
href="https://docs.google.com/forms/d/e/1FAIpQLSeljeGBgXQhc2btljFOv-OuME8bho_4EMRNuN4uOaeZQ7Hevg/viewform"
rel="noopener"
aria-label="Demander à l’équipe Mobil’Emploi de me rappeler"
target="_blank">
<span>En savoir plus</span>
<i class="ri-external-link-line ri-lg"></i>
</a>
</div>
</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Fermer"></button>
</div>
{% endif %}

{% if user.is_employer and request.current_organization and not request.current_organization.jobs.exists %}
<div class="alert alert-warning alert-dismissible show" role="status">
<p class="mb-0">
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,4 @@
from allauth.account.views import PasswordChangeView
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.contrib import auth, messages
from django.contrib.auth import REDIRECT_FIELD_NAME
Expand Down Expand Up @@ -29,7 +28,6 @@
from itou.institutions.models import Institution
from itou.job_applications.enums import JobApplicationState
from itou.openid_connect.inclusion_connect import constants as ic_constants
from itou.prescribers.enums import PrescriberOrganizationKind
from itou.prescribers.models import PrescriberOrganization
from itou.siae_evaluations.models import EvaluatedSiae, EvaluationCampaign
from itou.users.enums import MATOMO_ACCOUNT_TYPE, IdentityProvider, UserKind
Expand All @@ -48,14 +46,6 @@
from itou.www.stats import utils as stats_utils


MOBILEMPLOI_DEPARTMENTS = (
"69",
"75",
"91",
"94",
)


def _employer_dashboard_context(request):
current_org = get_current_company_or_404(request)
states_to_process = [JobApplicationState.NEW, JobApplicationState.PROCESSING]
Expand Down Expand Up @@ -152,8 +142,6 @@ def dashboard(request, template_name="dashboard/dashboard.html"):
"num_rejected_employee_records": 0,
"pending_prolongation_requests": None,
"evaluated_siae_notifications": EvaluatedSiae.objects.none(),
"show_mobilemploi_banner": False,
"show_mobilemploi_prescriber_banner": False,
"siae_suspension_text_with_dates": None,
"siae_search_form": SiaeSearchForm(),
}
Expand All @@ -171,15 +159,6 @@ def dashboard(request, template_name="dashboard/dashboard.html"):
prescriber_organization=current_org,
status=ProlongationRequestStatus.PENDING,
).count()
context["show_mobilemploi_prescriber_banner"] = (
current_org.department in MOBILEMPLOI_DEPARTMENTS
and current_org.kind
not in (
PrescriberOrganizationKind.CAP_EMPLOI,
PrescriberOrganizationKind.PE,
PrescriberOrganizationKind.ML,
)
)
elif request.user.email.endswith("pole-emploi.fr"):
messages.info(
request,
Expand Down Expand Up @@ -221,16 +200,6 @@ def dashboard(request, template_name="dashboard/dashboard.html"):
for attr in required_attributes:
if not getattr(request.user, attr):
return HttpResponseRedirect(reverse("dashboard:edit_user_info"))
active_user_job_applications_interval = [
timezone.now() - relativedelta(months=6),
timezone.now() - relativedelta(months=1),
]
context["show_mobilemploi_banner"] = (
request.user.department in MOBILEMPLOI_DEPARTMENTS
and request.user.job_applications.filter(created_at__range=active_user_job_applications_interval)
.exclude(state__in=[JobApplicationState.ACCEPTED, JobApplicationState.OBSOLETE])
.exists()
)

return render(request, template_name, context)

Expand Down

0 comments on commit c35a9f4

Please sign in to comment.