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.

    ) } { @@ -256,10 +256,19 @@ const InternshipOfferResults = ({ count, sectors, title, searchParams }) => { { !isMobile() && (
    +
    +
    +
    +

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

    +
    +
    +
    { 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