{% extends "vault/base_bare.html" %}
{% load i18n static pagination %}

{% block title %}{% trans 'Projects' %}{% endblock %}

{% block css %}
  <link rel="stylesheet" type="text/css" href="{% static 'identity/css/project.css' %}" />
{% endblock %}

{% block title_left %}{% trans 'Projects' %}{% endblock %}

{% block title_right %}
  <a href="{% url 'add_project' %}" class="create-project-btn">
    <i class="icon fas fa-project-diagram"></i>&nbsp;{% trans 'Create Project' %}
  </a>
{% endblock %}

{% block content %}

<div class="box change-project-list">
  <table class="items-list table table-hover">

    <thead>
      <tr>
        <th style="width: 25%">{% trans 'Project' %}</th>
        <th style="width: 50%">{% trans 'Description' %}</th>
        <th style="width: 25%"></th>
      </tr>
    </thead>

    <tbody>
      {% for project in projects %}
      <tr>
        <td>{{ project.name }}</td>
        <td>{{ project.description }}</td>
        <td style="text-align: right">
          <a href="{% url 'set_project' project.id %}" class="btn btn-primary btn-sm">
            {% trans 'Select this Project' %}
          </a>
        </td>
      </tr>
      {% endfor %}
    </tbody>

  </table>
</div>

{% pagination projects %}

{% endblock %}

{% block js_bottom %}
{{ block.super }}
<script>
  Base.Paginator.init();
</script>
<script>
  localStorage.clear();
</script>
{% endblock %}
