Browse Source

Añado Acerca de...

main
Celestino Rey 7 months ago
parent
commit
1978b2b24c
8 changed files with 64 additions and 3 deletions
  1. +1
    -1
      JugarAlPadel/K8S/Makefile
  2. +1
    -0
      JugarAlPadel/K8S/env-prod-configmap.yaml
  3. +6
    -1
      JugarAlPadel/K8S/jugaralpadel-deployment.yaml
  4. +4
    -1
      JugarAlPadel/gestion_reservas/gestion_reservas/settings.py
  5. +1
    -0
      JugarAlPadel/gestion_reservas/gestion_reservas/urls.py
  6. +9
    -0
      JugarAlPadel/gestion_reservas/gestion_reservas/views.py
  7. +29
    -0
      JugarAlPadel/gestion_reservas/templates/acerca_de.html
  8. +13
    -0
      JugarAlPadel/gestion_reservas/templates/base.html

+ 1
- 1
JugarAlPadel/K8S/Makefile View File

@ -1,7 +1,7 @@
export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
export REGISTRY=registry.reymota.es
export IMG_VERSION = 0.70.22
export IMG_VERSION = 0.70.23
export IMG_NGINX_VERSION = 2.3
# limpia todo


+ 1
- 0
JugarAlPadel/K8S/env-prod-configmap.yaml View File

@ -1,6 +1,7 @@
apiVersion: v1
data:
DEBUG: "False"
APP_VERSION: 13.0.0
kind: ConfigMap
metadata:
labels:


+ 6
- 1
JugarAlPadel/K8S/jugaralpadel-deployment.yaml View File

@ -39,13 +39,18 @@ spec:
name: jugaralpadel
image: $REGISTRY/jugaralpadel-$ARQUITECTURA:$IMG_VERSION
env:
- name: VERSION
- name: IMG_VERSION
value: "$IMG_VERSION"
- name: DEBUG
valueFrom:
configMapKeyRef:
key: DEBUG
name: env-prod
- name: APP_VERSION
valueFrom:
configMapKeyRef:
key: APP_VERSION
name: env-prod
ports:
- containerPort: 8000
protocol: TCP


+ 4
- 1
JugarAlPadel/gestion_reservas/gestion_reservas/settings.py View File

@ -14,7 +14,10 @@ from pathlib import Path
import os
import logging
APP_VERSION = "11.0.2"
APP_NAME = "jugaralpadel.es"
APP_VERSION = os.environ.get("APP_VERSION", "0.0.0-dev") # Valor por defecto si no está definido
IMG_VERSION = os.environ.get("IMG_VERSION", "0.0.0-dev") # Valor por defecto si no está definido
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


+ 1
- 0
JugarAlPadel/gestion_reservas/gestion_reservas/urls.py View File

@ -38,6 +38,7 @@ urlpatterns = [
path('ayuda/', views.ayuda, name='ayuda'),
path('api/ayuda/', api_lista_ayuda, name='api_lista_ayuda'),
path("acerca-de/", views.acerca_de, name="acerca_de"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

+ 9
- 0
JugarAlPadel/gestion_reservas/gestion_reservas/views.py View File

@ -64,10 +64,19 @@ def ayuda(request):
return render(request, 'ayuda.html', {'elementos': elementos_ayuda, 'apartados': apartados})
def acerca_de(request):
context = {
"app_name": settings.APP_NAME,
"app_version": settings.APP_VERSION,
"img_version": settings.IMG_VERSION
}
return render(request, "acerca_de.html", context)
#
# API
#
@api_view(['GET'])
def api_lista_ayuda(request):
"""Devuelve la lista de toda la ayuda."""


+ 29
- 0
JugarAlPadel/gestion_reservas/templates/acerca_de.html View File

@ -0,0 +1,29 @@
{% extends "base.html" %}
{% load filtros_de_entorno %}
{% block content %}
<div class="container-xl">
<h1 class="app-page-title">Acerca de...</h1>
<div class="row g-4">
<div class="col-12 col-md-6">
<div class="app-card app-card-basic d-flex flex-column align-items-start shadow-sm">
<div class="app-card-body px-4">
<ul class="list-unstyled">
<li><strong>Nombre de la aplicación:</strong> {{ app_name }}</li>
<li><strong>Versión:</strong> {{ app_version }}</li>
{% if 'OPENSHIFT'|muestra_version == 'True' %}
<li><strong>Versión de la imagen:</strong> openshift </li>
{% else %}
<li><strong>Versión de la imagen:</strong> {{ img_version }}</li>
{% endif %}
</ul>
</div><!--//app-card-body-->
</div><!--//app-card-->
</div><!--//col-->
</div><!--//row-->
</div>
{% endblock %}

+ 13
- 0
JugarAlPadel/gestion_reservas/templates/base.html View File

@ -137,6 +137,19 @@
<span class="nav-link-text">Ayuda</span>
</a><!--//nav-link-->
</li><!--//nav-item-->
<li class="nav-item">
<!--//Bootstrap Icons: https://icons.getbootstrap.com/ -->
<a class="nav-link" href="{% url 'acerca_de' %}">
<span class="nav-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-exclamation-square" viewBox="0 0 16 16">
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/>
<path d="M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"/>
</svg>
</span>
<span class="nav-link-text">Acerca de...</span>
</a><!--//nav-link-->
</li><!--//nav-item-->
</ul><!--//app-menu-->
</nav><!--//app-nav-->


Loading…
Cancel
Save