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

{% block navbar_app %}
{% include 'app_home/_sidebar.html' %}
{% endblock %}


{% block title %}
<h2>{% translate "Data Revisions" %}</h2>
<small class="text-muted">{{ count }} {% translate "entries" %}</small>
<hr>
{% endblock %}


{% block content %}


{% if revisions %}
<div class="mb-3">
  <a href="?page={{ page|add:1 }}&size={{ size }}" class="btn btn-primary">
    {% translate "Next" %} <i class="fa fa-chevron-right"></i>
  </a>
</div>
<hr>

<table id="table_managed_off" class="table table-striped table-hover small">
<thead class="thead-dark"><tr>
<th>{% translate "ID" %}</th>
<th>{% translate "Date" %}</th>
<th>{% translate "Schema" %}</th>
<th>{% translate "Instance" %}</th>
<th>{% translate "Display Name" %}</th>
<th>{% translate "Action" %}</th>
<th>{% translate "User" %}</th>
</tr>
</thead>
<tbody>
{% for revision in revisions %}
<tr>
<td class="py-1 text-left">{{ revision.id }}</td>
<td class="py-1 px-1 mx-0">{{ revision.date|date:'Y-m-d H:i:s (D)' }}</td>
<td class="py-1 text-left">{{ revision.classname }}</td>
<td class="py-1 text-left">{{ revision.keyname }}</td>
<td class="py-1 text-left">{{ revision.displayname|default:"" }}</td>
<td class="py-1 text-left">{{ revision.action }}</td>
<td class="py-1 text-left">{{ revision.username }}</td>
</tr>
{% endfor %}
</tbody>
</table>

{% else %}
<div class="alert alert-info">
  <p>{% translate "No more revision entries found." %}</p>
</div>
{% endif %}

{% endblock %}
