extract layouts/search_dossiers_form partial

This commit is contained in:
clemkeirua 2020-04-03 15:09:57 +02:00
parent 34188c432c
commit 9eafeac622
2 changed files with 8 additions and 12 deletions

View file

@ -45,21 +45,11 @@
%ul.header-right-content
- if nav_bar_profile == :instructeur && instructeur_signed_in?
%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: 'Rechercher', 'aria-hidden':'true'
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: instructeur_recherche_path }
- if nav_bar_profile == :user && user_signed_in? && current_user.dossiers.count > 2
%li
.header-search{ role: 'search' }
= form_tag recherche_dossiers_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: 'Rechercher', 'aria-hidden':'true'
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_dossiers_path }
- if instructeur_signed_in? || user_signed_in?
%li

View file

@ -0,0 +1,6 @@
.header-search{ role: 'search' }
= form_tag "#{search_endpoint}", method: :get, class: "form" do
= label_tag :q, "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: 'Rechercher', 'aria-hidden':'true'