letsencrypt: Improve display when no domains are configured

Show better message, and hide diagnostics button.
This commit is contained in:
mridulnagpal 2016-11-03 12:10:56 +05:30 committed by James Valleroy
parent d220fa946a
commit 14b65ae456
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 71 additions and 67 deletions

View File

@ -14,6 +14,8 @@ All notable changes to this project will be documented in this file.
- dynamicdns: Allow reading status as non-root.
- config: Set current domainname again after hostname change.
- config: Handle clearing of domain name.
- letsencrypt: When no domains are configured, show better message,
and hide diagnostics button.
### Changed
- repro: Use firewalld provided SIP services.

View File

@ -34,72 +34,74 @@
{% endblock %}
{% block configuration %}
{% if status.domains %}
<div class="row">
<div class="col-lg-12">
<table class="table table-bordered table-condensed table-striped">
<thead>
<tr>
<th>{% trans "Domain" %}</th>
<th>{% trans "Certificate Status" %}</th>
<th>{% trans "Website Security" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for domain, domain_status in status.domains.items %}
<tr>
<td>{{ domain }}</td>
<td>
{% if domain_status.certificate_available %}
<span class="label label-success">
{% blocktrans trimmed with expiry_date=domain_status.expiry_date %}
Expires on {{ expiry_date }}
{% endblocktrans %}
</span>
{% else %}
<span class="label label-warning">
{% trans "No certificate" %}
</span>
{% endif %}
</td>
<td>
{% if domain_status.web_enabled %}
<span class="label label-success">{% trans "Enabled" %}</span>
{% else %}
<span class="label label-warning">{% trans "Disabled" %}</span>
{% endif %}
</td>
<td>
{% if domain_status.certificate_available %}
<form class="form form-inline" method="post"
action="{% url 'letsencrypt:revoke' domain %}">
{% csrf_token %}
<button class="btn btn-sm btn-default" type="submit">
{% trans "Revoke" %}</button>
</form>
<form class="form form-inline" method="post"
action="{% url 'letsencrypt:obtain' domain %}">
{% csrf_token %}
<button class="btn btn-sm btn-default" type="submit">
{% trans "Re-obtain" %}</button>
</form>
{% else %}
<form class="form form-inline" method="post"
action="{% url 'letsencrypt:obtain' domain %}">
{% csrf_token %}
<button class="btn btn-sm btn-primary" type="submit">
{% trans "Obtain" %}</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<table class="table table-bordered table-condensed table-striped">
<thead>
<tr>
<th>{% trans "Domain" %}</th>
<th>{% trans "Certificate Status" %}</th>
<th>{% trans "Website Security" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for domain, domain_status in status.domains.items %}
<tr>
<td>{{ domain }}</td>
<td>
{% if domain_status.certificate_available %}
<span class="label label-success">
{% blocktrans trimmed with expiry_date=domain_status.expiry_date %}
Expires on {{ expiry_date }}
{% endblocktrans %}
</span>
{% else %}
<span class="label label-warning">
{% trans "No certificate" %}
</span>
{% endif %}
</td>
<td>
{% if domain_status.web_enabled %}
<span class="label label-success">{% trans "Enabled" %}</span>
{% else %}
<span class="label label-warning">{% trans "Disabled" %}</span>
{% endif %}
</td>
<td>
{% if domain_status.certificate_available %}
<form class="form form-inline" method="post"
action="{% url 'letsencrypt:revoke' domain %}">
{% csrf_token %}
<button class="btn btn-sm btn-default" type="submit">
{% trans "Revoke" %}</button>
</form>
<form class="form form-inline" method="post"
action="{% url 'letsencrypt:obtain' domain %}">
{% csrf_token %}
<button class="btn btn-sm btn-default" type="submit">
{% trans "Re-obtain" %}</button>
</form>
{% else %}
<form class="form form-inline" method="post"
action="{% url 'letsencrypt:obtain' domain %}">
{% csrf_token %}
<button class="btn btn-sm btn-primary" type="submit">
{% trans "Obtain" %}</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% include "diagnostics_button.html" with module="letsencrypt" %}
{% include "diagnostics_button.html" with module="letsencrypt" %}
{% else %}
No domains have been configured....
{% endif %}
{% endblock %}