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