1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/templates/extras/report.html

44 lines
1.5 KiB
HTML
Raw Permalink Normal View History

{% extends 'extras/report/base.html' %}
{% load helpers %}
2022-09-18 15:06:28 +02:00
{% load form_helpers %}
{% load i18n %}
2022-01-05 09:09:39 -05:00
{% block content %}
<div role="tabpanel" class="tab-pane active" id="report">
{% if perms.extras.run_report %}
2022-12-12 15:27:37 -05:00
<div class="row">
<div class="col">
{% if not report.is_valid %}
<div class="alert alert-warning">
<i class="mdi mdi-alert"></i>
{% trans "This report is invalid and cannot be run." %}
</div>
{% endif %}
2022-09-18 15:06:28 +02:00
<form action="{% url 'extras:report' module=report.module name=report.class_name %}" method="post" class="form-object-edit">
2022-12-12 15:27:37 -05:00
{% csrf_token %}
{% render_form form %}
<div class="float-end">
<button type="submit" name="_run" class="btn btn-primary"{% if not report.is_valid %} disabled{% endif %}>
2022-12-12 15:27:37 -05:00
{% if report.result %}
<i class="mdi mdi-replay"></i> {% trans "Run Again" %}
2022-12-12 15:27:37 -05:00
{% else %}
<i class="mdi mdi-play"></i> {% trans "Run Report" %}
2022-12-12 15:27:37 -05:00
{% endif %}
</button>
</div>
2022-01-05 09:09:39 -05:00
</form>
2022-09-18 15:06:28 +02:00
</div>
</div>
2022-01-05 09:09:39 -05:00
{% endif %}
<div class="row">
2022-12-12 15:27:37 -05:00
<div class="col col-md-12">
{% if report.result %}
{% trans "Last run" %}: <a href="{% url 'extras:report_result' job_pk=report.result.pk %}">
2022-12-12 15:27:37 -05:00
<strong>{{ report.result.created|annotated_date }}</strong>
</a>
{% endif %}
</div>
</div>
</div>
2022-01-05 09:09:39 -05:00
{% endblock content %}