From d35acf304d31d2ad9d0bc35e4b732068f6edd6c1 Mon Sep 17 00:00:00 2001 From: squaredetector <117200367+squaredetector@users.noreply.github.com> Date: Tue, 21 Nov 2023 12:29:45 +0100 Subject: [PATCH 1/3] issue 584 --- content/index.erb | 30 +++++++++++++++++++++++++----- lib/helpers/blog.rb | 7 +++++++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/content/index.erb b/content/index.erb index fbdb2b62..9a0151e2 100644 --- a/content/index.erb +++ b/content/index.erb @@ -21,7 +21,11 @@
- Upcoming Events + + + Upcoming Events + +
<% unless upcoming_events.empty? %> <% upcoming_events.each do |event| %> @@ -41,7 +45,11 @@
- Top Coders + + + Top Coders + +
@@ -60,7 +68,11 @@
- Previous Events + + + Previous Events + +
<% previous_events[0..3].each do |event| %>
@@ -72,7 +84,11 @@
-

About Zeus WPI

+

+ + About Zeus WPI + +

Zeus WPI is the student association for Computer Science at Ghent University. Our goal is to provide a stimulating environment for motivated students looking to expand their skills by engaging in interesting real-world projects.

@@ -82,7 +98,11 @@

- Blogposts + + + Blogpost + +
<% sorted_articles[0..3].each do |post| %> <%= render '/partials/_blog_preview.*', post: post %> diff --git a/lib/helpers/blog.rb b/lib/helpers/blog.rb index 96db1318..314610b1 100644 --- a/lib/helpers/blog.rb +++ b/lib/helpers/blog.rb @@ -25,4 +25,11 @@ def figure(img_url, caption, alt = nil, img_class: nil) HTML end + + def current_academic_year + year = Time.current.year + month = Time.current.month + start_year = month < 9 ? year - 1 : year + "#{start_year % 100}-#{(start_year + 1) % 100}" + end end From 6bb8159fc9993e6b66430849ec899e6f2d1bbbed Mon Sep 17 00:00:00 2001 From: squaredetector <117200367+squaredetector@users.noreply.github.com> Date: Tue, 21 Nov 2023 12:39:16 +0100 Subject: [PATCH 2/3] Make titles on the homepage clickable issue 584 --- content/index.erb | 10 +++++----- lib/helpers/blog.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/content/index.erb b/content/index.erb index 9a0151e2..c7f2eb69 100644 --- a/content/index.erb +++ b/content/index.erb @@ -22,7 +22,7 @@
- + Upcoming Events @@ -46,7 +46,7 @@
- + Top Coders @@ -69,7 +69,7 @@
- + Previous Events @@ -85,7 +85,7 @@

- + About Zeus WPI

@@ -99,7 +99,7 @@
- + Blogpost diff --git a/lib/helpers/blog.rb b/lib/helpers/blog.rb index 314610b1..2b8b7f03 100644 --- a/lib/helpers/blog.rb +++ b/lib/helpers/blog.rb @@ -27,8 +27,8 @@ def figure(img_url, caption, alt = nil, img_class: nil) end def current_academic_year - year = Time.current.year - month = Time.current.month + year = Time.now.year + month = Time.now.month start_year = month < 9 ? year - 1 : year "#{start_year % 100}-#{(start_year + 1) % 100}" end From 5547ce2a4a87eea3f66323eb9bd2c00971f94914 Mon Sep 17 00:00:00 2001 From: squaredetector <117200367+squaredetector@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:41:49 +0100 Subject: [PATCH 3/3] helper methode van blog naar time verplaatst --- lib/helpers/blog.rb | 7 ------- lib/helpers/time.rb | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/helpers/blog.rb b/lib/helpers/blog.rb index 2b8b7f03..96db1318 100644 --- a/lib/helpers/blog.rb +++ b/lib/helpers/blog.rb @@ -25,11 +25,4 @@ def figure(img_url, caption, alt = nil, img_class: nil) HTML end - - def current_academic_year - year = Time.now.year - month = Time.now.month - start_year = month < 9 ? year - 1 : year - "#{start_year % 100}-#{(start_year + 1) % 100}" - end end diff --git a/lib/helpers/time.rb b/lib/helpers/time.rb index 0439f1ad..d4e6b594 100644 --- a/lib/helpers/time.rb +++ b/lib/helpers/time.rb @@ -29,4 +29,12 @@ def timehelper(ranges) def periodhelper(startdate, enddate) $tz.now.between?(startdate, enddate) end + + def current_academic_year + year = Time.now.year + month = Time.now.month + start_year = month < 9 ? year - 1 : year + "#{start_year % 100}-#{(start_year + 1) % 100}" + end + end