From 26136597744dbb7de82843974ec055938b85edd3 Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Mon, 3 Oct 2016 14:45:31 +0200 Subject: [PATCH 1/2] fix mixed content --- content/index.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/index.erb b/content/index.erb index f3d059e..860cf3e 100644 --- a/content/index.erb +++ b/content/index.erb @@ -15,7 +15,7 @@
- +
From 7b8ba0b95ca61285b00965235dfce6a919965778 Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Mon, 3 Oct 2016 15:15:48 +0200 Subject: [PATCH 2/2] many stuffs --- Rules | 4 +++ content/assets/scripts/cammie.coffee | 4 +-- content/events.erb | 17 ++++++++++- content/events/15-16/bottlebats/intro.md | 6 ---- content/events/15-16/bottlebats/main.md | 3 -- content/events/15-16/bottlebats/test.md | 6 ---- content/events/16-17/LAN.md | 2 +- content/index.erb | 4 +-- content/posts/16-17/moar-review.md | 7 ----- content/posts/16-17/review-c.md | 37 ------------------------ content/projects.erb | 2 +- content/search.erb | 2 +- lib/helpers/events.rb | 10 ++++++- lib/helpers/ical.rb | 2 +- 14 files changed, 37 insertions(+), 69 deletions(-) delete mode 100644 content/events/15-16/bottlebats/intro.md delete mode 100644 content/events/15-16/bottlebats/main.md delete mode 100644 content/events/15-16/bottlebats/test.md delete mode 100644 content/posts/16-17/moar-review.md delete mode 100644 content/posts/16-17/review-c.md diff --git a/Rules b/Rules index bd757cf..38937e4 100644 --- a/Rules +++ b/Rules @@ -38,6 +38,10 @@ preprocess do end academic_years_items[academic_years.max][:navigable] = true + + all_events.each do |event| + event[:time] = Date.parse(event[:time]) + end end # diff --git a/content/assets/scripts/cammie.coffee b/content/assets/scripts/cammie.coffee index 912d754..9356a82 100644 --- a/content/assets/scripts/cammie.coffee +++ b/content/assets/scripts/cammie.coffee @@ -25,8 +25,8 @@ $ "#cammie-ctrls" $ '.ctrl' .click -> $context = $ this - $.ajax "//kelder.zeus.ugent.be/webcam/cgi/ptdc.cgi", + $.ajax "https://kelder.zeus.ugent.be/webcam/cgi/ptdc.cgi", data: command: $context.data 'command' posX: $context.data 'x' - posY: $context.data 'y' \ No newline at end of file + posY: $context.data 'y' diff --git a/content/events.erb b/content/events.erb index 01c0757..348e064 100644 --- a/content/events.erb +++ b/content/events.erb @@ -8,7 +8,22 @@ title: Events

Upcoming events

- <% all_events.each do |event| %> + <% upcoming_events.each do |event| %> + + <% if (sub_events(event)).empty? %> + <%= render '/partials/_event_preview.*', event: event %> + <% else %> + <% sub_events(event).each do |sub_event| %> + <%= render '/partials/_event_preview.*', event: sub_event, main_event: event %> + <% end %> + <% end %> + <% end %> + +
+

Past events

+
+ + <% past_events.each do |event| %> <% if (sub_events(event)).empty? %> <%= render '/partials/_event_preview.*', event: event %> diff --git a/content/events/15-16/bottlebats/intro.md b/content/events/15-16/bottlebats/intro.md deleted file mode 100644 index c410563..0000000 --- a/content/events/15-16/bottlebats/intro.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Bottle Bats Introductie -time: 12-3-16 -location: Grace Hopper -description: Dit is een description! ---- diff --git a/content/events/15-16/bottlebats/main.md b/content/events/15-16/bottlebats/main.md deleted file mode 100644 index c321015..0000000 --- a/content/events/15-16/bottlebats/main.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Bottle Bats ---- diff --git a/content/events/15-16/bottlebats/test.md b/content/events/15-16/bottlebats/test.md deleted file mode 100644 index 9c05546..0000000 --- a/content/events/15-16/bottlebats/test.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: test -time: 12-3-16 -location: Grace Hopper -description: Dit is een description! ---- diff --git a/content/events/16-17/LAN.md b/content/events/16-17/LAN.md index 6cb52d9..8b63afe 100644 --- a/content/events/16-17/LAN.md +++ b/content/events/16-17/LAN.md @@ -3,7 +3,7 @@ title: Geeks, Attack! V banner: https://scontent.xx.fbcdn.net/v/t1.0-9/13903431_1277596932251344_3927837466166230371_n.jpg?oh=bdda0d18a635c49893a097fba6aa99b9&oe=587C7886 description: Zeus' vijfde LAN-Party created_at: 13-09-2016 -time: 4-11-2016 +time: 04-11-2016 location: Therminal, Hoveniersberg 24 9000 Gent locationlink: Therminal,Ghent Belgium description: Zeus' vijfde LAN-Party diff --git a/content/index.erb b/content/index.erb index 860cf3e..64f5bce 100644 --- a/content/index.erb +++ b/content/index.erb @@ -53,12 +53,12 @@
diff --git a/content/posts/16-17/moar-review.md b/content/posts/16-17/moar-review.md deleted file mode 100644 index bbdd7d5..0000000 --- a/content/posts/16-17/moar-review.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: moar review -description: blub -banner: https://i.ytimg.com/vi/tntOCGkgt98/maxresdefault.jpg -created_at: 24-10-2016 ---- -blub diff --git a/content/posts/16-17/review-c.md b/content/posts/16-17/review-c.md deleted file mode 100644 index aa9b25f..0000000 --- a/content/posts/16-17/review-c.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -banner: https://thumbs.dreamstime.com/z/letter-c-cat-4240140.jpg -title: C review -description: We hebben even wat dingen in C geschreven, en dit zijn onze meningen -created_at: 23-10-2016 ---- - -> *Ben ik nu echt de enige die C echt niet leuk vindt?* -> -> — Ilion Iasoon Beyst - -C is een toffe taal enal - -~~~ -Individual *genetic_algo(Area *area, StationCol *stations, double lo, double hi) { - // Initialize global variables - init_coverage_polygon(area); - MAX_POWER = power_to_energy_usage(43); - - Population* p = generate_initial_population(POPULATION_SIZE, stations); - recalculate_fitness(area, stations, p, lo, hi); - - Individual* best = genetic_algo_exec(p, area, stations, POPULATION_SIZE, lo, hi, clock()); - for (size_t i = 0; i < best->size; i++) { - printf("%d\n", best->distribution[i]); - } - printf("%f\n", calculate_energy_usage(stations, best)); - printf("%f\n", calculate_station_coverage(area, stations, best, NULL)); - - for (size_t i = 0; i < p->size; i++) { - individual__free(p->elems[i]); - } - population__free(p); - - return best; -} -~~~ diff --git a/content/projects.erb b/content/projects.erb index f5ef627..3001dfc 100644 --- a/content/projects.erb +++ b/content/projects.erb @@ -1,5 +1,5 @@ --- -navigable: true +navigable: false title: Projecten ---
diff --git a/content/search.erb b/content/search.erb index 499adea..ce4c1fa 100644 --- a/content/search.erb +++ b/content/search.erb @@ -1,5 +1,5 @@ --- -navigable: true +navigable: false title: Search ---
diff --git a/lib/helpers/events.rb b/lib/helpers/events.rb index e278544..a627daa 100644 --- a/lib/helpers/events.rb +++ b/lib/helpers/events.rb @@ -1,7 +1,15 @@ require 'uri' module EventsHelper def all_events - @items.find_all('/events/*/*') + grouped_events + @items.find_all('/events/*/*').sort_by { |x| x[:time] } + end + + def upcoming_events + all_events.reject { |x| x[:time] < Date.today } + end + + def past_events + all_events.reject { |x| x[:time] >= Date.today } end def grouped_events diff --git a/lib/helpers/ical.rb b/lib/helpers/ical.rb index 69004ef..6520084 100644 --- a/lib/helpers/ical.rb +++ b/lib/helpers/ical.rb @@ -11,7 +11,7 @@ module IcalHelper def event_for(item) event = Icalendar::Event.new - event.dtstart = Date.parse(item[:time]) + event.dtstart = item[:time] event.summary = 'A great event!' event