From 39db962a2caaafca6144cac52dbdf05f7f7c8a17 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Fri, 29 Sep 2023 17:49:45 +0200 Subject: [PATCH] temporarily show participants again in the course-management --- flake.nix | 2 +- .../0001-show-participants-again.patch | 25 +++++++++++++++++++ .../default.nix} | 8 ++++-- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 modules/course-management/0001-show-participants-again.patch rename modules/{course-management.nix => course-management/default.nix} (92%) diff --git a/flake.nix b/flake.nix index 10cbe22..547cda9 100755 --- a/flake.nix +++ b/flake.nix @@ -53,7 +53,7 @@ ./modules/vaultwarden.nix ./modules/website.nix ./modules/zsh.nix - ./modules/course-management.nix + ./modules/course-management ./modules/courses-phil.nix ./modules/gitea.nix { diff --git a/modules/course-management/0001-show-participants-again.patch b/modules/course-management/0001-show-participants-again.patch new file mode 100644 index 0000000..be88b1e --- /dev/null +++ b/modules/course-management/0001-show-participants-again.patch @@ -0,0 +1,25 @@ +From 2f0cb978f180d073f02c2327bb627698116135e0 Mon Sep 17 00:00:00 2001 +From: Rouven Seifert +Date: Fri, 29 Sep 2023 17:37:01 +0200 +Subject: [PATCH] show-participants-again + +--- + course-management/course/templates/subject/info.html | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/course-management/course/templates/subject/info.html b/course-management/course/templates/subject/info.html +index 55f1620..d1724a4 100644 +--- a/course-management/course/templates/subject/info.html ++++ b/course-management/course/templates/subject/info.html +@@ -55,7 +55,7 @@ + {% if course.saturated %} + {% trans 'full' %} + {% else %} +- {% trans 'free places' %} ++ {{ course.enrolled_students }}/{{ course.max_participants }} + {% endif %} + {% else %} + {% trans 'unavailable' %} +-- +2.42.0 + diff --git a/modules/course-management.nix b/modules/course-management/default.nix similarity index 92% rename from modules/course-management.nix rename to modules/course-management/default.nix index d5ed99a..75cd1ce 100644 --- a/modules/course-management.nix +++ b/modules/course-management/default.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ pkgs, config, lib, ... }: let hostName = "kurse.${config.networking.domain}"; in @@ -15,7 +15,11 @@ in services.course-management = { inherit hostName; enable = true; - + package = (pkgs.course-management.overrideAttrs (_: { + patches = [ + ./0001-show-participants-again.patch + ]; + })); settings = { secretKeyFile = config.sops.secrets."course-management/secret-key".path; adminPassFile = config.sops.secrets."course-management/adminpass".path;