{% extends 'core/page.html' %}
{% load i18n %}
{% load core_tags %}
{% load accounts_tags %}

{% block sidebar %}

    <h2>{% trans 'My Data' %}</h2>

    {% user_data_as_dl user %}

    <h2>{% trans 'My Groups' %}</h2>

    <h2>{% trans 'Options' %}</h2>

    <ul class="list-unstyled">
        <li>
            <a href="{% url 'project_create' %}">{% trans 'Create new project' %}</a>
        </li>

     <h2>{% trans 'Import' %}</h2>
     <ul class="list-unstyled">
       <li>
          {% include 'core/import_form.html' with import_url_name="project_import" filetype='xml'%}
       </li>
     </ul>
    </ul>

{% endblock %}

{% block page %}

    <h1>{% trans 'My Projects' %}</h1>

    <table class="table">
        <thead>
            <tr>
                <th>{% trans 'Name' %}</th>
                <th>{% trans 'Role' %}</th>
                <th>{% trans 'Created' %}</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            {% for project in projects %}
            <tr>
                <td>
                    <a href="{% url 'project' project.pk %}">{{ project.title }}</a>
                </td>
                <td>
                    {{ project.role }}
                </td>
                <td>
                    {{ project.created }}
                </td>
                <td class="text-right">
                    <a href="{% url 'project_update' project.pk %}?next={% url 'projects' %}" class="fa fa-pencil"></a>
                    <a href="{% url 'project_delete' project.pk %}?next={% url 'projects' %}" class="fa fa-trash"></a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

{% endblock %}
