Skip to content
Snippets Groups Projects
organization_short.html 1.24 KiB
Newer Older
Erxleben, Fredo's avatar
Erxleben, Fredo committed
    Inserts the abbreviation of an organization of a person, followed by a
    slash, if something was printed at all.

    Assumes that there is a variable "person" already defined.
    It holds a key "organization" and an associated value which is a foreign key
    into _data/hifis_organizations.yml
    If the key is not present, an informative HTML comment will be inserted.
{%- assign person = include.person -%}
{%- if person -%}
    {%- if person.location.campus -%}
Erxleben, Fredo's avatar
Erxleben, Fredo committed
        <span class="org-short">
            {%- assign organization =  site.data.helmholtz-centers[person.location.campus] -%}
            {%- if organization -%}
Erxleben, Fredo's avatar
Erxleben, Fredo committed
                {{ organization.abbreviation }}
Erxleben, Fredo's avatar
Erxleben, Fredo committed
                <!-- NOTE: No further organization info, fallback to verbatim input -->
                <em>{{ person.location.campus }}</em>
Erxleben, Fredo's avatar
Erxleben, Fredo committed
        </span>
        /
Erxleben, Fredo's avatar
Erxleben, Fredo committed
        <!--
            NOTE: team_card/organization_short.html was included,
            but person.organization was not defined
        -->
    {%- endif -%}
{%- else -%}
Erxleben, Fredo's avatar
Erxleben, Fredo committed
    <!--
        WARNING: team_card/organization_short.html was included,
        but no person object was defined
    -->