From 14b65ae456f6492fd0d383a7a5d5328e59cf301d Mon Sep 17 00:00:00 2001 From: mridulnagpal Date: Thu, 3 Nov 2016 12:10:56 +0530 Subject: [PATCH] letsencrypt: Improve display when no domains are configured Show better message, and hide diagnostics button. --- CHANGELOG.md | 2 + .../letsencrypt/templates/letsencrypt.html | 136 +++++++++--------- 2 files changed, 71 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95b40a066..716d15f22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/plinth/modules/letsencrypt/templates/letsencrypt.html b/plinth/modules/letsencrypt/templates/letsencrypt.html index 73219fce9..32567c4aa 100644 --- a/plinth/modules/letsencrypt/templates/letsencrypt.html +++ b/plinth/modules/letsencrypt/templates/letsencrypt.html @@ -34,72 +34,74 @@ {% endblock %} {% block configuration %} + {% if status.domains %} +
+
+ + + + + + + + + + + {% for domain, domain_status in status.domains.items %} + + + + + + + {% endfor %} + +
{% trans "Domain" %}{% trans "Certificate Status" %}{% trans "Website Security" %}{% trans "Actions" %}
{{ domain }} + {% if domain_status.certificate_available %} + + {% blocktrans trimmed with expiry_date=domain_status.expiry_date %} + Expires on {{ expiry_date }} + {% endblocktrans %} + + {% else %} + + {% trans "No certificate" %} + + {% endif %} + + {% if domain_status.web_enabled %} + {% trans "Enabled" %} + {% else %} + {% trans "Disabled" %} + {% endif %} + + {% if domain_status.certificate_available %} +
+ {% csrf_token %} + +
+
+ {% csrf_token %} + +
+ {% else %} +
+ {% csrf_token %} + +
+ {% endif %} +
+
+
-
-
- - - - - - - - - - - {% for domain, domain_status in status.domains.items %} - - - - - - - {% endfor %} - -
{% trans "Domain" %}{% trans "Certificate Status" %}{% trans "Website Security" %}{% trans "Actions" %}
{{ domain }} - {% if domain_status.certificate_available %} - - {% blocktrans trimmed with expiry_date=domain_status.expiry_date %} - Expires on {{ expiry_date }} - {% endblocktrans %} - - {% else %} - - {% trans "No certificate" %} - - {% endif %} - - {% if domain_status.web_enabled %} - {% trans "Enabled" %} - {% else %} - {% trans "Disabled" %} - {% endif %} - - {% if domain_status.certificate_available %} -
- {% csrf_token %} - -
-
- {% csrf_token %} - -
- {% else %} -
- {% csrf_token %} - -
- {% endif %} -
-
-
- - {% include "diagnostics_button.html" with module="letsencrypt" %} - + {% include "diagnostics_button.html" with module="letsencrypt" %} + {% else %} + No domains have been configured.... + {% endif %} {% endblock %}