Clean up template

This commit is contained in:
Jeremy Stretch 2024-02-07 09:04:20 -05:00
parent 5939e1d440
commit c5916af1d0

View File

@ -20,6 +20,7 @@
{% block content %} {% block content %}
{% for module in script_modules %} {% for module in script_modules %}
{% include 'inc/sync_warning.html' with object=module %}
<div class="card"> <div class="card">
<h5 class="card-header justify-content-between" id="module{{ module.pk }}"> <h5 class="card-header justify-content-between" id="module{{ module.pk }}">
<div> <div>
@ -31,17 +32,15 @@
</a> </a>
{% endif %} {% endif %}
</h5> </h5>
<div class="card-body">
{% include 'inc/sync_warning.html' with object=module %}
{% if module.scripts %} {% if module.scripts %}
<table class="table table-hover scripts"> <table class="table table-hover scripts">
<thead> <thead>
<tr> <tr>
<th width="250">{% trans "Name" %}</th> <th>{% trans "Name" %}</th>
<th>{% trans "Description" %}</th> <th>{% trans "Description" %}</th>
<th>{% trans "Last Run" %}</th> <th>{% trans "Last Run" %}</th>
<th>{% trans "Status" %}</th> <th>{% trans "Status" %}</th>
<th width="120"></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -69,7 +68,7 @@
<div class="float-end d-print-none"> <div class="float-end d-print-none">
<form action="{% url 'extras:script' module=script.module name=script.class_name %}" method="post"> <form action="{% url 'extras:script' module=script.module name=script.class_name %}" method="post">
{% csrf_token %} {% csrf_token %}
<button type="submit" name="_run" class="btn btn-primary" style="width: 110px"> <button type="submit" name="_run" class="btn btn-primary btn-sm">
{% if last_job %} {% if last_job %}
<i class="mdi mdi-replay"></i> {% trans "Run Again" %} <i class="mdi mdi-replay"></i> {% trans "Run Again" %}
{% else %} {% else %}
@ -81,17 +80,17 @@
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
{% if last_job.data.logs %} {% if last_job %}
{% for method, stats in last_job.data.logs.items %} {% for test_name, data in last_job.data.tests.items %}
<tr> <tr>
<td colspan="4" class="method"> <td colspan="4" class="method">
<span class="ps-3">{{ method }}</span> <span class="ps-3">{{ test_name }}</span>
</td> </td>
<td class="text-end text-nowrap script-stats"> <td class="text-end text-nowrap script-stats">
<span class="badge text-bg-success">{{ stats.success }}</span> <span class="badge text-bg-success">{{ data.success }}</span>
<span class="badge text-bg-info">{{ stats.info }}</span> <span class="badge text-bg-info">{{ data.info }}</span>
<span class="badge text-bg-warning">{{ stats.warning }}</span> <span class="badge text-bg-warning">{{ data.warning }}</span>
<span class="badge text-bg-danger">{{ stats.failure }}</span> <span class="badge text-bg-danger">{{ data.failure }}</span>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -117,11 +116,12 @@
</tbody> </tbody>
</table> </table>
{% else %} {% else %}
<div class="card-body">
<div class="alert alert-warning" role="alert"> <div class="alert alert-warning" role="alert">
<i class="mdi mdi-alert"></i> Could not load scripts from {{ module.name }} <i class="mdi mdi-alert"></i> Could not load scripts from {{ module.name }}
</div> </div>
{% endif %}
</div> </div>
{% endif %}
</div> </div>
{% empty %} {% empty %}
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">