From d1ab7c73d110d043e9473d9b4f89751c4ca7c9e2 Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Mon, 13 Jan 2020 14:09:04 +0100 Subject: [PATCH 1/4] Fix syntax error due to merge --- lib/helpers/preprocess.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/helpers/preprocess.rb b/lib/helpers/preprocess.rb index bb23b51..41abf9a 100644 --- a/lib/helpers/preprocess.rb +++ b/lib/helpers/preprocess.rb @@ -1,11 +1,11 @@ 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', + 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' } From 647d942412c9a1d9178b99c51102cd74163ce6ca Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Mon, 13 Jan 2020 14:31:30 +0100 Subject: [PATCH 2/4] Html improvements: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use partial instead of inline - Correct background colour if event has none - Don't use tag, use - Use UTF8 ™ character --- layouts/events.erb | 23 +++++-------------- layouts/partials/_soon_tile.erb | 40 ++++++++++----------------------- 2 files changed, 18 insertions(+), 45 deletions(-) diff --git a/layouts/events.erb b/layouts/events.erb index 827c71f..c967bf7 100644 --- a/layouts/events.erb +++ b/layouts/events.erb @@ -57,33 +57,22 @@

Sorry.

No events planned yet this year.

-

Soon TM.

+

Soon™.

<% end %> - <% unless soon_events().empty? %> + <% unless soon_events.empty? %>
<% end %> diff --git a/layouts/partials/_soon_tile.erb b/layouts/partials/_soon_tile.erb index f46b4c9..cea1f67 100644 --- a/layouts/partials/_soon_tile.erb +++ b/layouts/partials/_soon_tile.erb @@ -1,33 +1,17 @@ -<% if @event[:banner] %> - -<% elsif @event[:color] %> - -<% else %> - -<% end %> +
+ 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 %> + > From 93aef1e251d3c43b856c9a7de1aeecdc9d78a144 Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Mon, 13 Jan 2020 14:31:55 +0100 Subject: [PATCH 3/4] No parentheses when no params --- lib/helpers/events.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helpers/events.rb b/lib/helpers/events.rb index cb8501d..7e682dd 100644 --- a/lib/helpers/events.rb +++ b/lib/helpers/events.rb @@ -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 From d8323ecfef105a09ce86e75d6872fde383324efe Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Mon, 13 Jan 2020 14:34:12 +0100 Subject: [PATCH 4/4] Don't put soon events in ical --- lib/helpers/ical.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/helpers/ical.rb b/lib/helpers/ical.rb index 1369e0f..e11e1ef 100644 --- a/lib/helpers/ical.rb +++ b/lib/helpers/ical.rb @@ -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