From 13e67c3a3a861e43f3c8a8fb337a677a83875d25 Mon Sep 17 00:00:00 2001 From: echarp Date: Tue, 7 May 2019 20:00:28 +0200 Subject: [PATCH] Reworked country/region selector, and orga search form moved after the main calendar --- app/assets/stylesheets/all.sass | 14 +++++----- app/assets/stylesheets/orgas.sass | 3 --- app/assets/stylesheets/pages.sass | 2 +- app/assets/stylesheets/region.sass | 36 +++++++++++-------------- app/views/layouts/application.html.haml | 5 ++-- app/views/orgas/_search.html.haml | 4 --- app/views/pages/_search.haml | 7 +++++ app/views/regions/_filter.haml | 2 +- 8 files changed, 33 insertions(+), 40 deletions(-) diff --git a/app/assets/stylesheets/all.sass b/app/assets/stylesheets/all.sass index 15805881..b71a70f1 100644 --- a/app/assets/stylesheets/all.sass +++ b/app/assets/stylesheets/all.sass @@ -73,6 +73,7 @@ h3.warning background-color: orange header.top + position: relative text-align: left img.logo float: left @@ -88,16 +89,13 @@ header.top weight: normal margin-top: 0.2em - nav + ul.regions top: -3em + right: 0 + position: absolute font-size: smaller - text-align: center - .digest, form - margin-top: 2em - &:hover nav - top: 0.3em - .digest, form - margin-top: 0 + &:hover ul.regions + top: -0.8em main, body.mce-content-body clear: both diff --git a/app/assets/stylesheets/orgas.sass b/app/assets/stylesheets/orgas.sass index 10499cc7..3e87cafb 100644 --- a/app/assets/stylesheets/orgas.sass +++ b/app/assets/stylesheets/orgas.sass @@ -4,10 +4,7 @@ img.favicon vertical-align: middle form#orga_search - float: right font-size: larger - margin-left: 1em - margin-right: 1em label display: none em.fa diff --git a/app/assets/stylesheets/pages.sass b/app/assets/stylesheets/pages.sass index 4910e4e4..48901a7a 100644 --- a/app/assets/stylesheets/pages.sass +++ b/app/assets/stylesheets/pages.sass @@ -4,4 +4,4 @@ body.pages main .digest float: right - font-size: larger + margin-top: 1em diff --git a/app/assets/stylesheets/region.sass b/app/assets/stylesheets/region.sass index 6e34d974..19b9c58c 100644 --- a/app/assets/stylesheets/region.sass +++ b/app/assets/stylesheets/region.sass @@ -1,25 +1,8 @@ -header nav - left: 0 - width: 100% - position: absolute - & > ul > li +header.top ul.regions + margin: 0 + list-style: none + & > li display: inline-block - ul - margin: 0 - z-index: 1500 - list-style: none - border-bottom-left-radius: 0.4em - border-bottom-right-radius: 0.4em - ul - position: absolute - text-align: left - li - display: none - border-top: solid thin #eee - li.selected - display: inline-block - & li:hover li, li li.selected - display: block li margin: 0 box-shadow: 0 0 1em white @@ -32,6 +15,17 @@ header nav white-space: nowrap &:hover ul box-shadow: 0 4px 4px gray + li.selected + display: inline-block + & li:hover li, li li.selected + display: block + ul + z-index: 1500 + position: absolute + text-align: left + li + display: none + border-top: solid thin #eee .field.region .radios diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 8943d431..5de54efc 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -21,10 +21,10 @@ %header.top %nav = render '/regions/filter' - = render '/orgas/search' = render '/pages/search' - = image_tag 'baby_gnu_adl.png', alt: '', class: :logo + = link_to root_path do + = image_tag 'baby_gnu_adl.png', alt: '', class: :logo %h1= link_to t('.title'), root_path %h2= t '.subtitle' @@ -33,6 +33,7 @@ %main= yield %footer.bottom + = render '/orgas/search' %nav = link_to new_event_path do %em.fa.fa-pencil-alt diff --git a/app/views/orgas/_search.html.haml b/app/views/orgas/_search.html.haml index 5507d700..45020f69 100644 --- a/app/views/orgas/_search.html.haml +++ b/app/views/orgas/_search.html.haml @@ -8,7 +8,3 @@ = f.button class: :search do %em.fa.fa-search %span.label= t '.label' - - = link_to page_path('filter'), title: t('.filter') do -   - %em.fa.fa-angle-double-right diff --git a/app/views/pages/_search.haml b/app/views/pages/_search.haml index 5faf7611..1bbbce91 100644 --- a/app/views/pages/_search.haml +++ b/app/views/pages/_search.haml @@ -12,3 +12,10 @@ km %a(href="?near=") %em.fa.fa-times + + - if params[:tag].blank? && (params[:near].blank? || params[:near][:location].blank?) + = link_to page_path('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 diff --git a/app/views/regions/_filter.haml b/app/views/regions/_filter.haml index 9789c5b9..b4a5333b 100644 --- a/app/views/regions/_filter.haml +++ b/app/views/regions/_filter.haml @@ -1,2 +1,2 @@ -# Choose a region to filter events with -%ul= render partial: '/regions/filter_region', collection: Region.top +%ul.regions= render partial: '/regions/filter_region', collection: Region.top