From dafb52ddf5ad7dd461f867348ce62de438f6e373 Mon Sep 17 00:00:00 2001
From: echarp <emmanuel.charpentier@free.fr>
Date: Sun, 28 Sep 2014 00:16:25 +0200
Subject: [PATCH] =?UTF-8?q?Affichage=20affin=C3=A9=20des=20evts,=20avec=20?=
 =?UTF-8?q?icone=20pour=20indiquer=20leur=20localit=C3=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/assets/stylesheets/events.css.sass  | 8 +++++---
 app/views/events/index.html.haml        | 8 ++++----
 app/views/events/show.html.haml         | 6 +++++-
 app/views/layouts/application.html.haml | 3 ++-
 config/locales/models/fr.yml            | 6 +++---
 5 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/app/assets/stylesheets/events.css.sass b/app/assets/stylesheets/events.css.sass
index 9adefdaaa..4b7e09a48 100644
--- a/app/assets/stylesheets/events.css.sass
+++ b/app/assets/stylesheets/events.css.sass
@@ -10,6 +10,9 @@ header.calendar-header
     &:first-child, &:last-child
       margin: 0 0.3em
 
+em.locality.fa
+  color: gray
+
 span.city:after, strong.city:after, em.city:after
   content: ':'
 
@@ -77,14 +80,13 @@ body.events.index table
         margin-left: 0
         padding-left: 0.8em
         margin-bottom: 5px
-        list-style-type: none
         li
           color: #444
           margin: 0
           padding: 0
           margin-top: 0.4em
-          em.fa
-            color: gray
+          &.national
+            border-bottom: solid 3px lightgray
           em.fa-li
             font-size: smaller
           em.fa-li:before
diff --git a/app/views/events/index.html.haml b/app/views/events/index.html.haml
index 749c3eb97..2cb77ac87 100644
--- a/app/views/events/index.html.haml
+++ b/app/views/events/index.html.haml
@@ -39,13 +39,13 @@
     %ul.events.fa-ul
       - events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
       -   .sort_by { |e| e.city }.each do |event|
-        %li.event
+        %li.event(class="#{event.locality? ? 'national' : 'local'}" title="#{display_date(event)}")
           - if event.locality?
-            %em.fa.fa-li.fa-globe(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_1'}")
+            %em.locality.fa.fa-li.fa-globe(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_1'}")
           - else
-            %em.fa.fa-li.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}")
+            %em.locality.fa.fa-li.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}")
           = link_to event do
-            %strong.city= event.city
+            %strong.city(title="#{event.full_address}")= event.city
             = event.title
 
 .formats
diff --git a/app/views/events/show.html.haml b/app/views/events/show.html.haml
index 87d379428..e47d752d9 100644
--- a/app/views/events/show.html.haml
+++ b/app/views/events/show.html.haml
@@ -1,7 +1,11 @@
 - set_event_meta
 
 %h2
-  %em.city= @event.city
+  - if @event.locality?
+    %em.locality.fa.fa-globe(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_1'}")
+  - else
+    %em.locality.fa.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}")
+  %em.city(title="#{@event.full_address}")= @event.city
   = title @event.title
 
 - if @event.persisted? && request.format == 'text/html' && controller.controller_name == 'events' && controller.action_name == 'show'
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index efc5ee0eb..5e9722ae3 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -4,7 +4,8 @@
   %head
     = display_meta_tags site: t('.title')
 
-    %meta(http-equiv='Content-Type' content='text/html; charset=utf-8')
+    %meta(http-equiv='Content-Type' content='text/html')
+    %meta(charset='utf-8')
     %meta(name='viewport' content='width=device-width, initial-scale=1.0')
     %meta(name='robots' content='index, follow')
 
diff --git a/config/locales/models/fr.yml b/config/locales/models/fr.yml
index e7f91dc15..18580e32d 100644
--- a/config/locales/models/fr.yml
+++ b/config/locales/models/fr.yml
@@ -33,10 +33,10 @@ fr:
         inseecode: Code INSEE
         regioncode: Code région
       lug:
-        related_region: Région
+        city: Ville
         department: Département
+        region: Région
         url: Adresse web
-        city: Ville
       event:
         title: Titre
         start_time: Début
@@ -44,7 +44,7 @@ fr:
         description: Description
         address: Adresse
         city: Ville
-        related_region: Région
+        region: Région
         locality: Portée
         url: URL
         contact: Contact
-- 
GitLab