From 436da33330433ebc3f11ecc51e4aac0aa396c32e Mon Sep 17 00:00:00 2001 From: s3lph Date: Sat, 8 Sep 2018 21:05:03 +0200 Subject: [PATCH] Added a not to the settings UI when sending of receipts has been disabled in the configuration. --- matemat/webserver/pagelets/admin.py | 2 +- matemat/webserver/pagelets/moduser.py | 2 +- templates/admin_all.html | 1 + templates/moduser.html | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/matemat/webserver/pagelets/admin.py b/matemat/webserver/pagelets/admin.py index 1aec0c1..d1866b2 100644 --- a/matemat/webserver/pagelets/admin.py +++ b/matemat/webserver/pagelets/admin.py @@ -48,7 +48,7 @@ def admin(method: str, return TemplateResponse('admin.html', authuser=user, authlevel=authlevel, users=users, products=products, receipt_preference_class=ReceiptPreference, - setupname=config['InstanceName']) + setupname=config['InstanceName'], config_smtp_enabled=config['SmtpSendReceipts']) def handle_change(args: RequestArguments, user: User, db: MatematDatabase, config: Dict[str, str]) -> None: diff --git a/matemat/webserver/pagelets/moduser.py b/matemat/webserver/pagelets/moduser.py index 140aed1..8be086c 100644 --- a/matemat/webserver/pagelets/moduser.py +++ b/matemat/webserver/pagelets/moduser.py @@ -57,7 +57,7 @@ def moduser(method: str, return TemplateResponse('moduser.html', authuser=authuser, user=user, authlevel=authlevel, receipt_preference_class=ReceiptPreference, - setupname=config['InstanceName']) + setupname=config['InstanceName'], config_smtp_enabled=config['SmtpSendReceipts']) def handle_change(args: RequestArguments, user: User, authuser: User, db: MatematDatabase, config: Dict[str, str]) \ diff --git a/templates/admin_all.html b/templates/admin_all.html index 616f255..b637cc7 100644 --- a/templates/admin_all.html +++ b/templates/admin_all.html @@ -14,6 +14,7 @@ {% endfor %} + {% if config_smtp_enabled != '1' %}Sending receipts is disabled by your administrator.{% endif %}
diff --git a/templates/moduser.html b/templates/moduser.html index 586d883..894d198 100644 --- a/templates/moduser.html +++ b/templates/moduser.html @@ -26,6 +26,7 @@ {% endfor %} + {% if config_smtp_enabled != '1' %}Sending receipts is disabled by your administrator.{% endif %}