52 lines
1.6 KiB
HTML
52 lines
1.6 KiB
HTML
{% extends "minecraft_manager/dashboard.html" %}
|
|
{% load csrf_html %}
|
|
{% load static %}
|
|
{% block title %}Alerts{% endblock %}
|
|
{% block section %}
|
|
<div id="content" hidden="hidden">
|
|
<table id="model-table" class="table table-striped table-hover link-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Message</th>
|
|
<th>Seen</th>
|
|
<th>Date</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for alert in alerts %}
|
|
<tr data-id="{{ alert.id }}">
|
|
<td>{{ alert.snippet }}</td>
|
|
<td>
|
|
{% if alert.seen %}
|
|
<span><i class="glyphicon glyphicon-ok-circle text-success"></i></span>
|
|
{% else %}
|
|
<span><i class="glyphicon glyphicon-remove-circle text-danger"></i></span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ alert.date }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% if unseen > 0 %}
|
|
<form method="post">{% autoescape off %}{% get_csrf_html request %}{% endautoescape %}
|
|
<button type="submit" class="btn btn-primary" name="action" value="mar">Mark all as read</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$("#model-table").DataTable({
|
|
'lengthMenu': [ [ 10, 25, 50, 100, -1 ], [ 10, 25, 50, 100, "All" ] ],
|
|
'initComplete': function(settings, json) {
|
|
$("#content").show();
|
|
},
|
|
'order': [],
|
|
{% if user.usersettings %}
|
|
'pageLength': {{ user.usersettings.default_results }},
|
|
{% endif %}
|
|
});
|
|
});
|
|
|
|
</script>
|
|
{% endblock section %} |