{% 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">
    {% trans 'New Project' %}
  </a>
{% endblock %}

{% block content %}

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

    <thead>
      <tr>
        <th style="width: 25%">{% trans 'Project' %}</th>
        <th style="width: 45%">{% trans 'Description' %}</th>
        <th style="width: 30%">
          <form class="form-inline">
            <div class="row">
              <div class="col-sm-8">
                <input type="text" name="project_name" class="form-control form-control-sm" placeholder={% trans 'Project' %} />
              </div>
              <div class="col-sm">
                <input type="submit" class="btn btn-primary btn-sm" value={% trans 'Search' %}>
              </div>
            </div>

          </form>
        </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-light 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 %}
