Merge pull request #41 from ZeusWPI/fix-imagefunction
Fix imagefunction
This commit is contained in:
commit
ff973ac8f6
2 changed files with 12 additions and 14 deletions
|
@ -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>
|
||||||
|
|
|
@ -51,20 +51,18 @@ 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],
|
||||||
"naam" => x[:naam],
|
"naam" => x[:naam],
|
||||||
"konvent" => x[:konvent],
|
"konvent" => x[:konvent],
|
||||||
"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
|
||||||
|
|
Loading…
Reference in a new issue