Browse Source

Cambio forma de mostrar la versión

main
Celestino Rey 9 months ago
parent
commit
10d36350fe
3 changed files with 11 additions and 7 deletions
  1. +6
    -0
      src/gestion_reservas/context_processors.py
  2. +3
    -0
      src/gestion_reservas/settings.py
  3. +2
    -7
      src/templates/_branding.html

+ 6
- 0
src/gestion_reservas/context_processors.py View File

@ -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 View File

@ -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 View File

@ -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-->

Loading…
Cancel
Save