summaryrefslogtreecommitdiff
path: root/html/education/default.nix
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2023-08-21 17:50:43 +0200
committerquentin@aristote.fr <quentin@aristote.fr>2023-08-23 18:29:57 +0200
commitbaea04747697ad5039139ef44bca7b3965147696 (patch)
tree6da0d87642c19120d913b66b1734d3de6fbb385d /html/education/default.nix
parent5752f0a1017f33c78428a915d3bcf2ccd80f3e79 (diff)
update info api
Diffstat (limited to 'html/education/default.nix')
-rw-r--r--html/education/default.nix45
1 files changed, 22 insertions, 23 deletions
diff --git a/html/education/default.nix b/html/education/default.nix
index e1027e3..56f0915 100644
--- a/html/education/default.nix
+++ b/html/education/default.nix
@@ -1,38 +1,37 @@
{ html, data, lib, ... }:
-let education = data.education;
+let
+ education = data.education;
+ sortByDateStart = html.sort.reverse.byFun
+ (item: with item.date.start; day + 100 * month + 10000 * year);
in {
title = "Education";
priority = 30;
body = with html;
- dl (for (sort.reverse.byPath [ "date" "start" ] education) (item:
- with item;
- lines [
+ dl (for (sortByDateStart education) (item:
+ with item; [
(dt [
(with institution; "${studyType} @ ${href url name}, ${location}")
br
(with date; small (timerange start end))
])
(dd [
- (lib.optionalString (lib.hasAttr "years" item) (lines
- (for (sort.reverse.byPath [ "date" "start" ] years) (year:
- with year;
- details [
- (summary [
- (with program;
- "${studyType} @ ${
- href url (abbr { title = name; } acronym)
- }")
- br
- (with date; small (timerange start end))
- ])
- description
- (lines (for courses (category: list:
- details [
- (summary "${category} courses")
- (lib.concatStringsSep " · " (lib.naturalSort list))
- ])))
- ]))))
+ (lib.optionalString (item ? years) (for (sortByDateStart years) (year:
+ with year;
+ details [
+ (summary [
+ (with program;
+ "${studyType} @ ${href url (abbr { title = name; } acronym)}")
+ br
+ (with date; small (timerange start end))
+ ])
+ description
+ (for courses (category: list:
+ details [
+ (summary "${category} courses")
+ (lib.concatStringsSep " · " (lib.naturalSort list))
+ ]))
+ ])))
description
])
]));