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
|
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:
|
||||||
|
|
|
@ -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] %>
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue