Improved template for when no reports are found

This commit is contained in:
Jeremy Stretch 2017-10-11 13:30:38 -04:00
parent 043f2cb214
commit 51194e20f2

View File

@ -5,69 +5,77 @@
<h1>{% block title %}Reports{% endblock %}</h1> <h1>{% block title %}Reports{% endblock %}</h1>
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-9">
{% if reports %}
{% for module, module_reports in reports %} {% for module, module_reports in reports %}
<h3><a name="module.{{ module }}"></a>{{ module|bettertitle }}</h3> <h3><a name="module.{{ module }}"></a>{{ module|bettertitle }}</h3>
<table class="table table-hover table-headings reports"> <table class="table table-hover table-headings reports">
<thead> <thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>Description</th>
<th class="text-right">Last Run</th>
</tr>
</thead>
<tbody>
{% for report in module_reports %}
<tr> <tr>
<td> <th>Name</th>
<a href="{% url 'extras:report' name=report.full_name %}" name="report.{{ report.name }}"><strong>{{ report.name }}</strong></a> <th>Status</th>
</td> <th>Description</th>
<td> <th class="text-right">Last Run</th>
{% include 'extras/inc/report_label.html' %}
</td>
<td>{{ report.description|default:"" }}</td>
{% if report.result %}
<td class="text-right">{{ report.result.created }}</td>
{% else %}
<td class="text-right text-muted">Never</td>
{% endif %}
</tr> </tr>
{% for method, stats in report.result.data.items %} </thead>
<tbody>
{% for report in module_reports %}
<tr> <tr>
<td colspan="3" class="method"> <td>
{{ method }} <a href="{% url 'extras:report' name=report.full_name %}" name="report.{{ report.name }}"><strong>{{ report.name }}</strong></a>
</td> </td>
<td class="text-right stats"> <td>
<label class="label label-success">{{ stats.success }}</label> {% include 'extras/inc/report_label.html' %}
<label class="label label-info">{{ stats.info }}</label>
<label class="label label-warning">{{ stats.warning }}</label>
<label class="label label-danger">{{ stats.failure }}</label>
</td> </td>
<td>{{ report.description|default:"" }}</td>
{% if report.result %}
<td class="text-right">{{ report.result.created }}</td>
{% else %}
<td class="text-right text-muted">Never</td>
{% endif %}
</tr> </tr>
{% for method, stats in report.result.data.items %}
<tr>
<td colspan="3" class="method">
{{ method }}
</td>
<td class="text-right stats">
<label class="label label-success">{{ stats.success }}</label>
<label class="label label-info">{{ stats.info }}</label>
<label class="label label-warning">{{ stats.warning }}</label>
<label class="label label-danger">{{ stats.failure }}</label>
</td>
</tr>
{% endfor %}
{% endfor %} {% endfor %}
{% endfor %} </tbody>
</tbody> </table>
</table> {% endfor %}
{% endfor %} {% else %}
<div class="alert alert-info">
<strong>No reports found.</strong>
</div>
{% endif %}
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="panel panel-default"> {% if reports %}
{% for module, module_reports in reports %} <div class="panel panel-default">
<div class="panel-heading"> {% for module, module_reports in reports %}
<strong>{{ module|bettertitle }}</strong> <div class="panel-heading">
</div> <strong>{{ module|bettertitle }}</strong>
<ul class="list-group"> </div>
{% for report in module_reports %} <ul class="list-group">
<a href="#report.{{ report.name }}" class="list-group-item"> {% for report in module_reports %}
<i class="fa fa-list-alt"></i> {{ report.name }} <a href="#report.{{ report.name }}" class="list-group-item">
<div class="pull-right"> <i class="fa fa-list-alt"></i> {{ report.name }}
{% include 'extras/inc/report_label.html' %} <div class="pull-right">
</div> {% include 'extras/inc/report_label.html' %}
</a> </div>
{% endfor %} </a>
</ul> {% endfor %}
{% endfor %} </ul>
</div> {% endfor %}
</div>
{% endif %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}