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'