From 5c6eb69c43f6b9af829c6fc1c233e41b7b533bd9 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Thu, 19 Sep 2024 11:55:43 +0200 Subject: [PATCH] Remove .fr-grid-row.fr-grid-row--gutters when empty --- app/views/users/dossiers/index.html.haml | 29 ++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index fe0090150..e6c596c19 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -7,20 +7,21 @@ .fr-container %h1.page-title.fr-h2= t('views.users.dossiers.index.dossiers') - .fr-grid-row.fr-grid-row--gutters - - if current_user.dossiers.count > 2 || current_user.dossiers_invites.count > 2 - .fr-col - #search-2.fr-search-bar - = form_tag dossiers_path, method: :get, :role => "search", class: "width-100 fr-mb-5w" do - = hidden_field_tag :procedure_id, params[:procedure_id] - = label_tag "q", t('views.users.dossiers.search.label'), class: 'fr-label fr-mb-1w' - .flex - = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.prompt'), class: "fr-input" - %button.fr-btn.fr-btn--sm - = t('views.users.dossiers.search.label') - - if @procedures_for_select.size > 1 - .fr-col - = render Dossiers::UserProcedureFilterComponent.new(procedures_for_select: @procedures_for_select) + - if current_user.dossiers.count > 2 || current_user.dossiers_invites.count > 2 || @procedures_for_select.size > 1 + .fr-grid-row.fr-grid-row--gutters + - if current_user.dossiers.count > 2 || current_user.dossiers_invites.count > 2 + .fr-col.fr-mb-5w + #search-2.fr-search-bar + = form_tag dossiers_path, method: :get, :role => "search", class: "width-100" do + = hidden_field_tag :procedure_id, params[:procedure_id] + = label_tag "q", t('views.users.dossiers.search.label'), class: 'fr-label fr-mb-1w' + .flex + = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.prompt'), class: "fr-input" + %button.fr-btn.fr-btn--sm + = t('views.users.dossiers.search.label') + - if @procedures_for_select.size > 1 + .fr-col.fr-mb-5w + = render Dossiers::UserProcedureFilterComponent.new(procedures_for_select: @procedures_for_select) - if @search_terms.blank? - cache([I18n.locale, current_user.id, @statut, current_user.dossiers, current_user.dossiers_invites], expires_in: 1.hour) do