From b30ae4a5c2873f456d4b5ffab3335d4b84118724 Mon Sep 17 00:00:00 2001 From: Alan Mitchell Date: Thu, 6 Apr 2017 20:31:35 -0800 Subject: [PATCH] Better formatting of version string. --- bmsapp/templates/bmsapp/base.html | 4 +++- bmsapp/view_util.py | 1 + bmsapp/views.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bmsapp/templates/bmsapp/base.html b/bmsapp/templates/bmsapp/base.html index ee54f52..cc805a1 100644 --- a/bmsapp/templates/bmsapp/base.html +++ b/bmsapp/templates/bmsapp/base.html @@ -35,8 +35,10 @@

{% block title %}{% endblock %}

{% block content %}{% endblock %}

 

-
+
+
+
BMON Version: {{ version_date }}
diff --git a/bmsapp/view_util.py b/bmsapp/view_util.py index 5db321a..9832fb3 100644 --- a/bmsapp/view_util.py +++ b/bmsapp/view_util.py @@ -322,6 +322,7 @@ def version_date_string(): """ ver_date = '' try: + # Need to move into directory where this code is located to execute Git command dir_git = os.path.dirname(__file__) result = check_output('cd %s; git log -n1' % dir_git, shell=True) for lin in result.splitlines(): diff --git a/bmsapp/views.py b/bmsapp/views.py index 6f7bd2a..fd288ab 100644 --- a/bmsapp/views.py +++ b/bmsapp/views.py @@ -27,9 +27,9 @@ DEFAULT_NAV_LINKS = ( ('Data Charts and Reports', 'reports', True), TMPL_CONTEXT = {'bmsapp_title_text': getattr(settings, 'BMSAPP_TITLE_TEXT', 'Facility Monitoring'), 'bmsapp_header': getattr(settings, 'BMSAPP_HEADER', 'Facility Monitoring'), - 'bmsapp_footer': getattr(settings, 'BMSAPP_FOOTER', - 'Thanks to Alaska Housing Finance Corporation for providing most of the source code for this application.') + '
' + view_util.version_date_string(), + 'bmsapp_footer': getattr(settings, 'BMSAPP_FOOTER', 'Thanks to Alaska Housing Finance Corporation for providing most of the source code for this application.'), 'bmsapp_nav_links': getattr(settings, 'BMSAPP_NAV_LINKS', DEFAULT_NAV_LINKS), + 'version_date': view_util.version_date_string(), } def base_context(): -- GitLab