{% extends "base.html" %}
{% load static %}
{% load account %}

{% block title %}User: {{ object.username }}{% endblock %}


{% block content %}

<div class="container">

  <div class="row">
    <div class="col-sm-12">

      <h1>{% user_display object %}</h1>

      <p>
        {% with object.orcid_uri as orcid_uri %}
          {% if orcid_uri %}
            {# The following code is ORCID's recommendation + replacement of the current users data #}
            <div itemscope itemtype="https://schema.org/Person">
              <a itemprop="sameAs" content="{{ orcid_uri }}"
                 href="{{ orcid_uri }}"
                 target="orcid.widget" rel="noopener noreferrer" style="vertical-align:top;">
                <img src="https://orcid.org/sites/default/files/images/orcid_16x16.png" style="width:1em;margin-right:.5em;" alt="ORCID iD icon">orcid.org/{{ object.orcid_id }}
              </a>
            </div>
          {% else %}
            No ORCID Id is associated with this user.
          {% endif %}
        {% endwith %}
      </p>
    </div>
  </div>

{% if object == request.user %}
<!-- Action buttons -->
<div class="row">

  <div class="col-sm-12">
    <a class="btn btn-primary" href="{% url 'users:update' %}" role="button">My Info</a>
    <a class="btn btn-primary" href="{% url 'account_email' %}" role="button">E-Mail</a>
    <!-- Your Stuff: Custom user template urls -->
  </div>

</div>
<!-- End Action buttons -->
{% endif %}

</div>
{% endblock content %}

