Move templates and urls to apps.

Implement url hooks.
Many apps are now removable.
Default to assuming services have been migrated.
This commit is contained in:
Adarnof
2017-06-07 22:49:46 -04:00
parent 9cc9a36766
commit 97fe2ddfd0
62 changed files with 685 additions and 469 deletions

View File

@@ -0,0 +1,46 @@
{% extends "registered/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% block title %}{% trans "Alliance Auth - Fleet Operation Create" %}{% endblock %}
{% block page_title %}{% trans "Create Operation" %}{% endblock page_title %}
{% block extra_css %}
{% include 'bundles/jquery-datetimepicker-css.html' %}
{% endblock extra_css %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">{% trans "Create Fleet Operation" %}</h1>
<div class="container-fluid">
<div class="col-md-4 col-md-offset-4">
<div class="row">
<form class="form-signin" role="form" action="" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
<br/>
<button class="btn btn-lg btn-primary btn-block" type="submit">{% trans "Create Fleet Operation" %}</button>
</form>
</div>
</div>
</div>
</div>
{% endblock content %}
{% block extra_javascript %}
{% include 'bundles/jquery-datetimepicker-js.html' %}
{% endblock %}
{% block extra_script %}
$('#id_start').datetimepicker({
lang: '{{ LANGUAGE_CODE }}',
maskInput: true,
format: 'Y-m-d H:i',minDate:0
});
{% endblock extra_script %}

View File

@@ -0,0 +1,44 @@
{% load i18n %}
{% block content %}
<table class="table">
<thead>
<tr>
<th class="text-center col-lg-3">{% trans "Operation Name" %}</th>
<th class="text-center col lg-2">{% trans "Doctrine" %}</th>
<th class="text-center col-lg-1">{% trans "Form Up System" %}</th>
<th class="text-center col-lg-1">{% trans "Start Time" %}</th>
<th class="text-center col-lg-1">{% trans "Local Time" %}</th>
<th class="text-center col-lg-1">{% trans "Duration" %}</th>
<th class="text-center col-lg-1">{% trans "FC" %}</th>
{% if perms.auth.optimer_management %}
<th class="text-center col-lg-1">{% trans "Creator" %}</th>
<th class="text-center col-lg-2">{% trans "Action" %}</th>
{% endif %}
</tr>
</thead>
{% for ops in timers %}
<tbody>
<tr>
<td class="text-center">{{ ops.operation_name }}</td>
<td class="text-center">{{ ops.doctrine }}</td>
<td class="text-center">
<a href="http://evemaps.dotlan.net/system/{{ ops.system }}">{{ ops.system }}</a>
</td>
<td class="text-center" nowrap>{{ ops.start | date:"Y-m-d H:i" }}</td>
<td class="text-center" nowrap><div id="localtime{{ ops.id }}"></div><div id="countdown{{ ops.id }}"></div></td>
<td class="text-center">{{ ops.duration }}</td>
<td class="text-center">{{ ops.fc }}</td>
{% if perms.auth.optimer_management %}
<td class="text-center">{{ ops.eve_character }}</td>
<td class="text-center">
<a href="{% url 'optimer:remove' ops.id %}" class="btn btn-danger">
<span class="glyphicon glyphicon-remove"></span>
</a><a href="{% url 'optimer:edit' ops.id %}" class="btn btn-info"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
{% endif %}
</tr>
</tbody>
{% endfor %}
</table>
{% endblock content %}

View File

@@ -0,0 +1,119 @@
{% extends "registered/base.html" %}
{% load staticfiles %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% block title %}Alliance Auth{% endblock %}
{% block page_title %}{% trans "Fleet Operation Management" %}{% endblock page_title %}
{% block extra_css %}{% endblock extra_css %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">{% trans "Fleet Operation Timers" %}
<div class="text-right">
{% if perms.auth.optimer_management %}
<a href="{% url 'optimer:add' %}" class="btn btn-success">{% trans "Create Operation" %}</a>
{% endif %}
</div>
</h1>
<div class="col-lg-12 text-center row">
<div class="label label-info text-left">
<b>{% trans "Current Eve Time:" %} </b>
</div><div class="label label-info text-left" id="current-time"></div>
<br />
</div>
<h4><b>{% trans "Next Timers" %}</b></h4>
{% if future_timers %}
{% include "optimer/fleetoptable.html" with timers=future_timers %}
{% else %}
<div class="alert alert-warning text-center">{% trans "No upcoming timers." %}</div>
{% endif %}
<h4><b>{% trans "Past Timers" %}</b></h4>
{% if past_timers %}
{% include "optimer/fleetoptable.html" with timers=past_timers %}
{% else %}
<div class="alert alert-warning text-center">{% trans "No past timers." %}</div>
{% endif %}
</div>
{% include 'bundles/moment-js.html' with locale=True %}
<script src="{% static 'js/timers.js' %}"></script>
<script type="text/javascript">
// Data
var timers = [
{% for op in optimer %}
{
'id': {{ op.id }},
'start': moment("{{ op.start | date:"c" }}"),
'expired': false
},
{% endfor %}
];
</script>
<script type="text/javascript">
timedUpdate();
setAllLocalTimes();
// Start timed updates
setInterval(timedUpdate, 1000);
function timedUpdate() {
updateClock();
updateAllTimers();
}
function updateAllTimers () {
var l = timers.length;
for (var i=0; i < l; ++i) {
if (timers[i].expired) continue;
updateTimer(timers[i]);
}
}
/**
* Update a timer
* @param timer Timer information
* @param timer.start Date of the timer
* @param timer.id Id number of the timer
* @param timer.expired
*/
function updateTimer(timer) {
if (timer.start.isAfter(Date.now())) {
var duration = moment.duration(timer.start - moment(), 'milliseconds');
document.getElementById("countdown" + timer.id).innerHTML = getDurationString(duration);
} else {
timer.expired = true;
document.getElementById("countdown" + timer.id).innerHTML = "";
}
}
/**
* Set all local time fields
*/
function setAllLocalTimes() {
var l = timers.length;
for (var i=0; i < l; ++i) {
setLocalTime(timers[i]);
}
}
/**
* Set the local time info for the timer
* @param timer Timer information
* @param timer.start Date of the timer
* @param timer.id Id number of the timer
*/
function setLocalTime(timer) {
document.getElementById("localtime" + timer.id).innerHTML = timer.start.format("ddd @ LT");
}
function updateClock() {
document.getElementById("current-time").innerHTML = "<b>" + moment.utc().format('LLLL') + "</b>";
}
</script>
{% endblock content %}

View File

@@ -0,0 +1,54 @@
{% extends "registered/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% block title %}Alliance Auth - Update Fleet Operation {% endblock %}
{% block page_title %}{% trans "Update AAR Link" %}{% endblock page_title %}
{% block extra_css %}
{% include 'bundles/jquery-datetimepicker-css.html' %}
{% endblock extra_css %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">{% trans "Update Fleet Operation" %}</h1>
<div class="container-fluid">
<div class="col-md-4 col-md-offset-4">
<div class="row">
{% if no_fleet_id %}
<div class="alert alert-danger" role="alert">{% trans "Fleet Operation Does Not Exist" %}</div>
{% else %}
<form class="form-signin" role="form" action="" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
<br/>
<button class="btn btn-lg btn-primary btn-block" type="submit">{% trans "Update Fleet Operation" %}
</button>
</form>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock content %}
{% block extra_javascript %}
{% include 'bundles/jquery-datetimepicker-js.html' %}
{% endblock %}
{% block extra_script %}
$('#id_start').datetimepicker({
lang: '{{ LANGUAGE_CODE }}',
maskInput: true,
format: 'Y-m-d H:i',minDate:0
});
{% endblock extra_script %}