All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 1m33s
The to-be-rendered items are now determined upfront, and the inclusion of a heading is made conditional on the presence of any item.
59 lines
2.4 KiB
Django/Jinja
59 lines
2.4 KiB
Django/Jinja
{% extends "page.md.j2" %}
|
|
|
|
{%- set objectives = influenced_by | selectattr("object.schema_type", "eq", "xyzri:XYZObjective") | selectattr("ended", "undefined") | list -%}
|
|
{%- set curr_associated = associated_with | selectattr("object.schema_type", "eq", "xyzri:XYZPerson") | selectattr("ended", "undefined") | list -%}
|
|
{%- set prev_associated = associated_with | selectattr("object.schema_type", "eq", "xyzri:XYZPerson") | selectattr("ended", "defined") | list -%}
|
|
|
|
{% block frontmatter -%}
|
|
title: "{{ title }}"
|
|
{{ taxonomy_terms('projects', 'xyzri:XYZProject', parts, typeattr='schema_type', pidattr='pid') -}}
|
|
{{ taxonomy_terms('objectives', 'xyzri:XYZObjective', influenced_by) -}}
|
|
{{ taxonomy_terms('persons', 'xyzri:XYZPerson', associated_with) -}}
|
|
{{ taxonomy_terms('instruments', 'xyzri:XYZInstrument', generated, typeattr='schema_type', pidattr='pid') -}}
|
|
{% endblock -%}
|
|
|
|
{% block content -%}
|
|
{{ description }}
|
|
|
|
{% if part_of %}## Part of
|
|
{% for item in part_of -%}
|
|
- [{{ item.title }}](/{{ item.pid.replace('xyzrins:', '') }})
|
|
{% endfor %}
|
|
{% endif -%}
|
|
|
|
{% if objectives -%}
|
|
## Objectives
|
|
|
|
{% for inf in objectives -%}
|
|
- [{{ inf.object.title }}](/{{ inf.object.pid|replace('xyzrins:', '') }}) ({%for role in inf.roles %}{{ ', ' if not loop.first }}{{ role.display_label|default(role.name) }}{% endfor -%})
|
|
{% endfor -%}
|
|
{% endif -%}
|
|
|
|
{% if curr_associated or prev_associated -%}
|
|
## People
|
|
|
|
{% if curr_associated -%}
|
|
### Currently associated
|
|
|
|
{% for ass in curr_associated -%}
|
|
- [{{ 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 -%}
|
|
{% endif -%}
|
|
|
|
{% if prev_associated -%}
|
|
### Previously associated
|
|
{% for ass in prev_associated -%}
|
|
|
|
- [{{ 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 -%}
|
|
{% endif -%}
|
|
{% endif -%}
|
|
|
|
{% if generated -%}
|
|
## Outputs
|
|
|
|
{% for gen in generated -%}
|
|
- [{{ gen.display_label|default(gen.title)|default(gen.name) }}]({{ gen.pid|replace('xyzrins:', '/') }})
|
|
{% endfor -%}
|
|
{% endif %}
|
|
{% endblock %}
|