Fallback logos everywhere
This commit is contained in:
parent
c31c11e46c
commit
3c39054028
5 changed files with 16 additions and 6 deletions
|
@ -1,8 +1,10 @@
|
|||
---
|
||||
naam: StuJardin
|
||||
titel: StuJardin
|
||||
id: stujardin
|
||||
naam: StuJardin
|
||||
verkorte_naam: StuJardin
|
||||
konvent: gsr
|
||||
logo: /assets/sfeerfotos/stujardin.png
|
||||
contact: http://stujardin@gmail.com/
|
||||
website: http://student.ugent.be/stujardin/
|
||||
social:
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<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>
|
||||
<% if item[:themas] %>
|
||||
<% for thema in item[:themas] %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="link" onclick="window.location.href='<%= item.path %>'">
|
||||
<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 class="link__content">
|
||||
<h3 class="link__title">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<% for item in konventen %>
|
||||
<a class="tile clickable tile--medium" href="<%= item.path %>">
|
||||
<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>
|
||||
<p class="tile__title tile__title--medium"> <%= item[:titel] || item[:naam] %> </p>
|
||||
</a>
|
||||
|
|
|
@ -77,6 +77,14 @@ module VerenigingenHelper
|
|||
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)
|
||||
"<img src='#{ image_url item }' alt='#{ item[:naam] } logo' />"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue