Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refonte homepage pour mise en valeur recherche et Call To Actions #776

Merged
merged 11 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<html><head></head><body><div class="container-fluid" id="subforums_area">

<div class="c-box">
<div class="container-fluid d-flex justify-content-center mb-3">Afficher les fiches contenant l'étiquette</div>
<div class="container-fluid d-flex justify-content-center">
<div class="text-center mb-3">Afficher les fiches contenant l'étiquette</div>
<div class="text-center tag-group">



Expand Down Expand Up @@ -66,8 +66,8 @@
<html><head></head><body><div class="container-fluid" id="subforums_area">

<div class="c-box">
<div class="container-fluid d-flex justify-content-center mb-3">Afficher les fiches contenant l'étiquette</div>
<div class="container-fluid d-flex justify-content-center">
<div class="text-center mb-3">Afficher les fiches contenant l'étiquette</div>
<div class="text-center tag-group">



Expand Down Expand Up @@ -97,8 +97,8 @@
<html><head></head><body><div class="container-fluid" id="subforums_area">

<div class="c-box">
<div class="container-fluid d-flex justify-content-center mb-3">Afficher les fiches contenant l'étiquette</div>
<div class="container-fluid d-flex justify-content-center">
<div class="text-center mb-3">Afficher les fiches contenant l'étiquette</div>
<div class="text-center tag-group">



Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/forum/tests/__snapshots__/tests_views.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@
<div class="container-fluid" id="subforums_area">

<div class="c-box">
<div class="container-fluid d-flex justify-content-center mb-3">Afficher les fiches contenant l'étiquette</div>
<div class="container-fluid d-flex justify-content-center">
<div class="text-center mb-3">Afficher les fiches contenant l'étiquette</div>
<div class="text-center tag-group">



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,7 @@
<div class="col-12 mb-5">
<p class="h2">Quelle est ma situation ?</p>
</div>
<div class="col-12 col-md-6 mb-3">
<div class="card c-card h-100">
<div class="card-header">
<h3 class="h4">Je suis à la recherche d'un emploi</h3>
</div>
<div class="card-body pb-0">
<p>Je recherche des offres d'emploi ou des entreprises près de chez moi</p>
</div>
<div class="card-footer text-center mt-3">
<button class="btn btn-primary matomo-event" data-bs-target="#rechercheEmploi" data-bs-toggle="modal" data-matomo-action="topic-create-check" data-matomo-category="engagement" data-matomo-option="itou-jobseeker" type="button">J'accède aux emplois de l'inclusion</button>
</div>
</div>
</div>
<div class="col-12 col-md-6 mb-3">
<div class="col-12 col-md-4 mb-3">
<div class="card c-card h-100">
<div class="card-header">
<h3 class="h4">J'utilise le site des emplois de l'inclusion</h3>
Expand All @@ -92,7 +79,7 @@
</div>
</div>
</div>
<div class="col-12 col-md-6 mb-3">
<div class="col-12 col-md-4 mb-3">
<div class="card c-card h-100">
<div class="card-header">
<h3 class="h4">J'accueille des personnes en PMSMP</h3>
Expand All @@ -109,7 +96,7 @@
</div>
</div>
</div>
<div class="col-12 col-md-6 mb-3">
<div class="col-12 col-md-4 mb-3">
<div class="card c-card h-100">
<div class="card-header">
<h3 class="h4">Je suis un/une professionnel/le de l'insertion, en formation ou en activité</h3>
Expand All @@ -125,54 +112,6 @@
</div>
</div>
</div>
<div aria-hidden="true" aria-labelledby="rechercheEmploiMiniLabel" class="modal modal--mini fade" id="rechercheEmploi" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="rechercheEmploiLabel">
Vous recherchez un emploi à temps plein, à temps partiel ou en interim ?
</h3>
<button aria-label="Fermer" class="btn-close" data-bs-dismiss="modal" type="button"></button>
</div>
<div class="modal-body home-content-body">
<p class="mb-4">
Ce ne sera pas long !
<br/>
Inscrivez-vous et accédez à toutes les fonctionnalités du site des emplois de l'inclusion.
</p>
<ul class="mb-5">
<li class="d-flex mb-2">
<span>
<i class="text-success ri-checkbox-circle-fill"></i>
</span>
<span class="font-weight-bold ml-2">Créer votre espace candidat</span>
</li>
<li class="d-flex mb-2">
<span>
<i class="text-success ri-checkbox-circle-fill"></i>
</span>
<span class="font-weight-bold ml-2">Rechercher les offres d'emploi à proximité de votre ville</span>
</li>
<li class="d-flex mb-2">
<span>
<i class="text-success ri-checkbox-circle-fill"></i>
</span>
<span class="font-weight-bold ml-2">Candidatez aux offres !</span>
</li>
<li class="d-flex mb-2">
<span>
<i class="text-success ri-checkbox-circle-fill"></i>
</span>
<span class="font-weight-bold ml-2">N'oubliez pas de faire valider votre élégibilité par votre conseiller France Travail.</span>
</li>
</ul>
<p class="text-center">
<a class="btn btn-lg btn-primary" href="https://emplois.inclusion.beta.gouv.fr/signup/job_seeker/situation">Je crée mon espace candidat sur le site des emplois</a>
</p>
</div>
</div>
</div>
</div>

</div>
</section>
Expand Down
5 changes: 1 addition & 4 deletions lacommunaute/pages/tests/__snapshots__/test_homepage.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
<div class="s-footer-quick__col col-12 col-lg-auto">
<strong>Réseaux sociaux</strong>
<ul>
<li>
<a aria-label="La plateforme de l'inclusion sur X (lien externe)" href="https://x.com/inclusion_gouv" target="_blank"><i aria-hidden="true" class="ri-twitter-x-fill text-dark ri-sm"></i> X</a>
</li>
<li>
<a aria-label="La plateforme de l'inclusion sur sur Linkedin (lien externe)" href="https://www.linkedin.com/company/inclusion-gouv/" target="_blank"><i aria-hidden="true" class="ri-linkedin-box-fill text-dark"></i> LinkedIn</a>
</li>
Expand Down Expand Up @@ -155,7 +152,7 @@
<div class="s-header__col s-header__col--nav col d-none d-lg-inline-flex d-lg-flex align-items-center justify-content-end pe-0 pe-xl-3">
<nav aria-label="Navigation principale" id="nav-primary" role="navigation">
<ul>
<li>
<li id="header_search_form">
<form action="/search/" name="header_search_form">
<div class="input-group input-group-rounded-pill">
<input aria-label="Chercher dans la communauté" class="form-control w-300px" name="q" placeholder="Chercher dans la communauté" type="search"/>
Expand Down
26 changes: 1 addition & 25 deletions lacommunaute/pages/tests/test_homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from lacommunaute.event.factories import EventFactory
from lacommunaute.forum.factories import ForumFactory
from lacommunaute.forum_conversation.factories import PostFactory, TopicFactory
from lacommunaute.utils.testing import parse_response_to_soup


Expand All @@ -17,38 +16,15 @@ def _sub_svg_suffix(content):


def test_context_data(client, db):
topic = TopicFactory(with_post=True, forum=ForumFactory())
article = ForumFactory(parent=ForumFactory(type=1))

disapproved_topic = TopicFactory(with_post=True, forum=ForumFactory())
disapproved_topic.approved = False
disapproved_topic.save()

url = reverse("pages:home")

response = client.get(url)
assert response.status_code == 200

assert response.context_data["topics_public"].get() == topic
assert response.context_data["forums_category"].get() == article


def test_new_topics_order(client, db):
topic1 = TopicFactory(with_post=True, forum=ForumFactory())
topic2 = TopicFactory(with_post=True, forum=ForumFactory())
url = reverse("pages:home")

response = client.get(url)
assert response.status_code == 200
assert list(response.context_data["topics_public"]) == [topic2, topic1]

PostFactory(topic=topic1)

response = client.get(url)
assert response.status_code == 200
assert list(response.context_data["topics_public"]) == [topic2, topic1]


def test_page_title_header_footer(db, client, snapshot):
response = client.get(reverse("pages:home"))
assert response.status_code == 200
Expand All @@ -67,7 +43,7 @@ def test_events(db, client):
visible_future_event = EventFactory.create_batch(4, date=timezone.now() + relativedelta(days=1))
unvisible_future_event = EventFactory(date=timezone.now() + relativedelta(days=1))
response = client.get(reverse("pages:home"))
assertContains(response, "Les évènements à venir", count=1)
assertContains(response, "Les prochains évènements", count=1)
assertNotContains(response, old_event.name)
for future_event in visible_future_event:
assertContains(response, future_event.name)
Expand Down
2 changes: 0 additions & 2 deletions lacommunaute/pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from lacommunaute.event.models import Event
from lacommunaute.forum.models import Forum
from lacommunaute.forum_conversation.models import Topic


logger = logging.getLogger(__name__)
Expand All @@ -26,7 +25,6 @@ class HomeView(TemplateView):

def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
context = super().get_context_data(**kwargs)
context["topics_public"] = Topic.objects.filter(approved=True).order_by("-created")[:4]
context["forums_category"] = Forum.objects.filter(parent__type=1).order_by("-updated")[:4]
context["forum"] = Forum.objects.get_main_forum()
context["upcoming_events"] = Event.objects.filter(date__gte=timezone.now()).order_by("date")[:4]
Expand Down
Binary file removed lacommunaute/static/images/APPRENDRE.png
Binary file not shown.
Binary file removed lacommunaute/static/images/DEMANDER.png
Binary file not shown.
Binary file added lacommunaute/static/images/Microphone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lacommunaute/static/images/SINFORMER.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lacommunaute/static/images/home-illu-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading