diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 48dc56f3d..c69c4d1d1 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -219,7 +219,7 @@ module Users end def recherche - @dossier_id = params[:dossier_id] + @dossier_id = params[:q] dossier = current_user.dossiers.find_by(id: @dossier_id) if dossier diff --git a/app/views/layouts/_new_header.haml b/app/views/layouts/_new_header.haml index 034c40bb9..26d7018a5 100644 --- a/app/views/layouts/_new_header.haml +++ b/app/views/layouts/_new_header.haml @@ -47,16 +47,17 @@ %li .header-search{ role: 'search' } = form_tag instructeur_recherche_path, method: :get, class: "form" do + = label_tag :dossier_id, "Numéro de dossier", class: 'hidden' = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: "Rechercher un dossier" %button{ title: "Rechercher" } - = image_tag "icons/search-blue.svg", alt: '' + = image_tag "icons/search-blue.svg", alt: 'Rechercher', 'aria-hidden':'true' - if nav_bar_profile == :user && user_signed_in? && current_user.dossiers.count > 2 %li .header-search{ role: 'search' } - = form_tag recherche_dossiers_path, method: :post, class: "form" do + = form_tag recherche_dossiers_path, method: :get, class: "form" do = label_tag :dossier_id, "Numéro de dossier", class: 'hidden' - = text_field_tag :dossier_id, "", placeholder: "Numéro de dossier" + = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: "Rechercher un dossier" %button{ title: "Rechercher" } = image_tag "icons/search-blue.svg", alt: 'Rechercher', 'aria-hidden':'true' diff --git a/config/routes.rb b/config/routes.rb index 4081570cb..de1a86dd1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -275,7 +275,7 @@ Rails.application.routes.draw do end collection do - post 'recherche' + get 'recherche' end end resource :feedback, only: [:create]