1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Robin Schneider 0ad9b83623 Closes #5503: ISO 8601 date in UI and alternative format as tooltip
With this commit all dates in the UI are now consistently displayed.

I changed the long date format as suggested by @xkilian and confirmed by my own
research.

* DATETIME_FORMAT
 * Before July 20, 2020 4:52 p.m.
 * Now 20th July, 2020 16:52

"20th July, 2020" would be spoken as "the 20th of July, 2020" but the "the" and
"of" are never written.

The only exception is `object_list.html`. I tried it but there it does not
work so easily because the dates are passed to Jinja as SafeString.
2021-07-02 22:22:37 +02:00

103 lines
4.6 KiB
HTML

{% extends 'extras/report.html' %}
{% load helpers %}
{% load static %}
{% block title %}{{ report.name }} - {{ result.get_status_display }}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-12">
<p>
Run: <strong>{{ result.created|annotated_date }}</strong>
{% if result.completed %}
Duration: <strong>{{ result.duration }}</strong>
{% else %}
<img id="pending-result-loader" src="{% static 'img/ajax-loader.gif' %}" />
{% endif %}
<span id="pending-result-label">{% include 'extras/inc/job_label.html' with result=result %}</span>
</p>
{% if result.completed %}
<div class="panel panel-default">
<div class="panel-heading">
<strong>Report Methods</strong>
</div>
<table class="table table-hover panel-body">
{% for method, data in result.data.items %}
<tr>
<td><code><a href="#{{ method }}">{{ method }}</a></code></td>
<td class="text-right report-stats">
<label class="label label-success">{{ data.success }}</label>
<label class="label label-info">{{ data.info }}</label>
<label class="label label-warning">{{ data.warning }}</label>
<label class="label label-danger">{{ data.failure }}</label>
</td>
</tr>
{% endfor %}
</table>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<strong>Report Results</strong>
</div>
<table class="table table-hover panel-body report">
<thead>
<tr class="table-headings">
<th>Time</th>
<th>Level</th>
<th>Object</th>
<th>Message</th>
</tr>
</thead>
<tbody>
{% for method, data in result.data.items %}
<tr>
<th colspan="4" style="font-family: monospace">
<a name="{{ method }}"></a>{{ method }}
</th>
</tr>
{% for time, level, obj, url, message in data.log %}
<tr class="{% if level == 'failure' %}danger{% elif level %}{{ level }}{% endif %}">
<td>{{ time }}</td>
<td>
<label class="label label-{% if level == 'failure' %}danger{% else %}{{ level }}{% endif %}">{{ level|title }}</label>
</td>
<td>
{% if obj and url %}
<a href="{{ url }}">{{ obj }}</a>
{% elif obj %}
{{ obj }}
{% else %}
<span class="muted">&mdash;</span>
{% endif %}
</td>
<td class="rendered-markdown">{{ message|render_markdown }}</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="well">Pending results</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block javascript %}
<script type="text/javascript">
{% if not result.completed %}
var pending_result_id = {{ result.pk }};
{% else %}
var pending_result_id = null;
{% endif %}
function jobTerminatedAction(){
refreshWindow();
}
</script>
<script src="{% static 'js/job_result.js' %}?v{{ settings.VERSION }}"
onerror="window.location='{% url 'media_failure' %}?filename=js/job_result.js'"></script>
{% endblock %}