maposmatic/www/maposmatic/templates/maposmatic/map-full-parts/rendering-status.html

174 wiersze
7.4 KiB
HTML

{% load i18n %}
{% load l10n %}
{% load extratags %}
<div class="container">
<div class="row">
<div class="col-md-9">
<table class="table table-striped">
<tr><td><strong>{% trans "Queue" %}</strong></td><td>{{ map.queue }}</td></tr>
{% with date=map.submission_time|date:"DATETIME_FORMAT" %}
<tr><td><strong>{% trans "Request submitted" %}</strong></td><td title="{{ date }}">{% blocktrans with map.submission_time|timesince as since %}{{since}} ago{% endblocktrans %}</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 }}">{% blocktrans with map.submission_time|timesince as since %}{{since}} ago{% endblocktrans %}, {% 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 }}">{% blocktrans with map.startofrendering_time|timesince as since %}{{since}} ago{% endblocktrans %}, {% 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 }}">{% blocktrans with map.endofrendering_time|timesince as since %}{{since}} ago{% endblocktrans %}, {% 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>
{% if map.status == 0 %}
<div class='alert alert-info' role='alert'>
<span class='spinner-border spinner-border-sm text-primary'></span>&nbsp;
{% blocktrans with counter=map.current_position_in_queue %}
Waiting for rendering to begin, {{ counter }} jobs still ahead of us
{% endblocktrans %}
</div>
{% elif map.status == 1 %}
<div class='alert alert-info' role='alert'>
<span class='spinner-border spinner-border-sm text-primary'></span>&nbsp;
{{ map.renderstep }}
</div>
{% elif map.status == 2 %}
{% if map.resultmsg == "ok" %}
<div class='alert alert-info' role='alert'>
{% trans "Rendering was successful." %}
</div>
{% else %}
<div class='alert alert-danger' role='alert'>
<h4><i class='fas fa-triangle-exclamation'></i> <b>{{ map.resultmsg }}</b></h4>
{% if not map.resultmsg|startswith:'Not enough memory' %}
{% if map|error_log_tail %}
{% blocktrans with url=map.get_errorlog %}
Check the <a target='_blank' href='{{ url }}'><i class='fas fa-file-lines'></i> error log</a> for more details<br>
{% endblocktrans %}
{% if settings.CONTACT_EMAIL %}
{% blocktrans with email=map|email_url %}
or contact {{ email }} for more information.
{% endblocktrans %}
{% endif %}
<hr><tt>{{ map|error_log_tail }}</tt>
{% endif %}
{% endif %}
</div>
{% endif %}
{% elif map.status == 3 %}
<div class='alert alert-warning' role='alert'>
{% if map.resultmsg == "ok" %}
{% trans "Rendering is obsolete: the rendering was successful, but the files are no longer available." %}
{% else %}
{% trans "Obsolete failed rendering: the rendering failed, and the incomplete files have been removed." %}
{% endif %}
</div>
{% elif map.status == 4 %}
<div class='alert alert-warning' role='alert'>
{% trans "The rendering was cancelled by the user." %}
</div>
{% else %}
<div class='alert alert-danger' role='alert'>{% trans "Unknown status" %} '{{ map.status }}'</div>
{% 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.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 %}
<!-- no more error output here -->
{% 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 %}
{% if map.needs_waiting %}
<input id="refreshtime" type="hidden" value="{{ refresh }}"</input>
{% if map.is_waiting %}
{% if 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>
{% endif %}
{% endif %}
{% endif %}
</div>
<div class="col-md-3">
{% if map.get_thumbnail %}
<img class="thumbnail" src="{{ map.get_thumbnail }}" />
{% endif %}
</div>
</div>
</div>