Procházet zdrojové kódy

Cambio forma de mostrar la versión

Celestino Rey před 1 rokem
rodič
revize
10d36350fe

+ 6 - 0
src/gestion_reservas/context_processors.py

@@ -0,0 +1,6 @@
+from django.conf import settings
+
+def app_version(request):
+    return {
+        'APP_VERSION': settings.APP_VERSION
+    }

+ 3 - 0
src/gestion_reservas/settings.py

@@ -14,6 +14,8 @@ from pathlib import Path
 import os
 import logging
 
+APP_VERSION = "11.0.2"
+
 # Build paths inside the project like this: BASE_DIR / 'subdir'.
 BASE_DIR = Path(__file__).resolve().parent.parent
 
@@ -70,6 +72,7 @@ TEMPLATES = [
                 'django.template.context_processors.request',
                 'django.contrib.auth.context_processors.auth',
                 'django.contrib.messages.context_processors.messages',
+                'gestion_reservas.context_processors.app_version',
             ],
             'libraries': {
                 'filtros_de_entorno': 'gestion_reservas.templatetags.filtros_de_entorno',

+ 2 - 7
src/templates/_branding.html

@@ -3,12 +3,7 @@
 {% load filtros_de_entorno %}
 
 <div class="app-branding">
-    <a class="app-logo" href="{% url 'principal' %}"><img class="logo-icon me-2" src="{% static 'images/palapadel.svg' %}" alt="logo"><span class="logo-text">JUGAR AL PADEL</span><span style="color: blue; font-size: 14px;"> 
-	{% if 'ENVIRONMENT'|muestra_version == 'Pruebas' %}
-			p 
-	{% else %}
-			v
-	{% endif %}
-		    {{ "VERSION"|muestra_version }}</span></a>
+    <a class="app-logo" href="{% url 'principal' %}"><img class="logo-icon me-2" src="{% static 'images/palapadel.svg' %}" alt="logo"><span class="logo-text">JUGAR AL PADEL</span>
+	<span style="color: blue; font-size: 14px;">Versión: {{ APP_VERSION }}</span></a>
 
 </div><!--//app-branding-->