{% extends "base.html" %}
{% block title %}{{ person.name }}{% endblock %}
{#- Unlike the other pages, this one is meant to be found. -#}
{% block meta %}
{%- if !person.summary.is_empty() %}
<meta name="description" content="{{ person.summary }}">
{%- endif %}
{% endblock %}
{% block content %}
<section class="space-y-2">
<h1 class="text-2xl font-semibold tracking-tight">{{ person.name }}</h1>
<p class="text-sm text-muted-foreground">
<a href="{{ person.orcid_url }}" class="hover:underline">{{ person.orcid_url }}</a> ·
<a href="{{ person.commonmeta_url }}" class="hover:underline">commonmeta</a>
{%- if !person.country.is_empty() %} · {{ person.country }}{% endif %}
</p>
{%- if !person.given_name.is_empty() || !person.family_name.is_empty() %}
<p class="text-sm text-muted-foreground">
{%- if !person.given_name.is_empty() %}Given name: {{ person.given_name }}{% endif %}
{%- if !person.given_name.is_empty() && !person.family_name.is_empty() %} · {% endif %}
{%- if !person.family_name.is_empty() %}Family name: {{ person.family_name }}{% endif %}
</p>
{%- endif %}
{%- if !person.additional_names.is_empty() %}
<p class="text-sm text-muted-foreground">Also known as {{ person.additional_names }}</p>
{%- endif %}
{%- for paragraph in person.description %}
<p class="text-sm">{{ paragraph }}</p>
{%- endfor %}
</section>
{%- if !person.affiliations.is_empty() %}
<section class="mt-6 rounded-lg border bg-card p-5 space-y-2">
<h2 class="font-semibold">Affiliations</h2>
{%- for affiliation in person.affiliations %}
<div class="text-sm">
{%- if let Some(ror) = affiliation.ror %}
<a href="{{ ror }}" class="font-medium hover:underline">{{ affiliation.name }}</a>
{%- else %}
<span class="font-medium">{{ affiliation.name }}</span>
{%- endif %}
{%- if !affiliation.role.is_empty() %} · {{ affiliation.role }}{% endif %}
{%- if !affiliation.dates.is_empty() %} · <span class="text-muted-foreground">{{ affiliation.dates }}</span>{% endif %}
</div>
{%- endfor %}
</section>
{%- endif %}
{%- if !person.urls.is_empty() %}
<section class="mt-4 rounded-lg border bg-card p-5 space-y-2">
<h2 class="font-semibold">Links</h2>
{%- for link in person.urls %}
<div class="text-sm"><a href="{{ link.url }}" class="hover:underline">{{ link.name }}</a></div>
{%- endfor %}
</section>
{%- endif %}
{%- if !featured.is_empty() %}
<section class="mt-4 rounded-lg border bg-card p-5">
<h2 class="font-semibold">Featured</h2>
<ul>
{%- for work in featured %}
{% include "work.html" %}
{%- endfor %}
</ul>
</section>
{%- endif %}
<section class="mt-4 rounded-lg border bg-card p-5" id="publications">
<h2 class="font-semibold">My Publications</h2>
<p class="mt-1 text-sm text-muted-foreground">
{{- total }} {% if total == 1 %}work{% else %}works{% endif %}
{%- if let Some(tag) = tag %} tagged {{ tag }} · <a href="{{ all_href }}" class="underline">show all</a>{% endif %}
</p>
{%- if !tags.is_empty() %}
<p class="mt-3 text-sm">
{%- for link in tags %}
<a href="{{ link.href }}" class="mr-3 {% if link.active %}font-semibold{% else %}text-muted-foreground{% endif %} hover:underline">{{ link.name }} ({{ link.count }})</a>
{%- endfor %}
</p>
{%- endif %}
<ul>
{%- for work in works %}
{% include "work.html" %}
{%- endfor %}
</ul>
{%- if previous_href.is_some() || next_href.is_some() %}
<nav class="mt-3 flex items-center justify-between text-sm">
<span>{% if let Some(href) = previous_href %}<a href="{{ href }}" class="underline">Previous</a>{% endif %}</span>
<span>{% if let Some(href) = next_href %}<a href="{{ href }}" class="underline">Next</a>{% endif %}</span>
</nav>
{%- endif %}
</section>
{% endblock %}