fix themas listings

This commit is contained in:
ajuvercr 2020-09-12 17:19:35 +02:00
parent 76db2afbbc
commit aa724bdea5
3 changed files with 10 additions and 4 deletions

4
Rules
View file

@ -6,8 +6,7 @@ preprocess do
themas.each do |thema|
content = ''
attributes = {
naam: thema,
verenigingen: @items.filter{|i| i[:themas] and i[:themas].include?(thema)}.flatten.uniq.compact
naam: thema
}
identifier = "/themas/#{thema}"
@ -42,6 +41,7 @@ end
compile '/themas/*' do
layout '/thema.*'
layout '/default.*'
layout '/base.*'
write ext: 'html'
end

View file

@ -3,5 +3,7 @@
<div class="details-container details-text">
<%= yield %>
</div>
<%= render '/partials/detail.*' %>
<% verenigingen_voor_thema(item[:naam]).each do |ver| %>
<%= render '/partials/pretty_link.*', :item => ver %>
<% end %>
</div>

View file

@ -16,6 +16,10 @@ module VerenigingenHelper
@items.find_all("**/themas/*")
end
def verenigingen_voor_thema(thema)
@items.filter{|i| i[:themas] and i[:themas].include?(thema)}.to_a
end
def konventen
@items.find_all("**/konventen/*").to_a
end
@ -48,7 +52,7 @@ module VerenigingenHelper
"id" => x[:id]
} }.flatten.to_a
end
def abbreviation(item)
item.identifier.without_ext.split('/').last