partial event preview
This commit is contained in:
parent
cdb214cc23
commit
7d74313176
3 changed files with 42 additions and 34 deletions
|
@ -10,39 +10,12 @@ title: Events
|
||||||
|
|
||||||
<% all_events.each do |event| %>
|
<% all_events.each do |event| %>
|
||||||
<!-- <hr class="divider"> -->
|
<!-- <hr class="divider"> -->
|
||||||
<div class="box event-preview">
|
<% if (sub_events(event)).empty? %>
|
||||||
<div class="image-holder">
|
<%= render '/partials/_event_preview.*', event: event %>
|
||||||
<img src="https://placehold.it/150x150" alt="" class="image" />
|
<% else %>
|
||||||
</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| %>
|
<% sub_events(event).each do |sub_event| %>
|
||||||
<div class="subevent">
|
<%= render '/partials/_event_preview.*', event: sub_event %>
|
||||||
<a href="<%= relative_path_to(sub_event) %>">
|
<% end %>
|
||||||
<%= sub_event[:title] %>
|
<% end %>
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
title: Bottle Bats Introductie
|
title: Bottle Bats Introductie
|
||||||
time: 12-3-16
|
time: 12-3-16
|
||||||
location: Grace Hopper
|
location: Grace Hopper
|
||||||
|
description: Dit is een description!
|
||||||
---
|
---
|
||||||
|
|
34
layouts/partials/_event_preview.erb
Normal file
34
layouts/partials/_event_preview.erb
Normal 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>
|
Loading…
Reference in a new issue