From 8b5867e28b82997db1c2e66e00cb30c00282a1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szczepanik?= Date: Thu, 19 Mar 2026 18:38:04 +0100 Subject: [PATCH 1/2] Split project members into current and past If there are associations (with a person) with a defined end, they will be shown in a separate list. The list will be sorted in a reverse order of end date (that is, most recent alumni at the top). The time period of the association will be shown, with "since..." or "until..." inserted if either start or end time are missing. Note that, on either Start or End, `at_time` is not a required field; an End which only defines `at_location`, or even one without any properties (other than the schema class), would be valid. This necessitates slightly clumsy checks on properties. In the absence of a defined end, a person is assumed to be a current member. This commit does not change that (filtering by `.ended` has been done previously), it merely exposes the distinction by also showing associations which ended. This means: a project page will be only as good as the information in the pool. There are possible edge cases, in which a person was associated with a project more then once (e.g. with different roles over two time periods). Because we are iterating over associations, not associated persons, a person could be listed in two lists (current and past). I am curerently not sure whether we should be grouping by person instead, and if so, how to implement that, but it does not seem critical. --- page_templates/project.md.j2 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/page_templates/project.md.j2 b/page_templates/project.md.j2 index 3feb34e..da92292 100644 --- a/page_templates/project.md.j2 +++ b/page_templates/project.md.j2 @@ -7,6 +7,9 @@ {% endfor -%} {%- endif -%} {%- endmacro -%} +{% macro assoc_period(ass, pre="") -%} +{% if ass.started is defined and ass.started.at_time is defined and ass.ended is defined and ass.ended.at_time is defined %}{{ pre ~ ass.started.at_time }} -- {{ ass.ended.at_time }}{% elif ass.started is defined and ass.started.at_time is defined %}{{ pre ~ "since"}} {{ass.started.at_time }}{% elif ass.ended is defined and ass.ended.at_time is defined %}{{pre ~ "until"}} {{ ass.ended.at_time }}{% endif %} +{%- endmacro -%} --- title: "{{ title }}" {{ taxonomy_terms('projects', 'xyzri:XYZProject', parts, typeattr='schema_type', pidattr='pid') -}} @@ -22,10 +25,22 @@ params: ## People +### Currently associated + {% for ass in associated_with if ass.object.schema_type == "xyzri:XYZPerson" and not ass.ended -%} - [{{ ass.object.given_name }} {{ ass.object.family_name }}](/{{ ass.object.pid|replace('xyzrins:', '') }}) ({% for role in ass.roles %}{{ ', ' if not loop.first }}{{ role.display_label|default(role.name) }}{% endfor -%}) {% endfor -%} +{% with prev_associated = associated_with | selectattr("object.schema_type", "eq", "xyzri:XYZPerson") | selectattr("ended", "defined") -%} +{% for ass in prev_associated | sort(attribute="ended.at_time", reverse=True) -%} +{% if loop.first %} +### Previously associated + +{% endif -%} +- [{{ ass.object.given_name }} {{ ass.object.family_name }}](/{{ ass.object.pid|replace('xyzrins:', '') }}) ({% for role in ass.roles %}{{ ', ' if not loop.first }}{{ role.display_label|default(role.name) }}{% endfor -%} {{ assoc_period(ass, "; ") }}) +{% endfor -%} +{% endwith -%} + {% if generated|length -%} ## Outputs -- 2.52.0 From 74cf9f7543f552a7ba08217d4d06a129b43fcb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szczepanik?= Date: Fri, 20 Mar 2026 20:00:50 +0100 Subject: [PATCH 2/2] Add association descriptions to project page An association can have a description. It probably makes sense to show it on the page which lists those associations. For past members, it could be e.g. "left to become xyz at jkl"; in general it can be anything that's contextual for the association. Jinja-wise, `(" \n " ~ ass.description).rstrip()` will reduce to an empty string string if description is empty; otherwise it will be two empty spaces (new line) and a two-space indented description, which should fill out a list item nicely. --- page_templates/project.md.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/page_templates/project.md.j2 b/page_templates/project.md.j2 index da92292..853ee26 100644 --- a/page_templates/project.md.j2 +++ b/page_templates/project.md.j2 @@ -28,7 +28,7 @@ params: ### Currently associated {% for ass in associated_with if ass.object.schema_type == "xyzri:XYZPerson" and not ass.ended -%} -- [{{ ass.object.given_name }} {{ ass.object.family_name }}](/{{ ass.object.pid|replace('xyzrins:', '') }}) ({% for role in ass.roles %}{{ ', ' if not loop.first }}{{ role.display_label|default(role.name) }}{% endfor -%}) +- [{{ ass.object.given_name }} {{ ass.object.family_name }}](/{{ ass.object.pid|replace('xyzrins:', '') }}) ({% for role in ass.roles %}{{ ', ' if not loop.first }}{{ role.display_label|default(role.name) }}{% endfor -%}){{ (" \n " ~ ass.description).rstrip() }} {% endfor -%} {% with prev_associated = associated_with | selectattr("object.schema_type", "eq", "xyzri:XYZPerson") | selectattr("ended", "defined") -%} @@ -37,7 +37,7 @@ params: ### Previously associated {% endif -%} -- [{{ ass.object.given_name }} {{ ass.object.family_name }}](/{{ ass.object.pid|replace('xyzrins:', '') }}) ({% for role in ass.roles %}{{ ', ' if not loop.first }}{{ role.display_label|default(role.name) }}{% endfor -%} {{ assoc_period(ass, "; ") }}) +- [{{ ass.object.given_name }} {{ ass.object.family_name }}](/{{ ass.object.pid|replace('xyzrins:', '') }}) ({% for role in ass.roles %}{{ ', ' if not loop.first }}{{ role.display_label|default(role.name) }}{% endfor -%} {{ assoc_period(ass, "; ") }}){{ (" \n " ~ ass.description).rstrip() }} {% endfor -%} {% endwith -%} -- 2.52.0