Files
PyRIGS/RIGS/templates/RIGS/event_version_list.html
2015-05-18 15:22:53 +01:00

85 lines
3.1 KiB
HTML

{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
{% load static %}
{% block title %}Revisions{% endblock %}
{% block js %}
<script src="{% static "js/tooltip.js" %}"></script>
<script src="{% static "js/popover.js" %}"></script>
<script>
$(function () {
$('[data-toggle="popover"]').popover()
})
</script>
{% endblock %}
{% block content %}
<table class="table table-striped">
<thead>
<tr>
<td></td>
<td>Date</td>
<td>User</td>
<td>Changes</td>
</tr>
</thead>
<tbody>
{% for version in object_list %}
<tr>
<td>{{ version.pk }}|{{ version.revision.pk }}</td>
<td>{{ version.revision.date_created }}</td>
<td>{{ version.revision.user.name }}</td>
<td>{% for key, old, new in version.changes %}
<button title="Changes to {{ key }}" type="button" class="btn btn-default btn-xs" data-container="body" data-html="true" data-trigger='hover' data-placement='left' data-toggle="popover" data-content='
{% if new %}<div class="alert alert-success">{{new}}</div>{% endif %}
{% if old %}<div class="alert alert-danger">{{old}}</div>{% endif %}
'>{{ key }}</button>
{% endfor %}
{% for key, old, new in version.item_changes %}
<button title="{{ key }}" type="button" class="btn btn-default btn-xs" data-container="body" data-html="true" data-trigger='hover' data-placement='left' data-toggle="popover" data-content='
{% if new %}
<div class="alert alert-success">
<dl>
<dt>Name</dt>
<dd>{{new.name}}</dd>
<dt>Description</dt>
<dd>{{new.description}}</dd>
<dt>Quantity</dt>
<dd>{{new.quantity}}</dd>
<dt>Price</dt>
<dd>{{new.cost}}
</dl>
</div>
{% endif %}
{% if old %}
<div class="alert alert-danger">
<dl>
<dt>Name</dt>
<dd>{{old.name}}</dd>
<dt>Description</dt>
<dd>{{old.description}}</dd>
<dt>Quantity</dt>
<dd>{{old.quantity}}</dd>
<dt>Price</dt>
<dd>{{old.cost}}
</dl>
</div>
{% endif %}
'>{{ key }}</button>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ thediff }}
{% endblock %}