kopia lustrzana https://github.com/hholzgra/maposmatic/
168 wiersze
6.7 KiB
HTML
168 wiersze
6.7 KiB
HTML
{% load i18n %}
|
|
{% load l10n %}
|
|
{% load extratags %}
|
|
|
|
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-9">
|
|
<table class="table table-striped">
|
|
{% with date=map.submission_time|date:"DATETIME_FORMAT" %}
|
|
<tr><td><strong>{% trans "Request submitted" %}</strong></td><td title="{{ date }}">{{ map.submission_time|timesince }} ago</td></tr>
|
|
{% endwith %}
|
|
|
|
{% if map.is_rendering %}
|
|
{% with date=map.startofrendering_time|date:"DATETIME_FORMAT" duration=map.submission_time|timesince:map.startofrendering_time %}
|
|
<tr><td><strong>{% trans "Rendering started" %}</strong></td><td title="{{ date }}">{{ map.startofrendering_time|timesince }} ago, {% blocktrans %}after {{ duration}} in the queue{% endblocktrans %}</td></tr>
|
|
{% endwith %}
|
|
{% endif %}
|
|
|
|
{% if map.is_done or map.is_obsolete %}
|
|
{% with date=map.startofrendering_time|date:"DATETIME_FORMAT" duration=map.submission_time|timesince:map.startofrendering_time %}
|
|
<tr><td><strong>{% trans "Rendering started" %}</strong></td><td title="{{ date }}">{{ map.startofrendering_time|timesince }} ago, {% blocktrans %}after {{ duration}} in the queue{% endblocktrans %}</td></tr>
|
|
{% endwith %}
|
|
{% with date=map.endofrendering_time|date:"DATETIME_FORMAT" duration=map.startofrendering_time|timesince:map.endofrendering_time %}
|
|
<tr><td><strong>{% trans "Rendering completed" %}</strong></td><td title="{{ date }}">{{ map.endofrendering_time|timesince }} ago, {% blocktrans %}after {{ duration }} {% endblocktrans %}</td></tr>
|
|
{% endwith %}
|
|
{% endif %}
|
|
|
|
{% if map.is_cancelled %}
|
|
{% with map.endofrendering_time|date:"DATETIME_FORMAT" as date %}
|
|
<tr><td><strong>{% trans "Rendering cancelled" %}</strong></td><td>{{ date }}</td></tr>
|
|
{% endwith %}
|
|
{% endif %}
|
|
</table>
|
|
|
|
<div>
|
|
{{ map.status|job_status_to_str:map.resultmsg }}
|
|
</div>
|
|
|
|
<div style="height: 2em"></div>
|
|
|
|
{% if map.needs_waiting %}
|
|
<div class="progress">
|
|
<div id="queue-progress" class="progress-bar progress-bar-striped progress-bar-animated"" role="progressbar"
|
|
style="width: {{ progress }}%" aria-valuenow="{{ progress }}" aria-valuemin="0" aria-valuemax="100">
|
|
<span class="text-dark font-weight-bold">{{ map.current_position_in_queue }} {% trans "jobs ahead of us" %}</span>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
|
|
{% if map.is_waiting %}
|
|
<a class="btn btn-large disabled tooltipped"
|
|
data-placement="right"
|
|
data-original-title="{% with map.submission_time|timesince as date %}
|
|
{% blocktrans %}Pending, submitted {{ date }} ago{% endblocktrans %}
|
|
{% endwith %}">
|
|
<i class="fas fa-hourglas"></i> {% trans "Pending..." %}
|
|
</a>
|
|
|
|
{% ifequal nonce map.nonce %}
|
|
<div style="height: 2em"></div>
|
|
<form method="post" action="{% url "cancel" %}">
|
|
<input type="hidden" name="id" value="{{ map.id }}" />
|
|
<input type="hidden" name="nonce" value="{{ map.nonce }}" />
|
|
<button type="submit" class="btn btn-large btn-danger tooltipped"
|
|
data-placement="right"
|
|
data-original-title="
|
|
{% blocktrans with map.current_position_in_queue as pos %}Cancel this queued request (position {{ pos }} in the queue){% endblocktrans %}">
|
|
{% blocktrans %}<i class="fas fa-times"></i> Cancel{% endblocktrans %}
|
|
</button>
|
|
</form>
|
|
|
|
{% endifequal %}
|
|
{% endif %}
|
|
|
|
{% if map.is_rendering %}
|
|
<a class="btn btn-large disabled tooltipped"
|
|
data-placement="right"
|
|
data-original-title="
|
|
{% with map.startofrendering_time|timesince:map.endofrendering_time as date %}
|
|
{% blocktrans %}Rendering is in progress, started {{ date }} ago{% endblocktrans %}
|
|
{% endwith %}">
|
|
<i class="fas fa-redo"></i> {% trans "Rendering..." %} {{ status }}
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if not map.needs_waiting %}
|
|
<form method="post" action="{% url "recreate" %}">
|
|
<input type="hidden" name="id" value="{{ map.id }}" />
|
|
<button class="btn btn-primary tooltipped" align="right"
|
|
data-original-title="{% trans "Recreate map" %}"
|
|
type="submit" {% if map.needs_waiting or not map.can_recreate %}disabled="disabled"{% endif %}>
|
|
{% trans "Recreate" %} <i class="fas fa-redo"></i>
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
|
|
{% if map.is_done %}
|
|
{% if map.has_output_files %}
|
|
<div style="height: 2em"></div>
|
|
<div class="card card-default">
|
|
<div class="card-header">{% trans "Downloads" %}</div>
|
|
<div id="download-icons" class="card-body">
|
|
|
|
{% for format,file in map.output_files.maps.items %}
|
|
<a href="{{ file.0 }}" title="{{ file.1 }}" class="btn btn-default">
|
|
{% if format == "pdf" %}
|
|
<span class="far fa-file-pdf fa-5x"></span>
|
|
{% elif format == "png" %}
|
|
<span class="far fa-file-image fa-5x"></span>
|
|
{% elif format == "8bit.png" %}
|
|
<span class="far fa-file-image fa-5x"></span>
|
|
{% elif format == "jpg" %}
|
|
<span class="far fa-file-image fa-5x"></span>
|
|
{% elif format == "svgz"%}
|
|
<span class="far fa-file-code fa-5x"></span>
|
|
{% else %}
|
|
<span class="far fa-file fa-5x"></span>
|
|
{% endif %}
|
|
<br>{{format|upper}}
|
|
<br>({{file.2|filesizeformat}})
|
|
</a>
|
|
{% endfor %}
|
|
|
|
{% if map.output_files.indeces|length %}
|
|
{% for format,file in map.output_files.indeces.items %}
|
|
<a href="{{ file.0 }}" title="{{ file.1 }}" class="btn btn-default">
|
|
<span class="far fa-file fa-5x"></span>
|
|
<br>{{format|upper}}
|
|
<br>({{file.2|filesizeformat}})
|
|
</a>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
{% elif map.get_errorlog %}
|
|
<a class="btn btn-large tooltipped"
|
|
href="{{map.get_errorlog}}"
|
|
target="_blank"
|
|
data-placement="right"
|
|
data-original-title="{% trans "Something went wrong while processing this job." %}">
|
|
<i class="fas fa-ban"></i> {% trans "Error log" %}
|
|
</a>
|
|
{% else %}
|
|
<a class="btn btn-large disabled tooltipped"
|
|
data-placement="right"
|
|
data-original-title="{% trans "The generated files are no longer available." %}">
|
|
<i class="fas fa-ban"></i> {% trans "Download" %}
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% if map.needs_waiting %}
|
|
<span class="refresh-time pull-right">{% blocktrans %}Updating in <span>{{ refresh }}</span>s...{% endblocktrans %}</span>
|
|
{% endif %}
|
|
</div>
|
|
<div class="col-md-3">
|
|
{% if map.get_thumbnail %}
|
|
<img class="thumbnail" src="{{ map.get_thumbnail }}" />
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|