Files
PyRIGS/RIGS/templates/RIGS/activity_stream.html
2015-05-23 02:23:31 +01:00

95 lines
3.1 KiB
HTML

{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
{% load static %}
{% block title %}Rigboard Activity Stream{% endblock %}
{% block js %}
<script src="{% static "js/tooltip.js" %}"></script>
<script src="{% static "js/popover.js" %}"></script>
<script src="{% static "js/moment.min.js" %}"></script>
<script>
$(function () {
$('[data-toggle="popover"]').popover();
// This keeps timeago values correct, but uses an insane amount of resources
// $(function () {
// setInterval(function() {
// $('.date').each(function (index, dateElem) {
// var $dateElem = $(dateElem);
// var formatted = moment($dateElem.attr('data-date')).fromNow();
// $dateElem.text(formatted);
// })
// });
// }, 10000);
$('.date').each(function (index, dateElem) {
var $dateElem = $(dateElem);
var formatted = moment($dateElem.attr('data-date')).fromNow();
$dateElem.text(formatted);
});
})
</script>
{% endblock %}
{% block content %}
{# comment "table view" #}
<h2>Rigboard Activity Stream - Table View</h2>
<br>
<table class="table table-striped">
<thead>
<tr>
<td>Date</td>
<td>Event</td>
<td>Version ID</td>
<td>User</td>
<td>Changes</td>
</tr>
</thead>
<tbody>
{% for version in object_list %}
{% if version.item_changes or version.field_changes %}
<tr>
<td>{{ version.revision.date_created|date:"RIGS_DATETIME_FORMAT" }}</td>
<td><a href="{% url 'event_detail' version.new.pk %}">N{{ version.new.pk|stringformat:"05d" }}</a></td>
<td>{{ version.version.pk }}|{{ version.revision.pk }}</td>
<td>{{ version.revision.user.name }}</td>
<td>
{% include 'RIGS/event_version_changes.html' %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{# endcomment #}
<div>
<br>
<h2>Rigboard Activity Stream - Stream View</h2>
<br>
{% for version in object_list %}
{% if version.item_changes or version.field_changes %}
<div class="well">
<button title="title" type="button" class="btn btn-default btn-xs">{{ version.revision.user.first_name|default_if_none:"(unknown)" }}</button> changed
{% include 'RIGS/event_version_changes.html' %}
in <button title="title" type="button" class="btn btn-default btn-xs">N{{ version.new.pk|stringformat:"05d" }}</button> <small>(<span data-date='{{ version.revision.date_created|date:"Y-m-d H:i:s" }}' class="date">{{ version.revision.date_created|date:"RIGS_DATETIME_FORMAT" }}</span>)</small>
</div>
{% endif %}
{% endfor %}
</div>
{{ thediff }}
{% endblock %}