mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 04:20:17 +02:00
Merge branch '1416-timerboard-datatables' into 'master'
[CHANGE] Timertables to Datatables Closes #1416 See merge request allianceauth/allianceauth!1676
This commit is contained in:
commit
1b6cf98885
@ -2,7 +2,8 @@
|
||||
{% load i18n %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<table class="table" id="{{ id }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{% translate "Details" %}</th>
|
||||
<th class="text-center">{% translate "Objective" %}</th>
|
||||
@ -16,7 +17,9 @@
|
||||
<th class="text-center">{% translate "Action" %}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for timer in timers %}
|
||||
<tr class="{% if timer.important == True %}bg-danger bg-opacity-25{% else %}bg-info bg-opacity-25{% endif %}">
|
||||
<td style="width: 150px;" class="text-center">
|
||||
@ -77,5 +80,6 @@
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -25,7 +25,7 @@
|
||||
{% endblock header_nav_collapse_right %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
<div class="allianceauth-timerboard">
|
||||
<div class="col-lg-12 text-center mb-3">
|
||||
<div class="badge bg-primary text-start">
|
||||
<span>{% translate "Current Eve Time:" %}</span>
|
||||
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{% include "timerboard/timertable.html" with timers=corp_timers %}
|
||||
{% include "timerboard/timertable.html" with id="corp-timers" timers=corp_timers %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -56,7 +56,7 @@
|
||||
|
||||
<div class="card-body">
|
||||
{% if future_timers %}
|
||||
{% include "timerboard/timertable.html" with timers=future_timers %}
|
||||
{% include "timerboard/timertable.html" with id="future-timers" timers=future_timers %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning text-center">
|
||||
{% translate "No upcoming timers." %}
|
||||
@ -74,7 +74,7 @@
|
||||
|
||||
<div class="card-body">
|
||||
{% if past_timers %}
|
||||
{% include "timerboard/timertable.html" with timers=past_timers %}
|
||||
{% include "timerboard/timertable.html" with id="past-timers" timers=past_timers %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning text-center">
|
||||
{% translate "No past timers." %}
|
||||
@ -85,9 +85,14 @@
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block extra_css %}
|
||||
{% include "bundles/datatables-css-bs5.html" %}
|
||||
{% endblock extra_css %}
|
||||
|
||||
{% block extra_javascript %}
|
||||
{% include "bundles/moment-js.html" with locale=True %}
|
||||
{% include "bundles/timers-js.html" %}
|
||||
{% include "bundles/datatables-js-bs5.html" %}
|
||||
|
||||
<script>
|
||||
const timers = [
|
||||
@ -168,5 +173,19 @@
|
||||
|
||||
// Start timed updates
|
||||
setInterval(timedUpdate, 1000);
|
||||
|
||||
$(document).ready(() => {
|
||||
const dtOptions = {};
|
||||
|
||||
{% if perms.auth.timer_management %}
|
||||
dtOptions['columnDefs'] = [
|
||||
{ "orderable": false, "targets": 7 }
|
||||
];
|
||||
{% endif %}
|
||||
|
||||
$('.allianceauth-timerboard table').each((index, table) => {
|
||||
$(table).DataTable(dtOptions);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock extra_javascript %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user