Merge pull request #361 from ZeusWPI/events/soon

Events/soon
This commit is contained in:
redfast00 2020-01-14 12:49:20 +01:00 committed by GitHub
commit 60d03a8920
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 78 additions and 17 deletions

View file

@ -55,7 +55,7 @@ $top_coder_size: 80px;
.content {
color: white;
h1, h2 {
h1, h2, h3 {
color: inherit;
}
a, a:visited {
@ -130,7 +130,7 @@ $top_coder_size: 80px;
.content {
position: relative;
h1, h2 {
h1, h2, h3 {
color: white;
}

View file

@ -0,0 +1,7 @@
---
title: 'Capture The Flag II'
description: Zeus CTF in aanloop naar de Belgische Cybersecuritychallenge
time: '12-11-2019 18:00'
location: 'Kelder Zeus WPI'
soon: true
---

View file

@ -0,0 +1,8 @@
---
title: Game Development - Godot
description: Maak je eerste spel met Godot, we focussen op Flappy Bird!
color: '#478CBF'
time: '12-11-2019 18:00'
location: 'Kelder Zeus WPI'
soon: true
---

View file

@ -0,0 +1,8 @@
---
title: Spelletjesavond
description: Kom samen met andere Zeussers en Zeusinnen spelletjes spelen!
color: lightblue
time: '12-11-2019 18:00'
location: 'Kelder Zeus WPI'
soon: true
---

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

@ -57,8 +57,23 @@
<div class="content has-text-centered">
<h1>Sorry.</h1>
<h2>No events planned yet this year.</h2>
<h4 class="has-text-grey"><i>Soon TM.<i></h4>
<h4 class="has-text-grey"><em>Soon™.</em></h4>
</div>
<% end %>
</div>
<% unless soon_events.empty? %>
<div class="column is-3 is-narrow">
<div class="menu">
<div class="content">
<h1>
Soon™
</h1>
</div>
<% soon_events.each do |event| %>
<%= render '/partials/_soon_tile.*', event: event %>
<% end %>
</div>
</div>
<% end %>
</div>

View file

@ -0,0 +1,17 @@
<div class="tile box highlighted"
<% 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: lightgrey;"
<% end %>
>
<div class="content event-content">
<% if @event[:image] %>
<img class="event-tile-image" src="<%= @event[:image] %>" alt="">
<% end %>
<div class="has-text-centered">
<h3><%= @event[:title] %></h3>
<p><%= @event[:description] %></p>
</div>
</div>
</div>

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)

View file

@ -2,9 +2,9 @@ module IcalHelper
def event_calendar
cal = Icalendar::Calendar.new
items.find_all('/events/*/*.md').each do |i|
cal.add_event(event_for(i))
end
items.find_all('/events/*/*.md')
.select { |x| x[:soon] == nil }
.each {|i| cal.add_event(event_for(i)) }
cal.to_ical
end

View file

@ -1,15 +1,14 @@
module PreprocessHelper
def required_attrs
{
event: {
time: 'An event item should include the :time attribute, which describes the begin time and date of the event.',
title: 'The event does not include a :title',
location: 'The event should include a :location, a textual description',
locationlink: 'The event does not include a :locationlink, which is a querystring which is used for Google Maps'
},
privacy: {
status: 'A privacy item must include the status of the project'
}
event: {
time: 'An event item should include the :time attribute, which describes the begin time and date of the event.',
title: 'The event does not include a :title',
location: 'The event should include a :location, a textual description',
},
privacy: {
status: 'A privacy item must include the status of the project'
}
}
end