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"> <div class="content has-text-centered">
<h1>Sorry.</h1> <h1>Sorry.</h1>
<h2>No events planned yet this year.</h2> <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> </div>
<% end %> <% end %>
</div> </div>
<% unless soon_events().empty? %> <% unless soon_events.empty? %>
<div class="column is-3 is-narrow"> <div class="column is-3 is-narrow">
<div class="menu"> <div class="menu">
<div class="content"> <div class="content">
<h1> <h1>
Soon TM. Soon
</h1> </h1>
</div> </div>
<% soon_events().each do |event| %> <% soon_events.each do |event| %>
<div class="tile box highlighted" <%= render '/partials/_soon_tile.*', event: event %>
<% 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>
<% end %> <% end %>
</div> </div>
</div> </div>

View file

@ -1,33 +1,17 @@
<% if @event[:banner] %> <div class="tile box highlighted"
<a href="<%= @event.path %>" class="tile event-tile is-child box backgroundimg highlighted" <% if event[:color] %>
style="background-image:linear-gradient(rgba(0,0,0,0.2), rgba(0, 0, 0, 0.65)), url('<%= @event[:banner] %>');"> style="background-image: linear-gradient(to top right,rgba(255,255,255,0),rgba(0,0,0,.60)); background-color:<%= event[:color] %>;"
<% elsif @event[:color] %> <% else %>
<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: lightgrey;"
style="background-image: linear-gradient(to top right,rgba(255,255,255,0),rgba(0,0,0,.60)); background-color:<%= @event[:color] %>;"> <% end %>
<% else %> >
<a href="<%= @event.path %>" class="tile event-tile is-child box backgroundimg">
<% end %>
<div class="content event-content"> <div class="content event-content">
<% if nil && @event[:image] %> <% if @event[:image] %>
<img class="event-tile-image" src="<%= @event[:image] %>" alt=""> <img class="event-tile-image" src="<%= @event[:image] %>" alt="">
<% end %> <% end %>
<div class="event-text"> <div class="has-text-centered">
<h1 class="has-text-centered"> <h3><%= @event[:title] %></h3>
<%= @event[:title] %> <p><%= @event[:description] %></p>
</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> </div>
</div>
</div>
</a>

View file

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

View file

@ -2,9 +2,9 @@ module IcalHelper
def event_calendar def event_calendar
cal = Icalendar::Calendar.new cal = Icalendar::Calendar.new
items.find_all('/events/*/*.md').each do |i| items.find_all('/events/*/*.md')
cal.add_event(event_for(i)) .select { |x| x[:soon] == nil }
end .each {|i| cal.add_event(event_for(i)) }
cal.to_ical cal.to_ical
end 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.', 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', title: 'The event does not include a :title',
location: 'The event should include a :location, a textual description', 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: { privacy: {
status: 'A privacy item must include the status of the project' status: 'A privacy item must include the status of the project'
} }