partial event preview

This commit is contained in:
myncke 2016-08-27 03:50:40 +02:00
parent cdb214cc23
commit 7d74313176
3 changed files with 42 additions and 34 deletions

View file

@ -10,39 +10,12 @@ title: Events
<% all_events.each do |event| %>
<!-- <hr class="divider"> -->
<div class="box event-preview">
<div class="image-holder">
<img src="https://placehold.it/150x150" alt="" class="image" />
</div>
<div class="box info">
<div class="title">
<a href="<%= relative_path_to(event) %>">
<%= event[:title] %>
</a>
</div>
<div class="location">
<a href="#">
<%= event[:location] %>
</a>
</div>
<div class="description">
<%= event[:description] %>
</div>
<div class="time">
<%= event[:time] %>
</div>
<% if (sub_events(event)).empty? %>
<%= render '/partials/_event_preview.*', event: event %>
<% else %>
<% sub_events(event).each do |sub_event| %>
<div class="subevent">
<a href="<%= relative_path_to(sub_event) %>">
<%= sub_event[:title] %>
</a>
</div>
<% end %>
</div>
</div>
<%= render '/partials/_event_preview.*', event: sub_event %>
<% end %>
<% end %>
<% end %>
</div>

View file

@ -2,4 +2,5 @@
title: Bottle Bats Introductie
time: 12-3-16
location: Grace Hopper
description: Dit is een description!
---

View file

@ -0,0 +1,34 @@
<div class="box event-preview">
<div class="image-holder">
<img src="https://placehold.it/150x150" alt="" class="image" />
</div>
<div class="box info">
<div class="title">
<a href="<%= relative_path_to(@event) %>">
<%= @event[:title] %>
</a>
</div>
<div class="location">
<a href="#">
<%= event[:location] %>
</a>
</div>
<div class="description">
<%= event[:description] %>
</div>
<div class="time">
<%= event[:time] %>
</div>
<% sub_events(event).each do |sub_event| %>
<div class="subevent">
<a href="<%= relative_path_to(sub_event) %>">
<%= sub_event[:title] %>
</a>
</div>
<% end %>
</div>
</div>