Skip to content

Commit

Permalink
Utilisation de boutons DSFR dans le déplacement de RDV (#4941)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineGirard authored Jan 7, 2025
1 parent 1564935 commit b115b6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/views/search/_creneaux.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ div id="creneaux-lieu-#{lieu&.id}"
- if date_range.begin > Time.zone.today
.col-12.col-md-auto.mb-2.mb-md-0.d-flex.align-items-center.justify-content-center
= link_to "", prendre_rdv_path(query_params.merge(date: previous_from_date)), class: "fr-btn fr-icon-arrow-left-s-line fr-hidden fr-unhidden-md", aria: { label: "Semaine précédente" }
= link_to "sem. précédente", prendre_rdv_path(query_params.merge(date: previous_from_date)), class: "fr-btn fr-btn--icon-left fr-icon-arrow-left-s-line fr-hidden-md fr-hidden-lg", aria: { label: "Semaine précédente" }
= link_to "sem. précédente", prendre_rdv_path(query_params.merge(date: previous_from_date)), class: "fr-btn fr-btn--icon-left fr-icon-arrow-left-s-line fr-hidden-md", aria: { label: "Semaine précédente" }

.col
.row
Expand Down Expand Up @@ -43,4 +43,4 @@ div id="creneaux-lieu-#{lieu&.id}"
- if params[:date].blank? || !context.after_max_public_booking_delay?(params[:date].to_date + 6.days)
.col-12.col-md-auto.mt-2.mt-md-0.d-flex.align-items-center.justify-content-center
= link_to "", prendre_rdv_path(query_params.merge(date: date_range.end + 1.day)), class: "fr-btn fr-icon-arrow-right-s-line fr-hidden fr-unhidden-md", aria: { label: "semaine suivante"}
= link_to "sem. prochaine", prendre_rdv_path(query_params.merge(date: date_range.end + 1.day)), class: "fr-btn fr-btn--icon-right fr-icon-arrow-right-s-line fr-hidden-md fr-hidden-lg", aria: { label: "semaine suivante"}
= link_to "sem. prochaine", prendre_rdv_path(query_params.merge(date: date_range.end + 1.day)), class: "fr-btn fr-btn--icon-right fr-icon-arrow-right-s-line fr-hidden-md", aria: { label: "semaine suivante"}
25 changes: 13 additions & 12 deletions app/views/users/rdvs/_creneaux.html.slim
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
- if @all_creneaux.blank?
.bg-info.rdv-color-white.p-2.mb-3 Malheureusement, tous les créneaux sont pris. Vous recevrez d'autres propositions si un créneau se libère. La date de votre RDV reste le #{I18n.l(@rdv.starts_at, format: :human)}.
.py-4.border-bottom.rdv-text-align-center
= link_to "Retour au RDV", users_rdv_path(@rdv), class: "btn btn-primary"
= link_to "Retour au RDV", users_rdv_path(@rdv), class: "fr-btn"
- else
.card
.card-body
.row
- previous_from_date = @date_range.begin - 7.days
- if @date_range.begin > Time.zone.today
.col-12.col-md-auto.mb-2.mb-md-0.d-flex.align-items-center.justify-content-center
= link_to creneaux_users_rdv_path(@rdv, date: previous_from_date), remote: true, class: "btn btn-primary", data: { disable_with: "..." } do
i.fa.fa-chevron-left
span.d-md-none.ml-1<
| sem. précédente
= link_to "", creneaux_users_rdv_path(@rdv, date: previous_from_date), class: "fr-btn fr-icon-arrow-left-s-line fr-hidden fr-unhidden-md", aria: { label: "Semaine précédente" }
= link_to "sem. précédente", creneaux_users_rdv_path(@rdv, date: previous_from_date), class: "fr-btn fr-btn--icon-left fr-icon-arrow-left-s-line fr-hidden-md", aria: { label: "Semaine précédente" }

.col
.row
Expand All @@ -24,16 +22,19 @@
= l(date, format: "%d %b")
- creneaux_for_date = @creneaux.group_by { |c| c.starts_at.to_date }.select { |k, v| k == date }

- creneaux_for_date.each_value do |creneaux|
- creneaux.sort.each do |creneau|
= link_to l(creneau.starts_at, format: "%H:%M"), edit_users_rdv_path(@rdv, starts_at: creneau.starts_at, agent_id: creneau.agent.id), class: "btn btn-light mr-1 mb-1 w-100"
- if creneaux_for_date.any?
.fr-grid-row
- creneaux_for_date.each_value do |creneaux|
- creneaux.sort.each do |creneau|
= link_to l(creneau.starts_at, format: "%H:%M"), edit_users_rdv_path(@rdv, starts_at: creneau.starts_at, agent_id: creneau.agent.id), class: "fr-col-12 fr-btn fr-btn--tertiary fr-mb-1w rdv-justify-content-center"
- else
p.rdv-text-align-center.fr-text--sm
| Pas de créneau disponible

- if @date_range.end < @all_creneaux.last.starts_at.to_date
.col-12.col-md-auto.mt-2.mt-md-0.d-flex.align-items-center.justify-content-center
= link_to creneaux_users_rdv_path(@rdv, date: @date_range.end + 1.day), remote: true, class: "btn btn-primary", data: { disable_with: "..." } do
span.d-md-none.mr-1
| sem. prochaine
i.fa.fa-chevron-right
= link_to "", creneaux_users_rdv_path(@rdv, date: @date_range.end + 1.day), class: "fr-btn fr-icon-arrow-right-s-line fr-hidden fr-unhidden-md", aria: { label: "semaine suivante"}
= link_to "sem. prochaine", creneaux_users_rdv_path(@rdv, date: @date_range.end + 1.day), class: "fr-btn fr-btn--icon-right fr-icon-arrow-right-s-line fr-hidden-md", aria: { label: "semaine suivante"}

.row
.col.pt-4
Expand Down

0 comments on commit b115b6c

Please sign in to comment.