FreedomBox/plinth/modules/diagnostics/templates/diagnostics_results.html
Fioddor Superconcentrado 633f54b75c
diagnostics: Lazy format all diagnostic test strings properly
Helps: #1938.

Fixed application of available translations in daemon.py and apache,
diagnostics, networks, firewall and users modules.

diagnostics:
- __init__.py: return the app name along its results.
- diagnostics.html: display the app name instead of its id.
- diagnostics_results.html:
  - mark for translation,
  - apply class to results <td> HTML tag.

main.css: center-align the results.

Locale files excluded. Will be regenerated automatically and translations to be
done via Weblate.

original testing (rebased later):
- Yapf applied.
- Flake8 without errors or warnings for changed files.
- (Unit) tests run without errors.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Translate 'None' app name]
[sunil: Don't translate tests strings second time in template]
[sunil: Tweak the center rule]
[sunil: Don't split a translation string]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-13 15:43:44 -07:00

33 lines
916 B
HTML

{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load i18n %}
<table class="table table-bordered table-striped diagnostics-results">
<thead>
<tr>
<th class="diagnostic-test">{% trans "Test" %}</th>
<th class="diagnostics-result">{% trans "Result" %}</th>
</tr>
</thead>
<tbody>
{% for test, result in results %}
<tr>
<td>{{ test }}</td>
<td class="diagnostics-result">
{% if result == 'passed' %}
<span class="label label-success">{% trans result %}</span>
{% elif result == 'failed' %}
<span class="label label-danger">{% trans result %}</span>
{% elif result == 'error' %}
<span class="label label-warning">{% trans result %}</span>
{% else %}
{{ result }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>