Merge pull request #41 from ZeusWPI/fix-imagefunction

Fix imagefunction
This commit is contained in:
mcbloch 2020-08-29 17:16:42 +02:00 committed by GitHub Enterprise
commit ff973ac8f6
2 changed files with 12 additions and 14 deletions

View file

@ -3,7 +3,7 @@
<h1> Thema's </h1> <h1> Thema's </h1>
<ul> <ul>
<% for thema in themas %> <% for thema in themas %>
<img src="<%= image_url(thema) %>" alt="<%= thema[:naam] %>"> <%= image_tag thema %>
<li> <%= link_to(thema[:naam], thema) %> </li> <li> <%= link_to(thema[:naam], thema) %> </li>
<% end %> <% end %>
</ul> </ul>
@ -12,7 +12,7 @@
<h1> Konventen en projecten </h1> <h1> Konventen en projecten </h1>
<ul> <ul>
<% for item in konventen_and_projecten %> <% for item in konventen_and_projecten %>
<img src="<%= image_url(item) %>" alt="<%= item[:naam] %>"> <%= image_tag item %>
<li> <%= link_to(item[:naam], item) %> </li> <li> <%= link_to(item[:naam], item) %> </li>
<% end %> <% end %>
</ul> </ul>

View file

@ -51,9 +51,8 @@ module VerenigingenHelper
else else
item[:image] item[:image]
end end
def abbreviation(item)
item.identifier.without_ext.split('/').last
end end
def verenigingen_random(amount) def verenigingen_random(amount)
@items.find_all("**/verenigingen/*").map { |x| { @items.find_all("**/verenigingen/*").map { |x| {
"titel" => x[:titel], "titel" => x[:titel],
@ -62,9 +61,8 @@ module VerenigingenHelper
"themas" => x[:themas] "themas" => x[:themas]
} }.to_a.shuffle[0..amount] } }.to_a.shuffle[0..amount]
end end
end
def image_tag(item) def image_tag(item)
"<img src='#{ image_url item }' alt='#{ item[:name] } logo' />" "<img src='#{ image_url item }' alt='#{ item[:naam] } logo' />"
end end
end end