James Valleroy 1f90047621
diagnostics: Add shortcut to re-run setup for app
- When running diagnostics for an app, if there are any failures or warnings,
  then show a button to re-run setup.

- When showing all diagnostics results, if there are any failures or warnings
  for an app, then show a button to re-run setup for that app.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Use Result class instead of strings for comparison]
[sunil: Use flex box's justify-content-between to improve button styling]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-10-30 22:10:42 -07:00

36 lines
969 B
HTML

{% extends 'base.html' %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% block content %}
<h2>{% trans "Diagnostic Results" %}</h2>
<div class="row align-items-center justify-content-between">
<h3>{% blocktrans %}App: {{ app_name }}{% endblocktrans %}</h3>
{% if show_rerun_setup %}
<form class="form form-diagnostics-rerun-setup-button" method="post"
action="{% url 'rerun-setup' app_id=app_id %}">
{% csrf_token %}
<input type="submit" class="btn btn-default"
name="rerun-setup" value="{% trans "Re-run setup" %}"/>
</form>
{% endif %}
</div>
{% if results %}
{% include "diagnostics_results.html" with results=results %}
{% elif exception %}
<div class="alert alert-danger" role="alert">
{{ exception }}
</div>
{% else %}
<p>{% trans "This app does not support diagnostics" %}</p>
{% endif %}
{% endblock %}