Merge branch 'fleetup-template-bootstrap-fix' into 'master'

Fixes for FleetUp templates

See merge request allianceauth/allianceauth!1100
This commit is contained in:
Basraah 2018-10-09 05:15:03 +00:00
commit f87c630b86
7 changed files with 291 additions and 289 deletions

2
.gitignore vendored
View File

@ -62,3 +62,5 @@ celerybeat-schedule
#pycharm
.idea/*
/nbproject/

View File

@ -15,7 +15,7 @@
</div>
<div class="panel-body">
<div class="col-lg-6">
<div class="table-responsive">
<div class="table-responsive">
<table class="table table-condensed table-hover table-striped">
<tr>
<th class="col-md-1"></th>
@ -26,7 +26,7 @@
{% for char_name, user_id in member_list %}
<tr>
<td>
<img src="http://image.eveonline.com/Character/{{ user_id.char_id }}_32.jpg" class="img-circle">
<img src="https://imageserver.eveonline.com/Character/{{ user_id.char_id }}_32.jpg" class="img-circle">
</td>
<td>
<p>{{ user_id.char_name }}</p>

View File

@ -8,12 +8,12 @@
{% block content %}
<div class="col-lg-12">
{% include "fleetup/menu.html" %}
<div class="panel">
<div>
{% for a, j in doctrine.items %}
{% regroup j.Data|dictsort:"Role" by Role as role_list %}
{% for Role in role_list %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><b>{{ Role.grouper }}</b></h3>
@ -50,7 +50,7 @@
{% load humanize %}{{ item.EstPrice|intword }}
</td>
<td>
{% for categories in item.Categories %}
{% for categories in item.Categories %}
{{ categories }},
{% endfor %}
</td>

View File

@ -8,12 +8,12 @@
{% block content %}
<div class="col-lg-12">
{% include "fleetup/menu.html" %}
<div class="panel">
<div>
{% if doctrines_list %}
{% for a, j in doctrines_list.items %}
{% regroup j|dictsort:"FolderName" by FolderName as folder_list %}
{% for FolderName in folder_list %}
<div class="col-lg-8">
<div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><b>{{ FolderName.grouper }}</b></h3>
@ -29,11 +29,11 @@
<th class="col-lg-2">Note</th>-->
</tr>
{% for item in FolderName.list %}
<tr>
<td>
<a href="{% url 'fleetup:doctrine' item.DoctrineId %}"><img src="https://image.eveonline.com/InventoryType/{{ item.IconId }}_32.png"></a>
</td>
</td>
<td>
{{ item.Name }}
</td>

View File

@ -8,9 +8,9 @@
{% block content %}
<div class="col-lg-12">
{% include "fleetup/menu.html" %}
<div class="tab-content">
<div class="tab-content row">
<div id="fit" class="tab-pane fade in active">
<div class="col-lg-3">
<div class="col-lg-4">
{% for x, y in fitting_data.items %}
<div class="panel panel-default">
<div class="panel-heading">
@ -18,22 +18,24 @@
</div>
<div class="panel-body">
{% for doctrin in y.Doctrines %}
<h4>{{ doctrin.Name }}</h4>
<div class="col-lg-12">
<p>{% trans "Role in doctrine:" %} {{ doctrin.Role }}</p>
</div>
<div class="col-lg-4">
<p>{% trans "Priority:" %}</p>
</div>
<div class="col-lg-8">
<div class="progress">
<div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="{{ doctrin.Priority }}" aria-valuemin="0" aria-valuemax="5" style="width: {% widthratio doctrin.Priority 5 100 %}%;">
{{ doctrin.Priority }}/5
<div class="clearfix">
<h4>{{ doctrin.Name }}</h4>
<div class="col-lg-12">
<p>{% trans "Role in doctrine:" %} {{ doctrin.Role }}</p>
</div>
<div class="col-lg-4">
<p>{% trans "Priority:" %}</p>
</div>
<div class="col-lg-8">
<div class="progress">
<div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="{{ doctrin.Priority }}" aria-valuemin="0" aria-valuemax="5" style="width: {% widthratio doctrin.Priority 5 100 %}%;">
{{ doctrin.Priority }}/5
</div>
</div>
</div>
</div>
<div class="pull-right">
<a class="btn btn-primary" href="{% url 'fleetup:doctrine' doctrin.DoctrineId %}">{% trans "See doctrine" %}</a>
<div class="pull-right">
<a class="btn btn-primary" href="{% url 'fleetup:doctrine' doctrin.DoctrineId %}">{% trans "See doctrine" %}</a>
</div>
</div>
{% endfor %}
</div>
@ -56,10 +58,10 @@
<div class="panel-body">
<div class="list-group">
{% for arbit, orbit in doctrines_list.items %}
{% for fitting in orbit.Data %}
<a href="{% url 'fleetup:fitting' fitting.FittingId %}" class="list-group-item">
<h4 class="list-group-item-heading">{{ fitting.Name }}<span class="pull-right"><img src="https://image.eveonline.com/InventoryType/{{ fitting.EveTypeId }}_32.png" class="img-circle"></span></h4>
<p class="list-group-item-heading">{{ fitting.Role }} - {{ fitting.ShipType }}</p>
</a>
@ -107,8 +109,8 @@
{% endfor %}
</div>
</div>
<div class="col-lg-3">
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{% trans "EFT/Export" %}</h3>

View File

@ -20,11 +20,11 @@
<th class="col-md-2">{% trans "Categories" %}</th>
</tr>
{% for id, fittings in fitting_list %}
<tr>
<td>
<a href="{% url 'fleetup:fitting' fittings.fitting_id %}"><img src="https://image.eveonline.com/InventoryType/{{ fittings.icon_id }}_32.png"></a>
</td>
</td>
<td>
{{ fittings.name }}
</td>
@ -38,12 +38,12 @@
{% load humanize %}{{ fittings.estimated|intword }}
</td>
<td>
{% for categories in fittings.categories %}
{% for categories in fittings.categories %}
{{ categories }},
{% endfor %}
</td>
</tr>
{% endfor %}
</table>
{% else %}

View File

@ -1,256 +1,254 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load i18n %}
{% block page_title %}FleetUp{% endblock page_title %}
{% block content %}
<div class="col-lg-12">
{% include "fleetup/menu.html" %}
<div class="panel">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#operations">{% trans "Operations" %}</a></li>
<li><a data-toggle="tab" href="#timers">{% trans "Timers" %}</a></li>
</ul>
<div class="tab-content">
<div id="operations" class="tab-pane fade in active">
<div class="col-lg-7">
{% if operations_list %}
{% for subject, start in operations_list %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><b>{{ start.subject }}</b></h3>
</div>
<div class="panel-body">
<table class="table table-condensed">
<tr>
<th class="col-md-6">{% trans "Start" %}</th>
<th class="col-md-6">{% trans "End" %}</th>
</tr>
<tr>
<td class="col-md-6">{{ start.start|date:"l d M H:i" }} <span class="label label-success">{% trans "Eve Time" %}</span></td>
<td class="col-md-6">{{ start.end|date:"l d M H:i" }} <span class="label label-success">{% trans "Eve Time" %}</span></td>
</tr>
<tr>
<td class="col-md-6">
<span id="localtime{{ start.operation_id }}"></span>&nbsp;<span class='label label-success'>Local time</span><br>
<div id="countdown{{ start.operation_id }}"></div>
</td>
<td class="col-md-6"></td>
</tr>
</table>
<p>{{ start.details }}</p>
<div class="col-lg-12">
<table class="table table-condensed table-striped">
<tr>
<th class="col-md-4">{% trans "Location" %}</th>
<th class="col-md-4">{% trans "Doctrine" %}</th>
<th class="col-md-2">{% trans "Organizer" %}</th>
<th class="col-md-2">{% trans "URL" %}</th>
</tr>
<tr>
<td>
{{ start.location }} - {{ start.location_info }} <a href="http://evemaps.dotlan.net/system/{{ start.location }}" target="_blank" class="label label-success">Dotlan</a>
</td>
<td>
{% if start.doctrine %}
{% for doctrine in start.doctrine %}
<a href="{% url 'fleetup:doctrine' doctrine.Id %}" class="label label-success">{{ doctrine.Name }}</a>
{% endfor %}
{% else %}
<span class="label label-danger">{% trans "TBA" %}</span>
{% endif %}
</td>
<td>
{{ start.organizer }}
</td>
<td>
{% ifequal start.url "" %}
<div class="label label-danger">{% trans "No link" %}</div>
{% else %}
<a href="{{ start.url }}" target="_blank" class="label label-success">{% trans "External link" %}</a>
{% endifequal %}
</td>
</tr>
</table>
</div>
</div>
</div>
{% endfor %}
{% else %}
<h3>{% trans "There seems to be no Operations in the near future." %}</h3>
{% endif %}
</div>
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">{% trans "Current Eve Time:" %}</h2>
</div>
<div class="panel-body">
<div id="current-time"></div>
</div>
</div>
{% if timers_list %}
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">{% trans "Timers" %}</h2>
</div>
<div class="panel-body">
<table class="table table-condensed table-hover table-striped">
{% for notes, type in timers_list %}
<tr>
<td>
{{ type.solarsystem }}
</td>
<td>
{{ type.expires|date:"l d M H:i" }}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endif %}
</div>
</div>
<div id="timers" class="tab-pane fade in">
<div class="col-lg-12">
{% if timers_list %}
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">{% trans "Timers" %}</h2>
</div>
<div class="panel-body">
<div class="col-lg-12">
<table class="table table-condensed table-hover table-striped">
<tr>
<th class="col-lg-1">{% trans "Type" %}</th>
<th class="col-lg-1">{% trans "Structure" %}</th>
<th class="col-lg-2">{% trans "Location" %}</th>
<th class="col-lg-2">{% trans "Expires(EVE-time)" %}</th>
<th class="col-lg-1">{% trans "Owner" %}</th>
<th class="col-lg-2">{% trans "Note" %}</th>
</tr>
{% for notes, type in timers_list %}
<tr>
<td>
{% ifequal type.type "Final" %}
<span class="label label-danger">
{{ type.type }}</span>{% else %}{{ type.type }}{% endifequal %}
</td>
<td>
{{ type.timer_type }}
</td>
<td>
{{ type.solarsystem }} - Planet:{{ type.planet }} Moon:{{ type.moon }}
</td>
<td>
{{ type.expires|date:"l d M H:i" }}
</td>
<td>
{{ type.owner }}
</td>
<td>
{{ type.notes }}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
{% else %}
<h3>{% trans "There seems to be no Timers in the near future." %}</h3>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% include 'bundles/moment-js.html' with locale=True %}
<script src="{% static 'js/timers.js' %}"></script>
<script type="text/javascript">
// Data
var timers = [
{% for start, op in operations_list %}
{
'id': {{ op.operation_id }},
'start': moment("{{ op.start | date:"c" }}"),
'end': moment("{{ op.end | 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('ddd, ll HH:mm:ss z') + "</b>";
}
</script>
{% endblock content %}
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load i18n %}
{% block page_title %}FleetUp{% endblock page_title %}
{% block content %}
<div class="col-lg-12">
{% include "fleetup/menu.html" %}
<div>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#operations">{% trans "Operations" %}</a></li>
<li><a data-toggle="tab" href="#timers">{% trans "Timers" %}</a></li>
</ul>
<div class="tab-content row">
<div id="operations" class="tab-pane fade in active">
<div class="col-lg-8">
{% if operations_list %}
{% for subject, start in operations_list %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><b>{{ start.subject }}</b></h3>
</div>
<div class="panel-body">
<table class="table table-condensed">
<tr>
<th class="col-md-6">{% trans "Start" %}</th>
<th class="col-md-6">{% trans "End" %}</th>
</tr>
<tr>
<td class="col-md-6">{{ start.start|date:"l d M H:i" }} <span class="label label-success">{% trans "Eve Time" %}</span></td>
<td class="col-md-6">{{ start.end|date:"l d M H:i" }} <span class="label label-success">{% trans "Eve Time" %}</span></td>
</tr>
<tr>
<td class="col-md-6">
<span id="localtime{{ start.operation_id }}"></span>&nbsp;<span class='label label-success'>Local time</span><br>
<div id="countdown{{ start.operation_id }}"></div>
</td>
<td class="col-md-6"></td>
</tr>
</table>
{{ start.details|linebreaks }}
<table class="table table-condensed table-striped">
<tr>
<th class="col-md-4">{% trans "Location" %}</th>
<th class="col-md-4">{% trans "Doctrine" %}</th>
<th class="col-md-2">{% trans "Organizer" %}</th>
<th class="col-md-2">{% trans "URL" %}</th>
</tr>
<tr>
<td>
{{ start.location }} - {{ start.location_info }} <a href="http://evemaps.dotlan.net/system/{{ start.location }}" target="_blank" class="label label-success">Dotlan</a>
</td>
<td>
{% if start.doctrine %}
{% for doctrine in start.doctrine %}
<a href="{% url 'fleetup:doctrine' doctrine.Id %}" class="label label-success">{{ doctrine.Name }}</a>
{% endfor %}
{% else %}
<span class="label label-danger">{% trans "TBA" %}</span>
{% endif %}
</td>
<td>
{{ start.organizer }}
</td>
<td>
{% ifequal start.url "" %}
<div class="label label-danger">{% trans "No link" %}</div>
{% else %}
<a href="{{ start.url }}" target="_blank" class="label label-success">{% trans "External link" %}</a>
{% endifequal %}
</td>
</tr>
</table>
</div>
</div>
{% endfor %}
{% else %}
<h3>{% trans "There seems to be no Operations in the near future." %}</h3>
{% endif %}
</div>
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">{% trans "Current Eve Time:" %}</h2>
</div>
<div class="panel-body">
<div id="current-time"></div>
</div>
</div>
{% if timers_list %}
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">{% trans "Timers" %}</h2>
</div>
<div class="panel-body">
<table class="table table-condensed table-hover table-striped">
{% for notes, type in timers_list %}
<tr>
<td>
{{ type.solarsystem }}
</td>
<td>
{{ type.expires|date:"l d M H:i" }}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endif %}
</div>
</div>
<div id="timers" class="tab-pane fade in">
<div class="col-lg-12">
{% if timers_list %}
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">{% trans "Timers" %}</h2>
</div>
<div class="panel-body">
<div class="col-lg-12">
<table class="table table-condensed table-hover table-striped">
<tr>
<th class="col-lg-1">{% trans "Type" %}</th>
<th class="col-lg-1">{% trans "Structure" %}</th>
<th class="col-lg-2">{% trans "Location" %}</th>
<th class="col-lg-2">{% trans "Expires(EVE-time)" %}</th>
<th class="col-lg-1">{% trans "Owner" %}</th>
<th class="col-lg-2">{% trans "Note" %}</th>
</tr>
{% for notes, type in timers_list %}
<tr>
<td>
{% ifequal type.type "Final" %}
<span class="label label-danger">
{{ type.type }}</span>{% else %}{{ type.type }}{% endifequal %}
</td>
<td>
{{ type.timer_type }}
</td>
<td>
{{ type.solarsystem }} - Planet:{{ type.planet }} Moon:{{ type.moon }}
</td>
<td>
{{ type.expires|date:"l d M H:i" }}
</td>
<td>
{{ type.owner }}
</td>
<td>
{{ type.notes }}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
{% else %}
<h3>{% trans "There seems to be no Timers in the near future." %}</h3>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% include 'bundles/moment-js.html' with locale=True %}
<script src="{% static 'js/timers.js' %}"></script>
<script type="text/javascript">
// Data
var timers = [
{% for start, op in operations_list %}
{
'id': {{ op.operation_id }},
'start': moment("{{ op.start | date:"c" }}"),
'end': moment("{{ op.end | 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('ddd, ll HH:mm:ss z') + "</b>";
}
</script>
{% endblock content %}