Skip to content

Commit e331fe1

Browse files
authored
Sort events by datetime (#44)
1 parent 730d2dc commit e331fe1

File tree

11 files changed

+42
-14
lines changed

11 files changed

+42
-14
lines changed

content/events/2024-06-05t13-30-00-ufuk-can-bicici/index.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type: phd-thesis-defense
33
title: Conditional Computation Techniques in Deep Neural Networks with
44
Conditional Information Gain
55
name: Ufuk Can Biçici
6-
time: 2024-06-05T13:30:00
6+
datetime: 2024-06-05T13:30:00
77
duration: 2h
88
location: Ali Vahit Şahiner (AVŞ)
99
---

content/events/2024-06-05t13-30-00-ufuk-can-bicici/index.tr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
type: phd-thesis-defense
33
title: Koşullu Bilgi Kazanım ile Derin Sinir Ağlarında Koşullu Hesaplama Teknikleri
44
name: Ufuk Can Biçici
5-
time: 2024-06-05T13:30:00
5+
datetime: 2024-06-05T13:30:00
66
duration: 2h
77
location: Ali Vahit Şahiner (AVŞ)
88
---

content/events/2024-07-05t11-00-00-computer-engineering/index.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
type: special-event
33
title: Graduation Ceremony 2024
44
name: Computer Engineering
5-
time: 2024-07-05T11:00:00
5+
datetime: 2024-07-05T11:00:00
66
duration: 2h
77
location: Albert Long Hall
88
---

content/events/2024-07-05t11-00-00-computer-engineering/index.tr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
type: special-event
33
title: Mezuniyet Töreni 2024
44
name: Bilgisayar Mühendisliği
5-
time: 2024-07-05T11:00:00
5+
datetime: 2024-07-05T11:00:00
66
duration: 2h
77
location: Albert Long Hall
88
---

content/events/2024-07-05t19-00-00-software-engineering/index.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
type: special-event
33
title: Graduation Ceremony 2024
44
name: Software Engineering
5-
time: 2024-07-05T19:00:00
5+
datetime: 2024-07-05T19:00:00
66
duration: 2h
77
location: Albert Long Hall
88
---

content/events/2024-07-05t19-00-00-software-engineering/index.tr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
type: special-event
33
title: Mezuniyet Töreni 2024
44
name: Yazılım Mühendisliği
5-
time: 2024-07-05T19:00:00
5+
datetime: 2024-07-05T19:00:00
66
duration: 2h
77
location: Albert Long Hall
88
---

i18n/en.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ events:
3131
upcoming-events:
3232
other: upcoming events
3333

34+
past-events:
35+
other: past events
36+
3437
latest-stories:
3538
other: latest stories
3639

i18n/tr.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ latest-news:
2828
upcoming-events:
2929
other: gelecek etkinlikler
3030

31+
past-events:
32+
other: geçmiş events
33+
3134
latest-stories:
3235
other: en yeni haberler
3336

layouts/partials/bouncmpe/eventbar-card.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{{ $event_title := .Params.title }}
2-
{{ $event_description := .Params.description }}
3-
{{ $event_start_time := .Params.time | time.AsTime }}
2+
{{ $event_start_time := .Params.datetime | time.AsTime }}
43
{{ $event_duration := .Params.duration | time.ParseDuration }}
54
{{ $event_end_time := $event_start_time.Add $event_duration }}
65
{{ $event_location := .Params.location }}
@@ -26,7 +25,7 @@
2625
</div>
2726
{{/*
2827
Strecthed link applies to the card body due to a dummy transform property has set.
29-
See https://getbootstrap.com/docs/5.2/helpers/stretched-link/#identifying-the-containing-block
28+
See https://getbootstrap.com/docs/5.3/helpers/stretched-link/#identifying-the-containing-block
3029
*/}}
3130
<div class="card-body" style="transform: rotate(0);">
3231
{{ if .Content }}<a href="{{ .RelPermalink }}" class="stretched-link"></a>{{ end }}

layouts/partials/bouncmpe/eventbar.html

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
{{ $events := where site.RegularPages "Section" "events" }}
2+
{{ $sorted := sort $events "Params.datetime" }}
3+
4+
{{ $future_events := slice }}
5+
{{ range $sorted }}
6+
{{ if ge (time.AsTime .Params.datetime) now }}
7+
{{ $future_events = $future_events | append . }}
8+
{{ end }}
9+
{{ end }}
10+
11+
{{ $past_events := slice }}
12+
{{ range $sorted }}
13+
{{ if lt (time.AsTime .Params.datetime) now }}
14+
{{ $past_events = $past_events | append . }}
15+
{{ end }}
16+
{{ end }}
217

3-
{{ if $events }}
418
<section id="eventbar">
519
<h1 class="display-6 my-4">{{ i18n "upcoming-events" | title }}</h1>
20+
{{ if $future_events }}
621
<div class="row row-cols-1 g-2 m-1">
7-
{{ range (first 6 $events) }}
22+
{{ range (first 6 $future_events) }}
823
{{ partial "bouncmpe/eventbar-card.html" . }}
924
{{end}}
1025
</div>
26+
{{ end }}
1127
<div class="row p-3">
1228
<div class="card rounded-4">
1329
<ul class="list-group list-group-flush">
@@ -19,5 +35,12 @@ <h1 class="display-6 my-4">{{ i18n "upcoming-events" | title }}</h1>
1935
</ul>
2036
</div>
2137
</div>
38+
{{ if le (len $future_events) 2 }}
39+
<h1 class="display-6 my-4">{{ i18n "past-events" | title }}</h1>
40+
<div class="row row-cols-1 g-2 m-1">
41+
{{ range (first 3 $past_events.Reverse) }}
42+
{{ partial "bouncmpe/eventbar-card.html" . }}
43+
{{end}}
44+
</div>
45+
{{ end }}
2246
</section>
23-
{{ end }}

0 commit comments

Comments
 (0)