From c9ef057e341b2884791634ccf47f38ddad2c4e0e Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Wed, 10 Nov 2021 22:07:21 -0500 Subject: [PATCH] Underlining Apprise version info added to Frontend Display (#61) --- apprise_api/api/context_processors.py | 8 ++++++++ apprise_api/api/templates/base.html | 1 + apprise_api/api/templates/config.html | 27 +++++++++++++++++++-------- apprise_api/core/settings/__init__.py | 1 + apprise_api/static/css/base.css | 14 ++++++++++++++ 5 files changed, 43 insertions(+), 8 deletions(-) diff --git a/apprise_api/api/context_processors.py b/apprise_api/api/context_processors.py index 1756fca..e1fb378 100644 --- a/apprise_api/api/context_processors.py +++ b/apprise_api/api/context_processors.py @@ -24,6 +24,7 @@ # THE SOFTWARE. from .utils import ConfigCache from django.conf import settings +import apprise def stateful_mode(request): @@ -38,3 +39,10 @@ def config_lock(request): Returns the state of our global configuration lock """ return {'CONFIG_LOCK': settings.APPRISE_CONFIG_LOCK} + + +def apprise_version(request): + """ + Returns the current version of apprise loaded under the hood + """ + return {'APPRISE_VERSION': apprise.__version__} diff --git a/apprise_api/api/templates/base.html b/apprise_api/api/templates/base.html index dbf2dc2..a426d3a 100644 --- a/apprise_api/api/templates/base.html +++ b/apprise_api/api/templates/base.html @@ -34,6 +34,7 @@ {% trans

{% trans "Apprise API" %}

+ APPRISE v{{APPRISE_VERSION}} diff --git a/apprise_api/api/templates/config.html b/apprise_api/api/templates/config.html index a416670..cd0de34 100644 --- a/apprise_api/api/templates/config.html +++ b/apprise_api/api/templates/config.html @@ -24,13 +24,6 @@ Here is where you can store your Apprise configuration associated with the key {{key}}. {% endblocktrans %} -
  • - {% blocktrans %} - You can always refer to the - Apprise Wiki if you're having - troubles assembling your URL(s). - {% endblocktrans %} -
  • {% blocktrans %} In the future you can return to this configuration screen at any time by placing the following into your @@ -38,6 +31,24 @@ {% endblocktrans %} {{request.scheme}}://{{request.META.HTTP_HOST}}{{BASE_URL}}/cfg/{{key}}
  • +
  • + {% blocktrans %} + Use the settings Configuration section to prepare and save your Apprise configuration. + {% endblocktrans %} + +
  • +
  • + {% blocktrans %} + Use the announcement Notifications section to test out your saved configuration. + {% endblocktrans %} +
  • @@ -62,7 +73,7 @@ {% endif %}
    -
    {% trans "Working With Your Configuration" %}
    +
    {% trans "Working Remotely With Your Configuration" %}

    {% blocktrans %}The following command would cause apprise to directly notify all of your services:{% endblocktrans %}
    diff --git a/apprise_api/core/settings/__init__.py b/apprise_api/core/settings/__init__.py index e40bc07..93faa90 100644 --- a/apprise_api/core/settings/__init__.py +++ b/apprise_api/core/settings/__init__.py @@ -76,6 +76,7 @@ TEMPLATES = [ 'core.context_processors.base_url', 'api.context_processors.stateful_mode', 'api.context_processors.config_lock', + 'api.context_processors.apprise_version', ], }, }, diff --git a/apprise_api/static/css/base.css b/apprise_api/static/css/base.css index d67473a..432571c 100644 --- a/apprise_api/static/css/base.css +++ b/apprise_api/static/css/base.css @@ -3,6 +3,14 @@ font-size: 2.1rem; font-weight: bold; text-transform: uppercase; + float: left; +} + +/* Apprise Version */ +.nav i { + float: right; + font-style: normal; + font-size: 0.7rem; } code { @@ -42,6 +50,12 @@ textarea { padding: 1rem 2rem; } +#overview strong { + color: #004d40; + display: inline-block; + background-color: #eee; +} + .tabs .tab a{ border-radius: 25px 25px 0 0; color:#2bbbad;