Merge pull request #368 from ZeusWPI/events/soon-fixes

Fixes for events/soon
This commit is contained in:
redfast00 2020-01-13 14:42:07 +01:00 committed by GitHub
commit 3c5741eacb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 54 deletions

View file

@ -57,32 +57,21 @@
<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? %>
<% unless soon_events.empty? %>
<div class="column is-3 is-narrow">
<div class="menu">
<div class="content">
<h1>
Soon TM.
Soon
</h1>
</div>
<% soon_events().each do |event| %>
<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:'light-grey';"
<% end %>
>
<div class="content event-content has-text-centered">
<h3 style="color: white;"><%= event[:title] %></h3>
<p><%= event[:description] %></p>
</div>
</div>
<% soon_events.each do |event| %>
<%= render '/partials/_soon_tile.*', event: event %>
<% end %>
</div>
</div>

View file

@ -1,33 +1,17 @@
<% 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="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 nil && @event[:image] %>
<% if @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 class="has-text-centered">
<h3><%= @event[:title] %></h3>
<p><%= @event[:description] %></p>
</div>
</div>
</div>
</a>
</div>

View file

@ -13,7 +13,7 @@ module EventsHelper
items_.select { |x| x[:soon] == soon }.sort_by { |x| x[:time] }
end
def soon_events()
def soon_events
all_events(nil, true)
end

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

@ -5,7 +5,7 @@ module PreprocessHelper
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'
}