Fallback logos everywhere

This commit is contained in:
redfast00 2020-09-18 00:16:35 +02:00
parent c31c11e46c
commit 3c39054028
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
5 changed files with 16 additions and 6 deletions

View file

@ -1,8 +1,10 @@
--- ---
naam: StuJardin titel: StuJardin
id: stujardin id: stujardin
naam: StuJardin
verkorte_naam: StuJardin verkorte_naam: StuJardin
konvent: gsr konvent: gsr
logo: /assets/sfeerfotos/stujardin.png
contact: http://stujardin@gmail.com/ contact: http://stujardin@gmail.com/
website: http://student.ugent.be/stujardin/ website: http://student.ugent.be/stujardin/
social: social:

View file

@ -21,7 +21,7 @@
<% end %> <% end %>
</div> </div>
<div class="detail_title"> <div class="detail_title">
<a target="_blank" href="<%= item[:website] %>"><img src="https://dsa.ugent.be/api/verenigingen/<%= abbreviation(item) %>/logo?size=small" alt="<%= item[:naam] %>"></a> <a target="_blank" href="<%= item[:website] %>"><img src="<%= small_image_url(item) %>" alt="<%= item[:naam] %>" height=100></a>
<h2><%= item[:naam] %></h2> <h2><%= item[:naam] %></h2>
<% if item[:themas] %> <% if item[:themas] %>
<% for thema in item[:themas] %> <% for thema in item[:themas] %>

View file

@ -1,6 +1,6 @@
<div class="link" onclick="window.location.href='<%= item.path %>'"> <div class="link" onclick="window.location.href='<%= item.path %>'">
<div class="link__img"> <div class="link__img">
<img src="https://dsa.ugent.be/api/verenigingen/<%= abbreviation(item) %>/logo?size=small" alt="<%= item[:naam] %>"> <img src="<%= small_image_url(item) %>" alt="<%= item[:naam] %>" height=100>
</div> </div>
<div class="link__content"> <div class="link__content">
<h3 class="link__title"> <h3 class="link__title">

View file

@ -18,7 +18,7 @@
<% for item in konventen %> <% for item in konventen %>
<a class="tile clickable tile--medium" href="<%= item.path %>"> <a class="tile clickable tile--medium" href="<%= item.path %>">
<div class="tile__image"> <div class="tile__image">
<img src="https://dsa.ugent.be/api/verenigingen/<%= abbreviation(item) %>/logo?size=medium" alt="<%= item[:naam] %>"> <img src="<%= image_url(item) %>" alt="<%= item[:naam] %>">
</div> </div>
<p class="tile__title tile__title--medium"> <%= item[:titel] || item[:naam] %> </p> <p class="tile__title tile__title--medium"> <%= item[:titel] || item[:naam] %> </p>
</a> </a>

View file

@ -77,6 +77,14 @@ module VerenigingenHelper
end end
end end
def small_image_url(item)
if item[:logo].nil?
"https://dsa.ugent.be/api/verenigingen/#{ abbreviation item }/logo?size=small"
else
item[:logo]
end
end
def image_tag(item) def image_tag(item)
"<img src='#{ image_url item }' alt='#{ item[:naam] } logo' />" "<img src='#{ image_url item }' alt='#{ item[:naam] } logo' />"
end end