render verenigingen projecten and konventen with the same detail layout

This commit is contained in:
ajuvercr 2020-09-15 20:25:58 +02:00
parent 6b1a9ee9a7
commit 08961fa62a
5 changed files with 14 additions and 24 deletions

12
Rules
View file

@ -14,17 +14,9 @@ preprocess do
end end
end end
compile '/{verenigingen,projecten}/*.md' do compile '/{verenigingen,projecten,konventen}/*.md' do
filter :kramdown filter :kramdown
layout '/vereniging.*' layout '/detail.*'
layout '/default.*'
layout '/base.*'
write ext: 'html'
end
compile '/konventen/*.md' do
filter :kramdown
layout '/konvent.*'
layout '/default.*' layout '/default.*'
layout '/base.*' layout '/base.*'
write ext: 'html' write ext: 'html'

View file

@ -1,3 +1,4 @@
<h1> <%= item[:naam] %> </h1>
<div class="details-container details-logo"> <div class="details-container details-logo">
<img src="https://dsa.ugent.be/api/verenigingen/<%= abbreviation(item) %>/logo?size=huge" alt="<%= item[:naam] %>"> <img src="https://dsa.ugent.be/api/verenigingen/<%= abbreviation(item) %>/logo?size=huge" alt="<%= item[:naam] %>">
</div> </div>
@ -52,3 +53,10 @@
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<% if item.path.include? "konventen" %>
<% for vereniging in verenigingen_voor_konvent(item[:id]) %>
<div>
<%= vereniging[:naam] %>
</div>
<% end %>
<% end %>

View file

@ -1,7 +0,0 @@
<h1> <%= item[:naam] %> </h1>
<div class="details-wrapper">
<div class="details-container details-text">
<%= yield %>
</div>
<%= render '/partials/detail.*' %>
</div>

View file

@ -1,7 +0,0 @@
<h1> <%= item[:naam] %> </h1>
<div class="details-wrapper">
<div class="details-container details-text">
<%= yield %>
</div>
<%= render '/partials/detail.*' %>
</div>

View file

@ -20,6 +20,10 @@ module VerenigingenHelper
@items.filter{|i| i[:themas] and i[:themas].include?(thema)}.to_a @items.filter{|i| i[:themas] and i[:themas].include?(thema)}.to_a
end end
def verenigingen_voor_konvent(konvent)
@items.find_all("**/verenigingen/*").filter { |i| i[:konvent] == konvent }.to_a
end
def konventen def konventen
@items.find_all("**/konventen/*").to_a @items.find_all("**/konventen/*").to_a
end end