All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 35s
33 lines
1.4 KiB
Django/Jinja
33 lines
1.4 KiB
Django/Jinja
{% macro taxonomy_terms(taxonomy, type, objects, typeattr='object.schema_type', pidattr='object.pid') -%}
|
|
{%- set matching = objects|selectattr(typeattr, 'eq', type)|map(attribute=pidattr)|map('replace', 'xyzrins:' ~ taxonomy ~ '/', '')|sort -%}
|
|
{% if matching|length -%}
|
|
{{ taxonomy }}:
|
|
{% for pid in matching -%}
|
|
- {{ pid }}
|
|
{% endfor -%}
|
|
{%- endif -%}
|
|
{%- endmacro -%}
|
|
---
|
|
title: "{{ title }}"
|
|
{{ taxonomy_terms('projects', 'xyzri:XYZProject', parts, typeattr='schema_type', pidattr='pid') -}}
|
|
{{ taxonomy_terms('persons', 'xyzri:XYZPerson', associated_with) -}}
|
|
{{ taxonomy_terms('instruments', 'xyzri:XYZInstrument', generated, typeattr='schema_type', pidattr='pid') -}}
|
|
---
|
|
|
|
{{ description }}
|
|
|
|
{% if part_of %}This project is part of{% for p in part_of %} [{{ p.title }}](/{{ p.pid|replace('xyzrins:', '') }}){% endfor %}.{% endif %}
|
|
|
|
## People
|
|
|
|
{% 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 -%}
|
|
|
|
{% if generated|length -%}
|
|
## Outputs
|
|
|
|
{% for gen in generated -%}
|
|
- [{{ gen.display_label|default(gen.title)|default(gen.name) }}]({{ gen.pid|replace('xyzrins:', '/') }})
|
|
{% endfor -%}
|
|
{% endif %}
|