{% extends "base.html" %}
  {% block title %}
    {{ person.firstname }} {{ person.lastname }}
  {% endblock title %}

  {% block headers %}
<h2>{{ person.firstname }} {{ person.lastname }}</h2>
  {% endblock headers %}

  {% block info %}
    {% if person.user %}
[{{ person.user.username }}]</p>
    {% endif %}  
  {% endblock info %}

  {% block content %}
  {{ person.html_admin_buttons() }}
  {% if person.editable %}
  <a class="admin" href="arxiv">[manage arxiv papers]</a>
  {% endif %}


    {% if person.affiliation %}
<p>
      {% if person.position %}
  {{ person.position }}, 
      {% endif %}
  {{ person.affiliation }}</p>
    {% endif %}
    
    {% if person.email %}
<p><strong>Email:</strong> <i>{{ person.email_hidden() }}</i>
    {% endif %}

    {% if person.description %}
<p>{{ person.description }}</p>
    {% endif %}

    {% if person.home_page %}
<p><strong>Home-page:</strong> <a class="external" href="{{ person.home_page }}">{{ person.home_page }}</a> </p>
    {% endif %}

    {% if person.arxiv_id %}
<p><strong>arxiv id:</strong> <a class="external" href="https://arxiv.org/a/{{ person.arxiv_id|urlencode }}.html">{{ person.arxiv_id }}</a></p>
    {% endif %}

    {% if person.orcid_id %}
  <p><strong>orcid id:</strong> <a class="external" href="https://orcid.org/{{ person.orcid_id|urlencode }}">{{ person.orcid_id }}</a></p>
    {% endif %}
  
    {% if papers %}

  <h2>Available papers ({{ papers|length }}):</h2>
<a href='/paper/list/?author={{ person.id }}&txt'>[plain text]</a>
<ul>
      {% for paper in papers %}
<li> {{ paper.html() }} {{ paper.html_admin_buttons() }}</li>
      {% endfor %}
</ul>
    {% endif %}

    {% if seminars %}
<h2>Seminars:</h2>
<ul>
      {% for seminar in seminars %}
<li><i>{{ seminar.date|date }}:</i> <a href="{{ seminar.url() }}">{{ seminar.title }}</a> {{ seminar.html_admin_buttons() }}</li>
      {% endfor %}
</ul>
    {% endif %}

    {% if speaker_events %}
<h2>Speaker:</h2>
<ul>
      {% for event in speaker_events %}
<li><i>{{ event.date_from|date }} - {{ event.date_to|date }}:</i> <a href="{{ event.url() }}">{{ event.title }}</a> {{ event.html_admin_buttons() }}</li>
      {% endfor %}
</ul>
    {% endif %}

    {% if organizer_events %}
<h2>Organizer:</h2>
<ul>
      {% for event in organizer_events %}
<li><i>{{ event.date_from|date }} - {{ event.date_to|date }}:</i> <a href="{{ event.url() }}">{{ event.title }}</a> {{ event.html_admin_buttons() }}</li>
      {% endfor %}
</ul>
    {% endif %}

{% endblock content %}
