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

{% block title %}Identity{% endblock %}

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

{% block content_title %}Identity{% endblock %}

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

{% block content_top %}
  <a href="{% url "add_project" %}" class="create-project btn btn-primary btn-sm">
    <i class="fa fa-sitemap icon-white"></i>&nbsp;{% trans 'Create Project' %}
  </a>
{% endblock %}

{% block content %}
<div class="box">
  <table class="items-list table table-hover">
    <thead>
      <tr>
        <th>{% trans 'Project' %}</th>
        <th>{% trans 'Project Id' %}</th>
        <th>{% trans 'Created By' %}</th>
        <th>{% trans 'Owner' %}</th>
        <th>{% trans 'Enabled' %}</th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      {% for project in projects %}
      <tr>
        <td>{{ project.name }}</td>
        <td>{{ project.id }}</td>
        <td>
          {% if project.created_by %}
          <span class="service-name {{ project.created_by }}">{{ project.created_by }}</span>
          {% endif %}
        </td>
        <td>{{ project.team.name }}</td>
        <td>{{ project.enabled }}</td>
        <td>
          <a href="{% url 'edit_project' project=project_name project_id=project.id %}" class="edit-item btn btn-light btn-sm ">
            {% trans 'Edit' %}
          </a>
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>
{% pagination projects %}
{% endblock %}

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