[damned-lies/develop: 225/226] feat: add current branch + commit info in about




commit 0b6c3d282e528d7d2aff7e2037219e41ff146cf7
Author: Guillaume Bernard <associations guillaume-bernard fr>
Date:   Mon Sep 5 10:59:57 2022 +0200

    feat: add current branch + commit info in about

 common/views.py                                         | 1 +
 containers/production/render_configuration_templates.sh | 5 +++++
 templates/about.html                                    | 6 +++++-
 3 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/common/views.py b/common/views.py
index fa825e19..65fcbd29 100644
--- a/common/views.py
+++ b/common/views.py
@@ -37,6 +37,7 @@ def about(request):
     else:
         translator_credits = [obfuscate_email(line) for line in translator_credits.split('\n')]
     context = {
+        'damned_lies_version': settings.VERSION or "unknown",
         'pageSection': 'home',
         'translator_credits': translator_credits,
     }
diff --git a/containers/production/render_configuration_templates.sh 
b/containers/production/render_configuration_templates.sh
index e4e2b52b..6f4f064f 100755
--- a/containers/production/render_configuration_templates.sh
+++ b/containers/production/render_configuration_templates.sh
@@ -8,6 +8,9 @@ set +C
 # Possible values are test or production (the default), the names of the configuration files in JSON
 declare -r KIND_OF_DEPLOYMENT="${1:-production}"
 
+declare -r DAMNED_LIES_VERSION="$(git log --pretty=format:'%h' -n 1)"
+declare -r DAMNED_LIES_DEVELOPMENT_BRANCH="$(git branch --show-current)"
+
 # THIS_SCRIPT_DIRECTORY: the current script directory name
 THIS_SCRIPT_DIRECTORY="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
 declare -r THIS_SCRIPT_DIRECTORY
@@ -20,3 +23,5 @@ for template in "${THIS_SCRIPT_DIRECTORY}"/configuration/*.jinja2; do
         "${THIS_SCRIPT_DIRECTORY}/configuration/${KIND_OF_DEPLOYMENT}.json" \
         > "${THIS_SCRIPT_DIRECTORY}/${KIND_OF_DEPLOYMENT}/$(basename "${template}" .jinja2)"
 done
+
+echo "VERSION = \"${DAMNED_LIES_VERSION} - ${DAMNED_LIES_DEVELOPMENT_BRANCH}\"" >> 
"${THIS_SCRIPT_DIRECTORY}/${KIND_OF_DEPLOYMENT}/local_settings.py"
diff --git a/templates/about.html b/templates/about.html
index 0633ea9e..a8d880ce 100644
--- a/templates/about.html
+++ b/templates/about.html
@@ -4,7 +4,11 @@
 
 {% block content %}
 <div id="about_page" class="mainpage">
-<h1>{% trans "About Damned Lies" %}</h1>
+
+<div class="row clearfix display-inline-block align-middle">
+    <button class="btn btn-info pull-right hidden-xs hidden-sm" style="margin: 20px 0 20px">{{ 
damned_lies_version }}</button>
+    <h1>{% trans "About Damned Lies" %}</h1>
+</div>
 
 <p>{% trans "Damned Lies is the Web application used to manage the localisation (l10n) of the GNOME 
project." %}
 {% blocktrans with link='https://l10n.gnome.org/help/vertimus_workflow/' %}It allows you to browse live 
statistics. Damned Lies also manages the translation <a href="{{ link }}">workflow</a>.{% endblocktrans %}</p>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]