From aa8049ed2fbee47cac3d357474d7a699ec026dbd Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 21 Jan 2025 17:00:30 +0100 Subject: [PATCH 1/2] Add map top notice --- app/front_assets/components/InternshipOfferResults.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/front_assets/components/InternshipOfferResults.jsx b/app/front_assets/components/InternshipOfferResults.jsx index 84d5e8dec..45fa698ff 100644 --- a/app/front_assets/components/InternshipOfferResults.jsx +++ b/app/front_assets/components/InternshipOfferResults.jsx @@ -256,6 +256,15 @@ const InternshipOfferResults = ({ count, sectors, title, searchParams }) => { { !isMobile() && (
+
+
+
+

+ La carte affiche uniquement les 30 premiers résultats visibles sur cette page. +

+
+
+
Date: Wed, 22 Jan 2025 14:39:04 +0100 Subject: [PATCH 2/2] Update search card --- .../internship_offers_controller.rb | 5 +++- .../components/InternshipOfferCard.jsx | 24 +++++++++++++------ .../components/InternshipOfferResults.jsx | 4 ++-- app/libs/presenters/internship_offer.rb | 5 ++++ 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/app/controllers/internship_offers_controller.rb b/app/controllers/internship_offers_controller.rb index ae49a7125..da82e66e3 100644 --- a/app/controllers/internship_offers_controller.rb +++ b/app/controllers/internship_offers_controller.rb @@ -179,7 +179,10 @@ def format_internship_offers(internship_offers) is_favorite: !!current_user && internship_offer.is_favorite?(current_user), logged_in: !!current_user, can_manage_favorite: can?(:create, Favorite), - can_read_employer_name: can?(:read_employer_name, internship_offer) + can_read_employer_name: can?(:read_employer_name, internship_offer), + fits_for_seconde: internship_offer.fits_for_seconde?, + fits_for_troisieme_or_quatrieme: internship_offer.fits_for_troisieme_or_quatrieme?, + available_weeks_count: internship_offer.presenter.available_weeks_count } end end diff --git a/app/front_assets/components/InternshipOfferCard.jsx b/app/front_assets/components/InternshipOfferCard.jsx index b53f290f4..ebab619a8 100644 --- a/app/front_assets/components/InternshipOfferCard.jsx +++ b/app/front_assets/components/InternshipOfferCard.jsx @@ -81,15 +81,25 @@ const InternshipOfferCard = ({
  • - 1 semaine disponible + {internshipOffer.available_weeks_count}
  • -
  • -
    4ème
    -
  • -
  • -
    3ème
    -
  • + + {internshipOffer.fits_for_seconde && ( +
  • +
    2de
    +
  • + )} + {internshipOffer.fits_for_troisieme_or_quatrieme && ( + <> +
  • +
    3ème
    +
  • +
  • +
    4ème
    +
  • + + )} { internshipOffer.logged_in && internshipOffer.can_manage_favorite && {
    ) } { !isLoading && (internshipOffersSeats == 0) && - (

    Aucune offre répondant à vos critères n’est disponible.
    Vous pouvez modifier vos filtres et relancer votre recherche.

    ) + (

    Aucune offre répondant à vos critères n'est disponible.
    Vous pouvez modifier vos filtres et relancer votre recherche.

    ) }
    { @@ -268,7 +268,7 @@ const InternshipOfferResults = ({ count, sectors, title, searchParams }) => { { diff --git a/app/libs/presenters/internship_offer.rb b/app/libs/presenters/internship_offer.rb index 6c4acf097..ef99e5f61 100644 --- a/app/libs/presenters/internship_offer.rb +++ b/app/libs/presenters/internship_offer.rb @@ -72,6 +72,11 @@ def weeks_description end end + def available_weeks_count + count = internship_offer.weeks.count + "#{count} #{'semaine'.pluralize(count)} #{'disponible'.pluralize(count)}" + end + private attr_reader :internship_offer