mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-13 14:30:17 +02:00
[CHANGE] Moved timers table to its own template
This commit is contained in:
parent
11a32c90a8
commit
0bd3acc230
202
allianceauth/timerboard/templates/timerboard/timertable.html
Normal file
202
allianceauth/timerboard/templates/timerboard/timertable.html
Normal file
@ -0,0 +1,202 @@
|
||||
{% load evelinks %}
|
||||
{% load i18n %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th class="text-center">{% translate "Details" %}</th>
|
||||
<th class="text-center">{% translate "Objective" %}</th>
|
||||
<th class="text-center">{% translate "System" %}</th>
|
||||
<th class="text-center">{% translate "Structure" %}</th>
|
||||
<th class="text-center">{% translate "Eve Time" %}</th>
|
||||
<th class="text-center">{% translate "Local Time" %}</th>
|
||||
<th class="text-center">{% translate "Creator" %}</th>
|
||||
{% if perms.auth.timer_management %}
|
||||
<th class="text-center">{% translate "Action" %}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
||||
{% for timer in timers %}
|
||||
{% if timer.important == True %}
|
||||
<tr class="danger">
|
||||
{% else %}
|
||||
<tr class="info">
|
||||
{% endif %}
|
||||
|
||||
<td style="width: 150px;" class="text-center">
|
||||
{{ timer.details }}
|
||||
|
||||
{% if timer.timer_type != 'UNSPECIFIED' %}
|
||||
<br>({{ timer.get_timer_type_display }})
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
{% if timer.objective == "Hostile" %}
|
||||
<div class="badge bg-danger">
|
||||
{% translate "Hostile" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.objective == "Friendly" %}
|
||||
<div class="badge bg-primary">
|
||||
{% translate "Friendly" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.objective == "Neutral" %}
|
||||
<div class="badge bg-default">
|
||||
{% translate "Neutral" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<a href="{{ timer.system|dotlan_solar_system_url }}">
|
||||
{{ timer.system }} {{ timer.planet_moon }}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
{% if timer.structure == "POCO" %}
|
||||
<div class="badge bg-info">
|
||||
POCO
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "I-HUB" %}
|
||||
<div class="badge bg-warning">
|
||||
I-HUB
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "TCU" %}
|
||||
<div class="badge bg-danger">
|
||||
TCU
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "POS[S]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [S]
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "POS[M]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [M]
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "POS[L]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [L]
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
|
||||
<div class="badge bg-danger">
|
||||
Astrahus
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
|
||||
<div class="badge bg-danger">
|
||||
Fortizar
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
|
||||
<div class="badge bg-danger">
|
||||
Keepstar
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
|
||||
<div class="badge bg-warning">
|
||||
Raitaru
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
|
||||
<div class="badge bg-warning">
|
||||
Azbel
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
|
||||
<div class="badge bg-warning">
|
||||
Sotiyo
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
|
||||
<div class="badge bg-warning">
|
||||
Athanor
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara"%}
|
||||
<div class="badge bg-warning">
|
||||
Tatara
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
|
||||
<div class="badge bg-warning">
|
||||
Cyno Beacon
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
|
||||
<div class="badge bg-warning">
|
||||
Tenebrex Cyno Jammer
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
|
||||
<div class="badge bg-warning">
|
||||
Ansiblex Jump Gate
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Moon Mining Cycle" %}
|
||||
<div class="badge bg-success">
|
||||
Moon Mining Cycle
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if timer.structure == "Other" %}
|
||||
<div class="badge bg-default">
|
||||
Other
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
<td class="text-center" nowrap>
|
||||
{{ timer.eve_time | date:"Y-m-d H:i" }}
|
||||
</td>
|
||||
|
||||
<td class="text-center" nowrap>
|
||||
<div id="localtime{{ timer.id }}"></div>
|
||||
<div id="countdown{{ timer.id }}"></div>
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
{{ timer.eve_character.character_name }}
|
||||
</td>
|
||||
|
||||
{% if perms.auth.timer_management %}
|
||||
<td class="text-center">
|
||||
<a href="{% url 'timerboard:delete' timer.id %}" class="btn btn-danger">
|
||||
<i class="fa-solid fa-trash fa-fw"></i>
|
||||
</a>
|
||||
<a href="{% url 'timerboard:edit' timer.id %}" class="btn btn-info">
|
||||
<i class="fa-solid fa-pen-to-square fa-fw"></i>
|
||||
</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
@ -1,362 +1,43 @@
|
||||
{% extends "allianceauth/base-bs5.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
{% load evelinks %}
|
||||
|
||||
{% block page_title %}{% translate "Structure Timer Management" %}{% endblock page_title %}
|
||||
{% block extra_css %}{% endblock extra_css %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
|
||||
{% block page_title %}
|
||||
{% translate "Structure Timer Management" %}
|
||||
{% endblock page_title %}
|
||||
|
||||
{% block header_nav_brand %}
|
||||
{% translate "Structure Timers" %}
|
||||
{% endblock header_nav_brand %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">{% translate "Structure Timers" %}
|
||||
<div class="text-end">
|
||||
{% if perms.auth.timer_management %}
|
||||
<a href="{% url 'timerboard:add' %}" class="btn btn-success">
|
||||
{% translate "Create Structure Timer" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</h1>
|
||||
<div>
|
||||
<div class="text-end mb-3">
|
||||
{% if perms.auth.timer_management %}
|
||||
<a href="{% url 'timerboard:add' %}" class="btn btn-success">
|
||||
{% translate "Create Structure Timer" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 text-center">
|
||||
<div class="badge bg-info text-start">
|
||||
<b>{% translate "Current Eve Time:" %} </b>
|
||||
<span>{% translate "Current Eve Time:" %}</span>
|
||||
<span id="current-time"></span>
|
||||
</div>
|
||||
<strong class="badge bg-info text-start" id="current-time"></strong>
|
||||
</div>
|
||||
|
||||
{% if corp_timers %}
|
||||
<h4><b>{% translate "Corp Timers" %}</b></h4>
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th style="width:150px" class="text-center">{% translate "Details" %}</th>
|
||||
<th class="text-center">{% translate "Objective" %}</th>
|
||||
<th class="text-center">{% translate "System" %}</th>
|
||||
<th class="text-center">{% translate "Structure" %}</th>
|
||||
<th class="text-center">{% translate "Eve Time" %}</th>
|
||||
<th class="text-center">{% translate "Local Time" %}</th>
|
||||
<th class="text-center">{% translate "Creator" %}</th>
|
||||
{% if perms.auth.timer_management %}
|
||||
<th class="text-center">{% translate "Action" %}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% for timer in corp_timers %}
|
||||
{% if timer.important == True %}
|
||||
<tr class="danger">
|
||||
{% else %}
|
||||
<tr class="info">
|
||||
{% endif %}
|
||||
<td style="width:150px" class="text-center">
|
||||
{{ timer.details }}
|
||||
{% if timer.timer_type != 'UNSPECIFIED' %}
|
||||
<br>({{ timer.get_timer_type_display }})
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{% if timer.objective == "Hostile" %}
|
||||
<div class="badge bg-danger">
|
||||
{% translate "Hostile" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.objective == "Friendly" %}
|
||||
<div class="badge bg-primary">
|
||||
{% translate "Friendly" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.objective == "Neutral" %}
|
||||
<div class="badge bg-default">
|
||||
{% translate "Neutral" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center"><a href="{{ timer.system|dotlan_solar_system_url }}">
|
||||
{{ timer.system }} {{ timer.planet_moon }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{% if timer.structure == "POCO" %}
|
||||
<div class="badge bg-info">
|
||||
POCO
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "I-HUB" %}
|
||||
<div class="badge bg-warning">
|
||||
I-HUB
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "TCU" %}
|
||||
<div class="badge bg-danger">
|
||||
TCU
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "POS[S]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [S]
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "POS[M]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [M]
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "POS[L]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [L]
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
|
||||
<div class="badge bg-danger">
|
||||
Astrahus
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
|
||||
<div class="badge bg-danger">
|
||||
Fortizar
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
|
||||
<div class="badge bg-danger">
|
||||
Keepstar
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
|
||||
<div class="badge bg-warning">
|
||||
Raitaru
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
|
||||
<div class="badge bg-warning">
|
||||
Azbel
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
|
||||
<div class="badge bg-warning">
|
||||
Sotiyo
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
|
||||
<div class="badge bg-warning">
|
||||
Athanor
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara"%}
|
||||
<div class="badge bg-warning">
|
||||
Tatara
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
|
||||
<div class="badge bg-warning">
|
||||
Cyno Beacon
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
|
||||
<div class="badge bg-warning">
|
||||
Tenebrex Cyno Jammer
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
|
||||
<div class="badge bg-warning">
|
||||
Ansiblex Jump Gate
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Moon Mining Cycle" %}
|
||||
<div class="badge bg-success">
|
||||
Moon Mining Cycle
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Other" %}
|
||||
<div class="badge bg-default">
|
||||
Other
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
||||
<td class="text-center" nowrap>
|
||||
<div id="localtime{{ timer.id }}"></div>
|
||||
<div id="countdown{{ timer.id }}"></div>
|
||||
</td>
|
||||
<td class="text-center">{{ timer.eve_character.character_name }}</td>
|
||||
{% if perms.auth.timer_management %}
|
||||
<td class="text-center">
|
||||
<a href="{% url 'timerboard:delete' timer.id %}" class="btn btn-danger">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
</a>
|
||||
<a href="{% url 'timerboard:edit' timer.id %}" class="btn btn-info">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% include "timerboard/timertable.html" with timers=corp_timers %}
|
||||
{% endif %}
|
||||
|
||||
<h4><b>{% translate "Next Timers" %}</b></h4>
|
||||
{% if future_timers %}
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th style="width:150px" class="text-center">{% translate "Details" %}</th>
|
||||
<th class="text-center">{% translate "Objective" %}</th>
|
||||
<th class="text-center">{% translate "System" %}</th>
|
||||
<th class="text-center">{% translate "Structure" %}</th>
|
||||
<th class="text-center">{% translate "Eve Time" %}</th>
|
||||
<th class="text-center">{% translate "Local Time" %}</th>
|
||||
<th class="text-center">{% translate "Creator" %}</th>
|
||||
{% if perms.auth.timer_management %}
|
||||
<th class="text-center">{% translate "Action" %}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% for timer in future_timers %}
|
||||
{% if timer.important == True %}
|
||||
<tr class="danger">
|
||||
{% else %}
|
||||
<tr class="info">
|
||||
{% endif %}
|
||||
<td style="width:150px" class="text-center">
|
||||
{{ timer.details }}
|
||||
{% if timer.timer_type != 'UNSPECIFIED' %}
|
||||
<br>({{ timer.get_timer_type_display }})
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{% if timer.objective == "Hostile" %}
|
||||
<div class="badge bg-danger">
|
||||
{% translate "Hostile" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.objective == "Friendly" %}
|
||||
<div class="badge bg-primary">
|
||||
{% translate "Friendly" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.objective == "Neutral" %}
|
||||
<div class="badge bg-default">
|
||||
{% translate "Neutral" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ timer.system|dotlan_solar_system_url }}">
|
||||
{{ timer.system }} {{ timer.planet_moon }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{% if timer.structure == "POCO" %}
|
||||
<div class="badge bg-info">
|
||||
POCO
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "I-HUB" %}
|
||||
<div class="badge bg-warning">
|
||||
I-HUB
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "TCU" %}
|
||||
<div class="badge bg-danger">
|
||||
TCU
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "POS[S]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [S]
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "POS[M]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [M]
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "POS[L]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [L]
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
|
||||
<div class="badge bg-danger">
|
||||
Astrahus
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
|
||||
<div class="badge bg-danger">
|
||||
Fortizar
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
|
||||
<div class="badge bg-danger">
|
||||
Keepstar
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
|
||||
<div class="badge bg-warning">
|
||||
Raitaru
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
|
||||
<div class="badge bg-warning">
|
||||
Azbel
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
|
||||
<div class="badge bg-warning">
|
||||
Sotiyo
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
|
||||
<div class="badge bg-warning">
|
||||
Athanor
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara" %}
|
||||
<div class="badge bg-warning">
|
||||
Tatara
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
|
||||
<div class="badge bg-warning">
|
||||
Pharolux Cyno Beacon
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
|
||||
<div class="badge bg-warning">
|
||||
Tenebrex Cyno Jammer
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
|
||||
<div class="badge bg-warning">
|
||||
Ansiblex Jump Gate
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Moon Mining Cycle" %}
|
||||
<div class="badge bg-success">
|
||||
Moon Mining Cycle
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Other" %}
|
||||
<div class="badge bg-default">
|
||||
Other
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
||||
<td class="text-center" nowrap>
|
||||
<div id="localtime{{ timer.id }}"></div>
|
||||
<div id="countdown{{ timer.id }}"></div>
|
||||
</td>
|
||||
<td class="text-center">{{ timer.eve_character.character_name }}</td>
|
||||
{% if perms.auth.timer_management %}
|
||||
<td class="text-center">
|
||||
<a href="{% url 'timerboard:delete' timer.id %}" class="btn btn-danger">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
</a>
|
||||
<a href="{% url 'timerboard:edit' timer.id %}" class="btn btn-info">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% include "timerboard/timertable.html" with timers=future_timers %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning text-center">
|
||||
{% translate "No upcoming timers." %}
|
||||
@ -365,182 +46,21 @@
|
||||
|
||||
<h4><b>{% translate "Past Timers" %}</b></h4>
|
||||
{% if past_timers %}
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th style="width:150px" class="text-center">{% translate "Details" %}</th>
|
||||
<th class="text-center">{% translate "Objective" %}</th>
|
||||
<th class="text-center">{% translate "System" %}</th>
|
||||
<th class="text-center">{% translate "Structure" %}</th>
|
||||
<th class="text-center">{% translate "Eve Time" %}</th>
|
||||
<th class="text-center">{% translate "Local Time" %}</th>
|
||||
<th class="text-center">{% translate "Creator" %}</th>
|
||||
{% if perms.auth.timer_management %}
|
||||
<th class="text-center">{% translate "Action" %}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% for timer in past_timers %}
|
||||
{% if timer.important == True %}
|
||||
<tr class="danger">
|
||||
{% else %}
|
||||
<tr class="info">
|
||||
{% endif %}
|
||||
<td style="width:150px" class="text-center">
|
||||
{{ timer.details }}
|
||||
{% if timer.timer_type != 'UNSPECIFIED' %}
|
||||
<br>({{ timer.get_timer_type_display }})
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{% if timer.objective == "Hostile" %}
|
||||
<div class="badge bg-danger">
|
||||
{% translate "Hostile" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.objective == "Friendly" %}
|
||||
<div class="badge bg-primary">
|
||||
{% translate "Friendly" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.objective == "Neutral" %}
|
||||
<div class="badge bg-default">
|
||||
{% translate "Neutral" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ timer.system|dotlan_solar_system_url }}">
|
||||
{{ timer.system }} {{ timer.planet_moon }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{% if timer.structure == "POCO" %}
|
||||
<div class="badge bg-info">
|
||||
POCO
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "I-HUB" %}
|
||||
<div class="badge bg-warning">
|
||||
I-HUB
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "TCU" %}
|
||||
<div class="badge bg-danger">
|
||||
TCU
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "POS[S]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [S]
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "POS[M]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [M]
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "POS[L]" %}
|
||||
<div class="badge bg-info">
|
||||
POS [L]
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
|
||||
<div class="badge bg-danger">
|
||||
Astrahus
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
|
||||
<div class="badge bg-danger">
|
||||
Fortizar
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
|
||||
<div class="badge bg-danger">
|
||||
Keepstar
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
|
||||
<div class="badge bg-warning">
|
||||
Raitaru
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
|
||||
<div class="badge bg-warning">
|
||||
Azbel
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
|
||||
<div class="badge bg-warning">
|
||||
Sotiyo
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
|
||||
<div class="badge bg-warning">
|
||||
Athanor
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara" %}
|
||||
<div class="badge bg-warning">
|
||||
Tatara
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
|
||||
<div class="badge bg-warning">
|
||||
Pharolux Cyno Beacon
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
|
||||
<div class="badge bg-warning">
|
||||
Tenebrex Cyno Jammer
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
|
||||
<div class="badge bg-warning">
|
||||
Ansiblex Jump Gate
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Moon Mining Cycle" %}
|
||||
<div class="badge bg-success">
|
||||
Moon Mining Cycle
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if timer.structure == "Other" %}
|
||||
<div class="badge bg-default">
|
||||
Other
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
||||
<td class="text-center" nowrap>
|
||||
<div id="localtime{{ timer.id }}"></div>
|
||||
<div id="countdown{{ timer.id }}"></div>
|
||||
</td>
|
||||
<td class="text-center">{{ timer.eve_character.character_name }}</td>
|
||||
{% if perms.auth.timer_management %}
|
||||
<td class="text-center">
|
||||
<a href="{% url 'timerboard:delete' timer.id %}" class="btn btn-danger">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
</a>
|
||||
<a href="{% url 'timerboard:edit' timer.id %}" class="btn btn-info">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% include "timerboard/timertable.html" with timers=past_timers %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning text-center">
|
||||
{% translate "No past timers." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block extra_javascript %}
|
||||
{% include "bundles/moment-js.html" with locale=True %}
|
||||
{% include "bundles/timers-js.html" %}
|
||||
|
||||
<script>
|
||||
let timers = [
|
||||
const timers = [
|
||||
{% for timer in timers %}
|
||||
{
|
||||
'id': {{ timer.id }},
|
||||
@ -548,6 +68,7 @@
|
||||
'expired': false
|
||||
},
|
||||
{% endfor %}
|
||||
|
||||
{% for timer in corp_timers %}
|
||||
{
|
||||
'id': {{ timer.id }},
|
||||
@ -561,9 +82,9 @@
|
||||
* Update a timer
|
||||
* @param timer Timer information
|
||||
*/
|
||||
let updateTimer = function (timer) {
|
||||
const updateTimer = (timer) => {
|
||||
if (timer.targetDate.isAfter(Date.now())) {
|
||||
let duration = moment.duration(timer.targetDate - moment(), 'milliseconds');
|
||||
const duration = moment.duration(timer.targetDate - moment(), 'milliseconds');
|
||||
|
||||
document.getElementById("countdown" + timer.id).innerHTML = getDurationString(duration);
|
||||
} else {
|
||||
@ -573,8 +94,8 @@
|
||||
}
|
||||
};
|
||||
|
||||
let updateAllTimers = function () {
|
||||
let l = timers.length;
|
||||
const updateAllTimers = () => {
|
||||
const l = timers.length;
|
||||
|
||||
for (let i=0; i < l; ++i) {
|
||||
if (timers[i].expired) continue;
|
||||
@ -583,33 +104,34 @@
|
||||
}
|
||||
};
|
||||
|
||||
function timedUpdate() {
|
||||
updateClock();
|
||||
updateAllTimers();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the local time info for the timer
|
||||
* @param timer Timer information
|
||||
*/
|
||||
let setLocalTime = function (timer) {
|
||||
const setLocalTime = (timer) => {
|
||||
document.getElementById("localtime" + timer.id).innerHTML = timer.targetDate.format("ddd @ LT");
|
||||
};
|
||||
|
||||
/**
|
||||
* Set all local time fields
|
||||
*/
|
||||
let setAllLocalTimes = function () {
|
||||
let l = timers.length;
|
||||
const setAllLocalTimes = () => {
|
||||
const l = timers.length;
|
||||
|
||||
for (let i=0; i < l; ++i) {
|
||||
setLocalTime(timers[i]);
|
||||
}
|
||||
};
|
||||
|
||||
let updateClock = function () {
|
||||
const updateClock = () => {
|
||||
document.getElementById("current-time").innerHTML = getCurrentEveTimeString();
|
||||
};
|
||||
|
||||
const timedUpdate = () => {
|
||||
updateClock();
|
||||
updateAllTimers();
|
||||
}
|
||||
|
||||
// Set initial values
|
||||
setAllLocalTimes();
|
||||
timedUpdate();
|
||||
@ -617,4 +139,4 @@
|
||||
// Start timed updates
|
||||
setInterval(timedUpdate, 1000);
|
||||
</script>
|
||||
{% endblock content %}
|
||||
{% endblock extra_javascript %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user