From 0ad35f1fb73f6d61b20cd2a56fb6465fe9338ca6 Mon Sep 17 00:00:00 2001 From: echarp Date: Wed, 27 Feb 2019 12:56:45 +0000 Subject: [PATCH] The organisation favicon is now in its own template --- app/views/events/_aside.html.haml | 2 +- app/views/orgas/_favicon.html.haml | 2 ++ app/views/orgas/index.html.haml | 3 +-- app/views/orgas/show.html.haml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 app/views/orgas/_favicon.html.haml diff --git a/app/views/events/_aside.html.haml b/app/views/events/_aside.html.haml index b53983e0..88c84e7e 100644 --- a/app/views/events/_aside.html.haml +++ b/app/views/events/_aside.html.haml @@ -12,7 +12,7 @@ %em.fa.fa-li{ class: "fa-#{orga.kind.icon}", title: Kind.human_attribute_name("name_#{orga.kind.name}") } = orga.name - = image_tag orga.url + '/favicon.ico', alt: '', class: :favicon + = render partial: '/orgas/favicon', locals: { orga: orga } %h2 %em.fa.fa-wrench diff --git a/app/views/orgas/_favicon.html.haml b/app/views/orgas/_favicon.html.haml new file mode 100644 index 00000000..f00419e1 --- /dev/null +++ b/app/views/orgas/_favicon.html.haml @@ -0,0 +1,2 @@ +- if orga.url.match?(/^http/) && !orga.url.match?(/facebook/) + = image_tag orga.url + '/favicon.ico', alt: '', class: :favicon diff --git a/app/views/orgas/index.html.haml b/app/views/orgas/index.html.haml index 6b5f0a1f..94be883b 100644 --- a/app/views/orgas/index.html.haml +++ b/app/views/orgas/index.html.haml @@ -30,8 +30,7 @@ title: Kind.human_attribute_name("name_#{orga.kind.name}") } %td.name = orga.name - - if orga.url =~ /^http/ - = image_tag orga.url + '/favicon.ico', alt: '', class: :favicon + = render partial: '/orgas/favicon', locals: { orga: orga } %td.city= orga.city %td.department= orga.department %td.region= orga.region diff --git a/app/views/orgas/show.html.haml b/app/views/orgas/show.html.haml index 80dad3e2..dbae26f4 100644 --- a/app/views/orgas/show.html.haml +++ b/app/views/orgas/show.html.haml @@ -5,7 +5,7 @@ %em.fa{ class: "fa-#{@orga.kind.icon}", title: Kind.human_attribute_name("name_#{@orga.kind.name}") } = title @orga.name - = image_tag @orga.url + '/favicon.ico', alt: '', class: :favicon + = render partial: '/orgas/favicon', locals: { orga: @orga } = render 'aside' if controller.controller_name == 'orgas'