Add search field in navbar
This commit is contained in:
parent
ff5cfafd6d
commit
649af19443
3 changed files with 48 additions and 4 deletions
1
app/assets/images/icons/search-blue.svg
Normal file
1
app/assets/images/icons/search-blue.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M17 9A8 8 0 1 1 1 9a8 8 0 0 1 16 0zm-2.187 5.875l8 8" stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/><path d="M0 0h24v24H0z"/></g></svg>
|
After Width: | Height: | Size: 298 B |
|
@ -23,6 +23,40 @@
|
|||
margin-top: 17px;
|
||||
}
|
||||
|
||||
.header-right-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
|
||||
li {
|
||||
@include horizontal-padding(8px);
|
||||
|
||||
&:last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.header-search {
|
||||
position: relative;
|
||||
|
||||
.form input[type=text] {
|
||||
padding: 9px;
|
||||
padding-right: 42px;
|
||||
float: right;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 6px 9px;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
$header-login-button-height: 36px;
|
||||
$header-login-button-border-size: 1px;
|
||||
|
||||
|
@ -36,7 +70,6 @@ $header-login-button-border-size: 1px;
|
|||
border: $header-login-button-border-size solid $blue;
|
||||
color: $blue;
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
|
||||
&:hover {
|
||||
color: #FFFFFF;
|
||||
|
|
|
@ -1,7 +1,17 @@
|
|||
.new-header{ class: current_page?(root_path) ? nil : 'new-header-with-border' }
|
||||
.new-header{ class: current_page?(root_path) ? nil : "new-header-with-border" }
|
||||
.header-inner-content
|
||||
= link_to root_path do
|
||||
%img.header-logo{ src: image_url("header/logo-tps.svg") }
|
||||
|
||||
- unless request.path == new_user_session_path
|
||||
%ul.header-right-content
|
||||
- if gestionnaire_signed_in?
|
||||
%li
|
||||
.header-search
|
||||
= form_tag backoffice_dossiers_search_url, method: :get, class: "form" do
|
||||
= text_field_tag "q", "#{@search_terms unless @search_terms.nil?}", placeholder: "Rechercher"
|
||||
%button{ title: "Rechercher" }
|
||||
= image_tag "icons/search-blue.svg"
|
||||
|
||||
- elsif request.path != new_user_session_path
|
||||
%li
|
||||
= link_to "Connexion", new_user_session_path, class: "header-login-button"
|
||||
|
|
Loading…
Reference in a new issue