From ba0af22c507a41aa7bf7a71ae73fa8cf50f425cf Mon Sep 17 00:00:00 2001
From: echarp <manu@echarp.org>
Date: Sun, 4 Aug 2019 22:29:54 +0200
Subject: [PATCH] Organisation search form is moved back in the header, nearby
 the "search more" link

---
 app/assets/stylesheets/orgas.sass | 9 ++++-----
 app/assets/stylesheets/pages.sass | 1 -
 app/views/events/index.html.haml  | 2 --
 app/views/pages/_search.haml      | 7 +++++--
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/app/assets/stylesheets/orgas.sass b/app/assets/stylesheets/orgas.sass
index a7a5b3a47..ba2eb1436 100644
--- a/app/assets/stylesheets/orgas.sass
+++ b/app/assets/stylesheets/orgas.sass
@@ -4,9 +4,7 @@ img.favicon
   vertical-align: middle
 
 form#orga_search
-  font-size: larger
-  margin-top: 0.2em
-  margin-bottom: 1em
+  display: inline
   label
     display: none
   em.fa
@@ -15,8 +13,8 @@ form#orga_search
     width: 14em
     border: solid thin #258
     padding: 0
-    margin-left: -1.7em
-    margin-right: -1.3em
+    margin-left: -1.8em
+    margin-right: -1.6em
     padding-left: 1.5em
     padding-right: 1.2em
     border-radius: 0.4em
@@ -28,6 +26,7 @@ form#orga_search
     box-shadow: none
     margin-top: -0.1em
     margin-left: 0
+    margin-right: 1em
     vertical-align: middle
     background-color: transparent
     &:hover em.fa
diff --git a/app/assets/stylesheets/pages.sass b/app/assets/stylesheets/pages.sass
index 66c103915..95a84e836 100644
--- a/app/assets/stylesheets/pages.sass
+++ b/app/assets/stylesheets/pages.sass
@@ -4,4 +4,3 @@ body.pages main
 
 .digest
   float: right
-  font-size: smaller
diff --git a/app/views/events/index.html.haml b/app/views/events/index.html.haml
index 9875c1931..b1de59a33 100644
--- a/app/views/events/index.html.haml
+++ b/app/views/events/index.html.haml
@@ -53,6 +53,4 @@
 /%a#banner(href='https://www.libre-en-fete.net')
 /  = image_tag 'lef.png', width: '486', height: '80', alt: 'Libre en Fete'
 
-= render '/orgas/search'
-
 - events_meta
diff --git a/app/views/pages/_search.haml b/app/views/pages/_search.haml
index be9bdb601..e4377fb5c 100644
--- a/app/views/pages/_search.haml
+++ b/app/views/pages/_search.haml
@@ -2,9 +2,12 @@
   .digest
     - if params[:tag].present?
       = render partial: '/tags/context', locals: { tags: params[:tag] }
+    - else
+      = render '/orgas/search'
 
-    = link_to page_path('filter'), class: 'filter' do
-      = t 'title', scope: 'pages.filter'
+    - if params[:tag].blank? && (params[:near].blank? || params[:near][:location].blank?)
+      = link_to page_path('filter'), class: 'filter' do
+        = t 'title', scope: 'pages.filter'
 
     = link_to page_path('filter'), title: t('title', scope: 'pages.filter') do
       %em.fa.fa-angle-double-right
-- 
GitLab