{% extends "karaage/common/profile_base.html" %}
{% load karaage_tags %}
{% load forms %}{% load filters %}


{% block title %}Personal Details - My profile{% endblock %}
{% block profile_title %}Personal Details{% endblock %}


{% block profile_content %}
<div class="module">
    <h2>Personal</h2>

    <div class="table-container">
        <table class="keyvalue">
            <tr><th>Username:</th><td>{{ person.username }}</td></tr>
            <tr><th>Email:</th><td>{{ person.email|urlize }}</td></tr>
            <tr><th>Position:</th><td>{{ person.position|default:"" }}</td></tr>
            <tr><th>Department:</th><td>{{ person.department|default:"" }}</td></tr>
            <tr>
                <th>Institutes:</th>
                <td>{{ person.institute }}<br/>
                    {% for institute in person.institutes.all %}{{institute}}
                    {% if not forloop.last %}, {% endif %}
                    {% endfor %}
                </td>
            </tr>
            {% if person.telephone %}<tr><th>Phone:</th><td>{{ person.telephone|default:"" }}</td></tr>{% endif %}
            {% if person.mobile %}<tr><th>Mobile:</th><td>{{ person.mobile|default:"" }}</td></tr>{% endif %}
            {% if person.fax %}<tr><th>Fax:</th><td>{{ person.fax }}</td></tr>{% endif %}
            {% if person.address %}<tr><th>Address:</th><td>{{ person.address|linebreaksbr|default:"" }}</td></tr>{% endif %}
        </table>
    </div>

    <div class="object-tools">
        <ul>
            <li><a href="{% url 'kg_profile_edit' %}" class="changelink">Edit personal details</a></li>
            <li><a href="{% url 'kg_profile_password' %}" class="changelink">Change password</a></li>
            {% for_each_app_include "profile_personal_detail_tools.html" %}
        </ul>
    </div>
</div>

{% if person.is_delegate %}
<div class="module">
    <h2>Institute Stats</h2>
    <p><a href="{% url 'kg_institute_users' person.institute.id %}">{{ person.institute }} users</a> |
    <a href="{% url 'kg_institute_projects' person.institute.id %}">{{ person.institute }} projects</a></p>
</div>
{% endif %}

{% for_each_app_include "profile_personal_detail_extra.html" %}

{% endblock %}
