This commit is contained in:
ajuvercr 2019-12-06 20:37:33 +01:00
parent 454c67b75a
commit 18afac1ebb
4 changed files with 66 additions and 2 deletions

View file

@ -73,6 +73,8 @@
</div>
</section>
<!-- LOCATION -->
<% if item[:locationlink] %>
<section class="section">
<div class="columns">
<div class="column is-8 is-offset-2">
@ -83,6 +85,7 @@
</div>
</div>
</section>
<% end %>
<!-- SPONSORED BY -->

View file

@ -61,4 +61,28 @@
</div>
<% end %>
</div>
<% unless soon_events().empty? %>
<div class="column is-3 is-narrow">
<aside class="menu">
<p class="menu-label">
Soon TM.
</p>
<% soon_events().each do |event| %>
<div class="tile box"
<% if event[:color] %>
style="background-image: linear-gradient(to top right,rgba(255,255,255,0),rgba(0,0,0,.60)); background-color:<%= event[:color] %>;"
<% else %>
style="background-image: linear-gradient(to top right,rgba(255,255,255,0),rgba(0,0,0,.60)); background-color:'light-grey';"
<% end %>
>
<div class="content event-content">
<h3><%= event[:title] %></h3>
<p><%= event[:description] %></p>
</div>
</div>
<% end %>
</aside>
</div>
<% end %>
</div>

View file

@ -0,0 +1,33 @@
<% if @event[:banner] %>
<a href="<%= @event.path %>" class="tile event-tile is-child box backgroundimg highlighted"
style="background-image:linear-gradient(rgba(0,0,0,0.2), rgba(0, 0, 0, 0.65)), url('<%= @event[:banner] %>');">
<% elsif @event[:color] %>
<a href="<%= @event.path %>" class="tile event-tile is-child box backgroundimg highlighted"
style="background-image: linear-gradient(to top right,rgba(255,255,255,0),rgba(0,0,0,.60)); background-color:<%= @event[:color] %>;">
<% else %>
<a href="<%= @event.path %>" class="tile event-tile is-child box backgroundimg">
<% end %>
<div class="content event-content">
<% if nil && @event[:image] %>
<img class="event-tile-image" src="<%= @event[:image] %>" alt="">
<% end %>
<div class="event-text">
<h1 class="has-text-centered">
<%= @event[:title] %>
</h1>
<div class="description has-text-centered">
<%= @event[:description] %>
</div>
<div class="is-divider"></div>
<div class="event-time-loc">
<%= fa :'clock-o' , fw: true %><%= @event[:time].strftime('%A %d %B, %H:%M') %>
<br>
<%= fa :'map-marker', fw: true %><%= @event[:location] %>
</div>
</div>
</div>
</a>

View file

@ -3,14 +3,18 @@
require 'uri'
module EventsHelper
def all_events(year = nil)
def all_events(year = nil, soon = nil)
items_ = if year
@items.find_all("/events/#{year}/*.md")
else
@items.find_all('/events/*/*.md')
end
items_.sort_by { |x| x[:time] }
items_.select { |x| x[:soon] == soon }.sort_by { |x| x[:time] }
end
def soon_events()
all_events(nil, true)
end
def upcoming_events(year = nil)