From 3ae490f25f1160f34c0da392fc23c6d22dbc84b7 Mon Sep 17 00:00:00 2001 From: Juan Burgos Date: Mon, 3 Aug 2026 14:57:44 +0000 Subject: [PATCH] =?UTF-8?q?actualizaci=C3=B3n=20cero?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 70 +++- pdf/__pycache__/views.cpython-312.pyc | Bin 0 -> 9199 bytes pdf/views.py | 166 +++++++++ report-templates/default.htm | 183 ++++++++++ report-templates/export-pdf-report.htm | 60 ++++ reports/actor_pdf_report.html | 156 ++++++++ reports/bim_pdf_report.html | 476 +++++++++++++++++++++++++ reports/bm_pdf_report.html | 365 +++++++++++++++++++ reports/pi_pdf_report.html | 312 ++++++++++++++++ 9 files changed, 1786 insertions(+), 2 deletions(-) create mode 100644 pdf/__pycache__/views.cpython-312.pyc create mode 100644 pdf/views.py create mode 100644 report-templates/default.htm create mode 100644 report-templates/export-pdf-report.htm create mode 100644 reports/actor_pdf_report.html create mode 100644 reports/bim_pdf_report.html create mode 100644 reports/bm_pdf_report.html create mode 100644 reports/pi_pdf_report.html diff --git a/README.md b/README.md index dbc8e37..29db067 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,69 @@ -# sprpcb-exportpdf-func +# exportPDF -Funcionalidad para exportar datos de un recurso a un archivo PDF \ No newline at end of file +Funcionalidad para implementar la capacidad de exportar los datos de un recurso a formato PDF. +Los modelos de recursos habilitados para la función son los siguientes: + +* Patrimonio material - Bienes inmuebles +* Patrimonio material - Bienes muebles +* Patrimonio inmaterial +* Organización o persona + +# Para agregar la funcionalidad ExportPDF a un proyecto de Arches puede seguir el siguiente procedimiento. +Procedimiento válido para un proyecto en modo desarrollo implementado con un enfoque tradicional sin contenedores. +Para el caso de un enfoque utilizando contenedores o en moo Producción, el procesos varía levemente. + +### 1. Clonar este repositorio en alguna carpeta de su servidor). + +```shell +pip install git+https://gitea.patrimonio.org.bo/sysadmin/sprpcb-resumen-app.git +``` + +### 2. Agregar la vista personalizada creando (copiando) la carpeta indicada y moviendo la vista adentro: + +```properties +INSTALLED_APPS = ( +# otras aplicaciones ya enumeradas + "resumen", + "arches_proy", # Ensure the project is listed before any other arches applications +) +``` +### 3. Agregar la entrada de ruta en el archivo urls.py del proyecto: + +```shell +from django.urls import include, re_path, path # re_path añadido + +urlpatterns = [ + re_path(r"^", include("resumen.urls")), # Línea añadida + # project-level urls +] +``` + +### 4. Copiar las plantillas de la funcionalidad correspondientes a los modelos de recursos: +```python +python manage.py migrate +``` + +### 5. Copiar los arachivos necesarios para una nueva plantilla de reporte: +```python +python manage.py migrate +``` + +### 6. Registrar la plantilla personalizada de proyecto que agrega los botones necesarios: +```python +python manage.py migrate +``` + +### 7. A continuación, asegúrese de reconstruir la interfaz de su proyecto para incluir el complemento: + +``` +npm run build_development +``` + +### 8. Cuando haya terminado, debería ver los botones de exportar en la ventana de vista de reporte de su modelo de recursos: +![image.png](https://gitea.patrimonio.org.bo/sysadmin/sprpcb-resumen-app/attachments/a9b5011e-ce70-482e-8953-da45ff04ca1c) + +### 9. Forma de uso: + +``` + +``` \ No newline at end of file diff --git a/pdf/__pycache__/views.cpython-312.pyc b/pdf/__pycache__/views.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa75c538292beb285df01ecf343cffda739e6fb7 GIT binary patch literal 9199 zcmcgRYit`wdb4~#MT!r-Wl@$aiIOSFdMk+)JF+cHmTbpzUP^q-lDm{i^VQv@9WhIU z!5N60x`@)t)ehpjV~U`sAPykk^@k4)t_p$zPJ2L?rUDTg8JD6)arvjjL6PK7`^}O| zO0siKTc87Sc4qdQZ@!uN-uo|RvjIW*)9dlj@GgY@9e3oSC^qi>9vW8=g(xD7=I~Py zCL)SC1%cbjuri{WQ%P-ASRK*KX{5F~tc~dAbW&Rr)<+C;2C1zL8zZJUlhoFQ%@OmQ zS!(OU6%osvMQR(u)=1@CrPMZtZ4vvNU22=cj)-&48L679lKMordahcct7fi-GG9b< zwNxclagms-qb$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XE5mWrRl4UYo_*M`>&4QeaQPwJF?9Z-#C!9;p)tKLtnO`4>lx>pI);(1%lBrb~AZ1 zd~1);b~1fbFz?Q)TJlDFy5KoUj+q7)-jU47Y!F^l3kFLZbA3gk&OQ=&31#4?2g1J`2N~0tI&cmt1F_zYLE%~ zy2%80wg@TNqJqKECBZ+EA_8o6M13F;1s5n5W(x*S7XxzzpE4QAvWe>W0yZ|-#1t$J zwsH&(Qwrt}hn)rUhgF;uF%%qK?1;lRN+2{5rpK7~pbH->5Q_tgO(j7P_cVww+(9*W zQ0pDke+SjyK|OcS-aDvK`Ze4^4Sz&!pCjYv$ndqQnXuhELO2QQ*WEgz@}A=)K{%v^ F{u_)X(Ut%J literal 0 HcmV?d00001 diff --git a/pdf/views.py b/pdf/views.py new file mode 100644 index 0000000..3d8eab5 --- /dev/null +++ b/pdf/views.py @@ -0,0 +1,166 @@ +# mi_proyecto/pdf/views.py +# dpsk - 2026 +import io +from pathlib import Path +from django.http import HttpResponse +from django.template.loader import render_to_string +from weasyprint import HTML +from arches.app.models.resource import Resource +from django.contrib.auth.models import Group +from datetime import datetime +from zoneinfo import ZoneInfo +from functools import reduce +from operator import getitem +from pypdf import PdfReader, PdfWriter +import json +import ast + +def ajustar_medios(resource_media_rel, medios_list): + medios = [] + img=["image/bmp", "image/gif", "image/jpg", "image/jpeg", "image/png", "image/tif", "image/tiff"] + no_imagen_principal = True + try: + if isinstance(medios_list, list) : + for rel in resource_media_rel['related_resources']: + if isinstance(medios_list[0], dict) : + medio=next((item for item in medios_list if item['@value'] == rel['displayname']), None) + else: + medio = None + for til in rel['tiles']: + for dato in til['data']: + if isinstance(til['data'][dato], list): + for dat in til['data'][dato]: + idx = " - " + str(dat['index'] +1) if len(til['data'][dato])>1 else "" + if medio is not None and isinstance(medio, dict): + medio_nuevo = {'tipo': val for key, val in medio.items() if "Tipo" in key} + else: + if dat['type'] in img and no_imagen_principal: + medio_nuevo = {'tipo':'Imagen principal'} + no_imagen_principal = False + else: + medio_nuevo = {'tipo':'Medio'} + medio_nuevo.update({'@value':rel['displayname']+idx, 'file':dat['name'], 'url': dat['url'], 'formato':dat['type']}) + medios.append(medio_nuevo) + + # Reordenamos para que el primer medio de la lista sea de tipo Imagen principal o al menos del tipo imagen + medios.sort(key=lambda item: item.get('formato') not in img) + medios.sort(key=lambda item: item.get('tipo') != 'Imagen principal') + + except: + pass + return medios + +def find_key_path(data, target_key, current_path=None): + if current_path is None: + current_path = [] + + # Verifica si es diccionario válido + if isinstance(data, dict): + for key, value in data.items(): + # si la clave buscada está en el nivel actual del diccionario. + if key == target_key: + return current_path + [key] + + # Profundiza en el rastreo mientras agrega la clave actual a la ruta. + path = find_key_path(value, target_key, current_path + [key]) + if path: + return path + # En caso de que la clave esté dentro de una lista + elif isinstance(data, list): + for index, item in enumerate(data): + path = find_key_path(item, target_key, current_path + [index]) + if path: + return path + return None + +def strdict_to_dict(strdict): + """ Representación de texto de un diccionario a formato json """ + value = {} + try: + if isinstance(strdict, str): + value = json.dumps(ast.literal_eval(strdict)) + except: + pass + return value + +def export_resource_pdf(request, resourceid, printubic, printimgs, printpdfs): + resource = Resource.objects.get(pk=resourceid) + resource_data = resource.to_json() + + # Corrección de medios relacionados, se normalizan claves y se adicionan propiedades + ruta_medios = find_key_path( resource_data, "Medio de información") + if ruta_medios is not None: + valor_medios=reduce(lambda dict_layer, key: dict_layer[key], ruta_medios, resource_data) + resource_rel=resource.get_related_resources(user=request.user,resourceinstance_graphid='6afc4e9e-727e-4152-8084-309267752650') + #resource_data["Información gráfica"]["Medio de información"] = ajustar_medios(resource_rel) + reduce(getitem, ruta_medios[:-1], resource_data)[ruta_medios[-1]] = ajustar_medios(resource_rel,valor_medios) + + # Cambio de datos gis en texto a formato json + ruta_gis = find_key_path( resource_data, "Coordenadas / Geometría") + if ruta_gis is not None: + valor_gis=reduce(lambda dict_layer, key: dict_layer[key], ruta_gis, resource_data)["@value"] + reduce(getitem, ruta_gis[:-1], resource_data)[ruta_gis[-1]]["@value"] = strdict_to_dict(valor_gis) + + # Extracción del identificador de grupo ETA + eta_group="" + ruta_meta_iden = find_key_path( resource_data, "Meta identificación") + if ruta_meta_iden is not None: + meta_iden=json.loads(strdict_to_dict(reduce(lambda dict_layer, key: dict_layer[key], ruta_meta_iden, resource_data))) + eta_group=str(Group.objects.get(pk=meta_iden["grp_eta"])).upper() + + # Fecha del informe + sprpcb_url=request.build_absolute_uri('/')[:-1] + fecha=datetime.now(ZoneInfo("America/La_Paz")) + + resources = [{ + 'resourceinstanceid': str(resource.resourceinstanceid), + 'graph_id': str(resource.graph_id), + 'displayname': resource.displayname, + 'resource': resource_data, + 'sprpcb_url': sprpcb_url, + 'fecha': fecha, + 'eta_group': eta_group, + 'print_imgs': bool(int(printimgs)), + 'print_pdfs': bool(int(printpdfs)) + }] + + context = {'resources': resources} + + match str(resource.graph_id): + case "72420da0-db59-4048-aea2-03b0bc5cdcdf": # Actores + context["resources"][0]["grafo"]="Organizaciones y personas" + nombre_pdf = f'Actor_{resourceid}' + html_string = render_to_string('reports/actor_pdf_report.html', context) + case '8ea3bf67-89ce-474c-b3cb-6dd5ee3d6198': # Bienes inmuebles + context["resources"][0]["grafo"]="Patrimonio material - Bienes inmuebles" + html_string = render_to_string('reports/bim_pdf_report.html', context) + nombre_pdf = f'bienes_inmuebles_{resourceid}' + case '10b03fec-4d85-11ee-a708-ffcd06c08a5d': # Bienes muebles + context["resources"][0]["grafo"]="Patrimonio material - Bienes muebles" + html_string = render_to_string('reports/bm_pdf_report.html', context) + nombre_pdf = f'bienes_muebles_{resourceid}' + case "9b0e22c7-5c56-4be6-aa89-ae2632ba28e8": # Inmaterial + context["resources"][0]["grafo"]="Patrimonio Inmaterial" + html_string = render_to_string('reports/pi_pdf_report.html', context) + nombre_pdf = f'Inmaterial_{resourceid}' + + gen_pdf_file = HTML(string=html_string, base_url=request.build_absolute_uri("/")).write_pdf() + + merger = PdfWriter() + merger.append(PdfReader(io.BytesIO(gen_pdf_file))) + + root_path = Path(__file__).resolve().parent.parent + + for medio in reduce(getitem, ruta_medios[:-1], resource_data)[ruta_medios[-1]] : + if medio['formato'] == 'application/pdf' and bool(int(printpdfs)) : + merger.append(PdfReader(f'{root_path}/uploadedfiles/{medio["file"]}')) + output_buffer = io.BytesIO() + merger.write(output_buffer) + merger.close() + else: + output_buffer = io.BytesIO() + merger.write(output_buffer) + merger.close() + response = HttpResponse(output_buffer.getvalue(), content_type='application/pdf') + response['Content-Disposition'] = f'attachment; filename="{nombre_pdf}.pdf"' + return response \ No newline at end of file diff --git a/report-templates/default.htm b/report-templates/default.htm new file mode 100644 index 0000000..c08065c --- /dev/null +++ b/report-templates/default.htm @@ -0,0 +1,183 @@ +{% load i18n %} + + +{% block report %} + + +{% block report_title_bar %} + +
+ + +
+
-
+ + +
+

+ + +

+ +
+ +
+
+
+{% endblock report_title_bar %} + + + +
+ + {% block header %} + {% endblock header %} + + {% block body %} + +
+ + +
+ + +
+ + +
+
+ + +
+
+ +
+ + +
+
+ {% endblock body %} + + + {% block related_resources %} + + {% endblock related_resources %} + + {% block footer %} + {% endblock footer %} +
+{% endblock report %} + + + +{% block summary %} +
+ + +
+

-

+ + +
+

+ + +

+
+
+
+ +
+
+
+ + +
+ +
+ + +
+
+
+{% endblock summary %} + + + + + + +{% block header_form %} +{% endblock header_form %} + diff --git a/report-templates/export-pdf-report.htm b/report-templates/export-pdf-report.htm new file mode 100644 index 0000000..9f064dc --- /dev/null +++ b/report-templates/export-pdf-report.htm @@ -0,0 +1,60 @@ + +{% extends "views/report-templates/default.htm" %} +{% load i18n %} + +{% block header %} + {{ block.super }} +
+
+ +
+
+
+
+
+
+
+
+{% endblock header %} + +{% block body %} + +
{% trans 'This resource has provisional edits (not displayed in this report) that are pending review' %}
+ + +
{% trans 'This resource has provisional edits (not displayed in this report) that are pending review' %}
+ + +
{% trans 'This resource has provisional edits that are pending review' %}
+ + +
+
+ + +
+
+ +
+ + +
+
+ {% endblock body %} diff --git a/reports/actor_pdf_report.html b/reports/actor_pdf_report.html new file mode 100644 index 0000000..53ce996 --- /dev/null +++ b/reports/actor_pdf_report.html @@ -0,0 +1,156 @@ + +{% load template_tags %} +{% for resource in resources %} + {% with resource_data=resource.resource %} + + + + + + {{ resource.grafo }} ID de sistema: {{ resource.resourceinstanceid }} + + + + {% if resource_data %} +

{{ resource.displayname|truncatewords:10 }}

+
+
+
Identificación
+ {% if resource_data|has_key:"Identificación" %} + {% for iden in resource_data|val_from_key:"Identificación" %} +
+ Nombre / Título : + {{ iden|val_from_key:"@value" }} +
+
+ Tipo de actor : + {{ iden|val_from_key:"Tipo de actor" }} +
+
+ Cargo : + {{ iden|val_from_key:"Cargo" }} +
+ {% endfor %} + {% endif %} +
+
+
Características
+ {% if resource_data|has_key:"Detalles del actor" %} +
+ Grupo etario: + {{ resource_data|val_from_key:"Detalles del actor"|val_from_key:"Grupo etario" }} +
+
+ Rasgo Cultural Principal: + {{ resource_data|val_from_key:"Detalles del actor"|val_from_key:"Rasgo Cultural Principal" }} +
+
+ Otro rasgo cultural: + {{ resource_data|val_from_key:"Detalles del actor"|val_from_key:"Otro rasgo cultural" }} +
+
+ Sexo: + {{ resource_data|val_from_key:"Detalles del actor"|val_from_key:"Sexo" }} +
+
+ Nº de personas (aprox.): + {{ resource_data|val_from_key:"Detalles del actor"|val_from_key:'Cantidad de personas del grupo(aprox.)' }} +
+ {% endif %} +
+
+
+
Imagen de referencia
+ {% if resource_data|has_key:"Imagen de referencia" %} +
+ foto +
+ {% endif %} +
+
+
+
Ubicación
+
+
+ {% if resource_data|has_key:"Ubicación simple" %} +
+ Localidad: + {{ resource_data|val_from_key:"Ubicación simple"|val_from_key:"Departamento" }} +
+
+ Otra localidad: + {{ resource_data|val_from_key:"Ubicación simple"|val_from_key:"Otra localidad" }} +
+
+ Coordenadas / Geometría: +
+ {% if resource_data|val_from_key:"Ubicación simple"|has_key:"Coordenadas / Geometría" %} + {% with gis_vector=resource_data|val_from_key:"Ubicación simple"|val_from_key:"Coordenadas / Geometría"|val_from_key:"@value"|json_to_obj %} + {% for gis in gis_vector.features %} +
+ {{ gis.geometry }} +
+ {% endfor %} + {% endwith %} +
+ Geometría principal: + {{ resource_data|val_from_key:"Ubicación simple"|val_from_key:"Coordenadas / Geometría"|val_from_key:"Tipo de geometría" }} +
+ {% endif %} + {% endif %} +
+
+
+
Mapa de referencia
+
+
+
+
+
Notas
+ {% if resource_data|has_key:"Descripción / Notas" %} + {% for desc in resource_data|val_from_key:"Descripción / Notas" %} +
+ {{ desc|val_from_key:"Tipo de descripción" }} +
+
+ {{ desc|val_from_key:"Descripción"|safe|cut:"

 

" }}
+
+ {% endfor %} + {% endif %} +
+ {% else %} +

El recurso no tiene información.

+ {% endif %} + + {% endwith %} +{% endfor %} + \ No newline at end of file diff --git a/reports/bim_pdf_report.html b/reports/bim_pdf_report.html new file mode 100644 index 0000000..6dd600e --- /dev/null +++ b/reports/bim_pdf_report.html @@ -0,0 +1,476 @@ + +{% load template_tags %} +{% for resource in resources %} + {% with resource_data=resource.resource %} + + + + + + {{ resource.grafo }} ID de sistema: {{ resource.resourceinstanceid }} + + + + {% if resource_data %} +

{{ resource.displayname|truncatewords:10 }}

+
+
+
Identificación
+ {% if resource_data|has_key:"Identificación" %} +
+ Ámbito / subámbito: + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Ámbito / subámbito' }} +
+
+ Código principal: + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Código principal" }} +
+ {% if resource_data|val_from_key:"Identificación"|has_key:"Código institucional" %} + Código alternativo: + {% for cod in resource_data|val_from_key:"Identificación"|val_from_key:"Código institucional" %} +
+ {{ cod|val_from_key:"Tipo de código" }}: + {{ cod|val_from_key:"@value" }} +
+ {% endfor %} + {% endif %} + Denominación + {% for nom in resource_data|val_from_key:"Identificación"|val_from_key:"Denominación" %} +
+ {{ nom|val_from_key:"Tipo de nombre" }} : + {{ nom|val_from_key:"@value" }} +
+ {% endfor %} +
+ Época : + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Época'|val_from_key:"@value" }} +
+
+ Otra época : + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Época'|val_from_key:"Otro" }} +
+
+ Autor / constructor : + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Autor / constructor" }} +
+
+ Uso original : + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Uso original" }} +
+
+ Año : + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Año" }} +
+
+ Uso actual : + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Uso actual" }} +
+
+ Estilo / filiación cultural: + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Estilo / filiación cultural" }} +
+
+ Tipología : + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Tipología" }} +
+ {% endif %} +
+
+
+
Imagen de referencia
+ {% if resource_data|has_key:"Recursos" %} + {% with medios=resource_data|val_from_key:'Recursos'|val_from_key:'Medio de información' %} + {{medios.0.file}} + {% endwith %} + {% endif %} +
+
+
+
+
+
Ubicación
+ {% if resource_data|has_key:"Ubicación BIM" %} +
+ Localidad : + {{ resource_data|val_from_key:"Ubicación BIM"|val_from_key:"Departamento" }} +
+
+ Departamento : + {{ resource_data|val_from_key:"Ubicación BIM"|val_from_key:"Ubicación extendida" }} +
+
+ Calle/Avenida/Pasaje : + {{ resource_data|val_from_key:"Ubicación BIM"|val_from_key:"Calle/Avenida/Pasaje" }} +
+
+ Número : + {{ resource_data|val_from_key:"Ubicación BIM"|val_from_key:"Número" }} +
+
+ Zona : + {{ resource_data|val_from_key:"Ubicación BIM"|val_from_key:"Zona" }} +
+
+ Coordenadas / Geometría: +
+ {% if resource_data|val_from_key:"Ubicación BIM"|has_key:"Coordenadas / Geometría" %} + {% with gis_vector=resource_data|val_from_key:"Ubicación BIM"|val_from_key:"Coordenadas / Geometría"|val_from_key:"@value"|json_to_obj %} + {% for gis in gis_vector.features %} +
+ {{ gis.geometry }} +
+ {% endfor %} + {% endwith %} +
+ Geometría principal : {{ resource_data|val_from_key:"Ubicación BIM"|val_from_key:"Coordenadas / Geometría"|val_from_key:"Tipo de geometría" }} +
+ {% endif %} + {% endif %} +
+
+
+
Mapa de referencia
+
+
+
+
+
Marco legal
+ {% if resource_data|has_key:"Marco Legal BM" %} +
+
+
+ Es de interés patrimonial : + {{ resource_data|val_from_key:"Marco Legal BM"|val_from_key:"Es de interés patrimonial"|yesno:"Si,No" }} +
+
+ Protección : + {{ resource_data|val_from_key:"Marco Legal BM"|val_from_key:"Protección" }} +
+
+
+
+
+ Propietario(s) : + {{ resource_data|val_from_key:"Marco Legal BM"|val_from_key:'Propietario/s'|val_from_key:"@value" }} +
+
+ Tipo : + {{ resource_data|val_from_key:"Marco Legal BM"|val_from_key:'Propietario/s'|val_from_key:"Tipo de propietario" }} +
+
+ Propiedad con: + {{ resource_data|val_from_key:"Marco Legal BM"|val_from_key:'Propietario/s'|val_from_key:"Propiedad con" }} +
+
+
+
+ {% endif %} +
+
+
Características
+ {% if resource_data|has_key:"Características BiM" %} + {% with caracteristica=resource_data|val_from_key:"Características BiM" %} +
+
+ Número de niveles : {{ caracteristica|val_from_key:'Niveles'|val_from_key:"@value" }} + Cambios : {{ caracteristica|val_from_key:"Niveles"|val_from_key:'Cambios'|val_from_key:"@value" }} +
+
+ {% if caracteristica|has_key:"Mediciones" %} +
+ Mediciones : +
+ {% for item in caracteristica|val_from_key:"Mediciones" %} +
+
+ {{item|val_from_key:"Tipo de medida"}} : {{ item|val_from_key:"Medida"|val_from_key:"Valor de la medida" }} {{ item|val_from_key:"Medida"|val_from_key:"Unidad de medida" }} +
+
+ {% endfor %} +
+
+ {% endif %} +
+
+ Servicios : + {{ caracteristica|val_from_key:'Servicios' }} +
+
+
+ {% if caracteristica|has_key:"Valorización" %} +
+ Valorización : + {{caracteristica|val_from_key:"Valorización"|val_from_key:"@value"}} +
+
+ Ponderación total : + {{caracteristica|val_from_key:"Valorización"|val_from_key:"Ponderación total"}} +
+
+ Valor resultante : + {{caracteristica|val_from_key:"Valorización"|val_from_key:"Valor resultante"}} +
+ {% endif %} +
+
+
+ Factores de deterioro : + {{ caracteristica|val_from_key:'Factores de deterioro' }} +
+
+ Estado de conservación : + {{ caracteristica|val_from_key:'Estado de conservación' }} +
+
+
+
Datos del inmueble
+ {% if caracteristica|has_key:"Datos del inmueble" %} + {% if caracteristica|val_from_key:"Datos del inmueble"|val_from_key:"Interior"|has_key:"Sección interior" %} +
+ Sección Interior +
+ {% for sec_int in caracteristica|val_from_key:"Datos del inmueble"|val_from_key:"Interior"|val_from_key:"Sección interior" %} + {% if sec_int|has_key:"Elemento sección interior" %} +
+ {{ sec_int|val_from_key:"@value" }}{{ sec_int|val_from_key:"Elemento sección interior"|val_from_key:"@value" }} +
+
+
+
Elemento
+
Material(es)
+
Detalles artísticos
+
Estado
+
Cambios
+
+ {% for elem in sec_int|val_from_key:"Elemento sección interior"%} +
+
{{elem|val_from_key:"@value"}}
+
{{elem|val_from_key:"Material"}}
+
{{elem|val_from_key:"Detalles artísticos"}}
+
{{elem|val_from_key:"Estado"}}
+
{{elem|val_from_key:"Cambios"}}
+
+ {% endfor %} +
+ {% endif %} + {% endfor %} + {% endif %} + {% if caracteristica|val_from_key:"Datos del inmueble"|val_from_key:"Exterior"|has_key:"Sección exterior" %} +
+ Sección Exterior +
+ {% for sec_ext in caracteristica|val_from_key:"Datos del inmueble"|val_from_key:"Exterior"|val_from_key:"Sección exterior" %} + {% if sec_ext|has_key:"Elemento - sección exterior" %} +
+ {{ sec_ext|val_from_key:"@value" }}{{ sec_ext|val_from_key:"Elemento - sección exterior"|val_from_key:"@value" }} +
+
+
+
Elemento
+
Material(es)
+
Detalles artísticos
+
Estado
+
Cambios
+
+ {% for elem in sec_ext|val_from_key:"Elemento - sección exterior"%} +
+
{{elem|val_from_key:"@value"}}
+
{{elem|val_from_key:"Material"}}
+
{{elem|val_from_key:"Detalles artísticos"}}
+
{{elem|val_from_key:"Estado"}}
+
{{elem|val_from_key:"Cambios"}}
+
+ {% endfor %} +
+ {% endif %} + {% endfor %} + {% endif %} + {% if caracteristica|val_from_key:"Datos del inmueble"|val_from_key:"Espacios exteriores "|has_key:"Sección espacios exteriores" %} +
+ Espacios exteriores +
+ {% for esp_ext in caracteristica|val_from_key:"Datos del inmueble"|val_from_key:"Espacios exteriores "|val_from_key:"Sección espacios exteriores" %} + {% if esp_ext|has_key:"Elemento - espacio exterior" %} +
+ {{ esp_ext|val_from_key:"@value" }}{{ esp_ext|val_from_key:"Elemento - espacio exterior"|val_from_key:"@value" }} +
+
+
+
Elemento
+
Material(es)
+
Detalles artísticos
+
Estado
+
Cambios
+
+ {% for elem in esp_ext|val_from_key:"Elemento - espacio exterior"%} +
+
{{elem|val_from_key:"@value"}}
+
{{elem|val_from_key:"Material"}}
+
{{elem|val_from_key:"Detalles artísticos"}}
+
{{elem|val_from_key:"Estado"}}
+
{{elem|val_from_key:"Cambios"}}
+
+ {% endfor %} +
+ {% endif %} + {% endfor %} + {% endif %} + {% if caracteristica|val_from_key:"Datos del inmueble"|val_from_key:"Espacios de circulación"|has_key:"Sección espacios de circulación" %} +
+ Espacios de circulación +
+ {% for esp_circ in caracteristica|val_from_key:"Datos del inmueble"|val_from_key:"Espacios de circulación"|val_from_key:"Sección espacios de circulación" %} + {% if esp_circ|has_key:"Elemento - espacio de circulación" %} +
+ {{ esp_circ|val_from_key:"@value" }}{{ esp_circ|val_from_key:"Elemento - espacio de circulación"|val_from_key:"@value" }} +
+
+
+
Elemento
+
Material(es)
+
Detalles artísticos
+
Estado
+
Cambios
+
+ {% for elem in esp_circ|val_from_key:"Elemento - espacio de circulación"%} +
+
{{elem|val_from_key:"@value"}}
+
{{elem|val_from_key:"Material"}}
+
{{elem|val_from_key:"Detalles artísticos"}}
+
{{elem|val_from_key:"Estado"}}
+
{{elem|val_from_key:"Cambios"}}
+
+ {% endfor %} +
+ {% endif %} + {% endfor %} + {% endif %} + {% endif %} +
+
+
Intervenciones
+ {% if caracteristica|has_key:"Intervenciones" %} + {% for desc in caracteristica|val_from_key:"Intervenciones" %} +
+ {{ desc|val_from_key:"Tipo de intervención" }} ({{desc|val_from_key:"Fecha"}}): {{ desc|val_from_key:"@value"|safe|cut:"

 

" }}
+
+ {% endfor %} + {% endif %} +
+ {% if caracteristica|has_key:"Descripción asignada" %} +
+
{{ caracteristica|val_from_key:"Descripción asignada"|val_from_key:"Tipo de descripción" }} :
+
+ {{ caracteristica|val_from_key:"Descripción asignada"|val_from_key:"Descripción"|safe|cut:"

 

" }}
+
+
+ {% endif %} + {% endwith %} + {% endif %} + +
+
+
Medios adjuntos
+ {% if resource_data|has_key:"Recursos" %} +
+ {% for medio in resource_data|val_from_key:'Recursos'|val_from_key:'Medio de información' %} + + {% endfor %} +
+ {% endif %} +
+
+
Observaciones
+ {% if resource_data|has_key:"Descripción asignada" %} + {% for desc in resource_data|val_from_key:"Descripción asignada" %} +
+ {{ desc|val_from_key:"Tipo de descripción" }} : {{ desc|val_from_key:"Descripción"|safe|cut:"

 

" }}
+
+ {% endfor %} + {% endif %} +
+
+
Responsables
+ {% if resource_data|has_key:"Responsables" %} +
+ Entidad administrativa : {{ resource_data|val_from_key:"Responsables"|val_from_key:"Entidad administrativa" }} +
+ {% if resource_data|val_from_key:"Responsables"|has_key:"Responsable" %} + {% for item in resource_data|val_from_key:"Responsables"|val_from_key:"Responsable" %} +
+ {{ item|val_from_key:"Rol" }} ({{ item|val_from_key:"Fecha" }}) : {{ item|val_from_key:"@value" }} +
+ {% endfor %} + {% endif %} + {% endif %} +
+ + {% if resource_data|has_key:"Recursos" and resource.print_imgs %} +

Anexo de imágenes

+ + {% endif %} + {% else %} +

El recurso no tiene información.

+ {% endif %} + + {% endwith %} +{% endfor %} + \ No newline at end of file diff --git a/reports/bm_pdf_report.html b/reports/bm_pdf_report.html new file mode 100644 index 0000000..46a27e0 --- /dev/null +++ b/reports/bm_pdf_report.html @@ -0,0 +1,365 @@ + +{% load template_tags %} +{% for resource in resources %} + {% with resource_data=resource.resource %} + + + + + + {{ resource.grafo }} ID de sistema: {{ resource.resourceinstanceid }} + + + + {% if resource_data %} +

{{ resource.displayname|truncatewords:10 }}

+
+
+
Identificación
+ {% if resource_data|has_key:"Identificación" %} +
+ Ámbito / subámbito: + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Ámbito / subámbito' }} +
+
+ Código principal: + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Código principal" }} +
+ {% if resource_data|val_from_key:"Identificación"|has_key:"Código institucional" %} + Código alternativo: + {% for cod in resource_data|val_from_key:"Identificación"|val_from_key:"Código institucional" %} +
+ {{ cod|val_from_key:"Tipo de código" }}: + {{ cod|val_from_key:"@value" }} +
+ {% endfor %} + {% endif %} +
+ Denominación : + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Denominación'|val_from_key:"@value" }} +
+
+ Tipo de Bien mueble : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Denominación'|val_from_key:"Tipo de nombre" }} +
+ {% if resource_data|val_from_key:"Identificación"|has_key:"Bienes muebles histórico-artístico" %} + Bienes muebles histórico-artístico : +
+ Época : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles histórico-artístico'|val_from_key:"Época"|val_from_key:"@value" }} +
+
+ Otra época : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles histórico-artístico'|val_from_key:"Época"|val_from_key:"Otra época" }} +
+
+ Estilo : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles histórico-artístico'|val_from_key:"Estilo"|val_from_key:"@value" }} +
+
+ Otros estilos : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles histórico-artístico'|val_from_key:"Estilo"|val_from_key:"Otros estilos" }} +
+
+ Escuela : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles histórico-artístico'|val_from_key:"Escuela"|val_from_key:"@value" }} +
+
+ Otra escuela : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles histórico-artístico'|val_from_key:"Escuela"|val_from_key:"Otra escuela" }} +
+
+ Autor / atribución : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles histórico-artístico'|val_from_key:"Autor / atribución" }} +
+
+ Origen o procedencia : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles histórico-artístico'|val_from_key:"Origen o procedencia" }} +
+ {% endif %} + {% if resource_data|val_from_key:"Identificación"|has_key:"Bienes muebles arqueológicos" %} + Bienes muebles arqueológicos: +
+ Periodo : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles arqueológicos'|val_from_key:"Periodo" }} +
+
+ Filiación cultural : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles arqueológicos'|val_from_key:"Filiación cultural" }} +
+
+ Material asociado : {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles arqueológicos'|val_from_key:"Material asociado" }} +
+ {% endif %} + {% endif %} +
+
+
+
Imagen de referencia
+ {% if resource_data|val_from_key:"Identificación"|has_key:"Imagen principal" %} + Medio no encontrado o formato no soportado + {% endif %} +
+
+
+ {% if resource_data|val_from_key:"Identificación"|has_key:"Bienes muebles arqueológicos" %} +
+ Cronología : +
+ {{ resource_data|val_from_key:"Identificación"|val_from_key:'Bienes muebles arqueológicos'|val_from_key:"Cronología"|safe|cut:"

 

" }}
+
+
+ {% endif %} +
+
+
Ubicación
+ {% if resource_data|has_key:"Localización" %} +
+ Localidad: + {{ resource_data|val_from_key:"Localización"|val_from_key:"Departamento / Localidad" }} +
+
+ Departamento: + {{ resource_data|val_from_key:"Localización"|val_from_key:"Ubicación extendida" }} +
+
+ Espacio: + {{ resource_data|val_from_key:"Localización"|val_from_key:"Espacio" }} +
+
+ Inmueble: + {{ resource_data|val_from_key:"Localización"|val_from_key:"Inmueble" }} +
+
+ Colección: + {{ resource_data|val_from_key:"Localización"|val_from_key:"Colección" }} +
+ {% if resource_data|val_from_key:"Localización"|has_key:"Ubicación" %} +
+ Ambiente : {{resource_data|val_from_key:"Localización"|val_from_key:"Ubicación"|val_from_key:"Ambiente" }} +
+
+ N° de ambiente : {{resource_data|val_from_key:"Localización"|val_from_key:"Ubicación"|val_from_key:"N° de ambiente" }} +
+
+ N° de bandeja : {{resource_data|val_from_key:"Localización"|val_from_key:"Ubicación"|val_from_key:"N° de bandeja" }} +
+
+ N° de caja : {{resource_data|val_from_key:"Localización"|val_from_key:"Ubicación"|val_from_key:"N° de caja" }} +
+
+ Ubicación actual : {{resource_data|val_from_key:"Localización"|val_from_key:"Ubicación"|val_from_key:"Ubicación actual" }} +
+ {% endif %} +
+ Coordenadas / Geometría: +
+ {% if resource_data|val_from_key:"Localización"|has_key:"Coordenadas / Geometría" %} + {% with gis_vector=resource_data|val_from_key:"Localización"|val_from_key:"Coordenadas / Geometría"|val_from_key:"@value"|json_to_obj %} + {% for gis in gis_vector.features %} +
+ {{ gis.geometry }} +
+ {% endfor %} + {% endwith %} +
+ Geometría principal : {{ resource_data|val_from_key:"Localización"|val_from_key:"Coordenadas / Geometría"|val_from_key:"Tipo de geometría" }} +
+ {% endif %} + {% endif %} +
+
+
+
Mapa de referencia
+
+
+
+
+
Marco legal
+ {% if resource_data|has_key:"Marco Legal" %} +
+
+
+ Reconocimiento Internacional : {{ resource_data|val_from_key:"Marco Legal"|val_from_key:" Reconocimiento Internacional" }} +
+
+ Patrimonio Cultural Departamental : {{ resource_data|val_from_key:"Marco Legal"|val_from_key:"Patrimonio Cultural Departamental" }} +
+
+ Patrimonio Cultural Nacional : {{ resource_data|val_from_key:"Marco Legal"|val_from_key:"Patrimonio Cultural Nacional" }} +
+
+ Patrimonio Cultural Municipal : {{ resource_data|val_from_key:"Marco Legal"|val_from_key:"Patrimonio Cultural Municipal" }} +
+
+
+
+ {% if resource_data|val_from_key:"Marco Legal"|has_key:"Forma de ingreso" %} + {% if resource_data|val_from_key:"Marco Legal"|val_from_key:"Forma de ingreso"|has_key:"Ingreso" %} +
+ Forma de ingreso : {{ resource_data|val_from_key:"Marco Legal"|val_from_key:"Forma de ingreso"|val_from_key:"Ingreso"|val_from_key:"@value" }} +
+ {% if resource_data|val_from_key:"Marco Legal"|val_from_key:"Forma de ingreso"|val_from_key:"Ingreso"|has_key:"Otros" %} +
+ Otra forma de ingreso : {{ resource_data|val_from_key:"Marco Legal"|val_from_key:"Forma de ingreso"|val_from_key:"Ingreso"|val_from_key:"Otros"|val_from_key:"@value" }} +
+
+ Tipo de documento : {{ resource_data|val_from_key:"Marco Legal"|val_from_key:"Forma de ingreso"|val_from_key:"Ingreso"|val_from_key:"Otros"|val_from_key:"Tipo de documento de entrega" }} +
+ {% endif %} + {% endif %} + {% endif %} +
+
+
+ {% endif %} +
+
+
Características
+ {% if resource_data|has_key:"Características" %} + {% for desc in resource_data|val_from_key:"Características" %} + {% if desc == "Principales transformaciones de la expresión Cultural" or desc == "Riesgos y amenazas" %} +
+ {{ desc }} : +
+
+ {{ resource_data|val_from_key:"Características"|val_from_key:desc|safe|cut:"

 

" }}
+
+ {% elif desc == "Medidas de la pieza" %} +
+ {{ desc }} (cm. y gr.) : +
+ {% if resource_data|val_from_key:"Características"|val_from_key:desc|has_key:"Medidas" %} + {% for item in resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Medidas" %} +
+ {{item.Medida}} : Medida mínima: {{ item|val_from_key:"Medida mínima" }} | Medida máxima : {{ item|val_from_key:"Medida máxima" }} +
+ {% endfor %} +
+ Observaciones : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Observaciones a las medidas"|safe|cut:"

 

" }}
+
+ {% endif %} + {% elif desc == "Estado de conservación" %} +
+ Estado de conservación : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"@value"|safe|cut:"

 

" }}
+
+
+ Observaciones : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Observaciones"|safe|cut:"

 

" }}
+
+ {% elif desc == "Uso Actual" or desc == "Nivel de integridad" %} +
+ {{ desc }} : {{ resource_data|val_from_key:"Características"|val_from_key:desc }} +
+ {% elif desc == "Intervenciones" %} +
+ {{ desc }} : +
+
+ Tiene intervenciones : {{resource_data|val_from_key:"Características"|val_from_key:"Intervenciones"|val_from_key:"Sin intervención"|yesno:"Si,No"}} +
+ {% if resource_data|val_from_key:"Características"|val_from_key:desc|has_key:"Intervenciónes" %} + {% for item in resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Intervenciónes" %} +
+ Intervención : {{ item }} +
+ {% endfor %} + {% endif %} + {% elif desc == "Características Iconográficas/ornamentales" %} +
+ {{ desc }} : +
+ {% for item in resource_data|val_from_key:"Características"|val_from_key:desc %} +
+ {{ item|safe|cut:"

 

" }}
+
+ {% endfor %} + {% endif %} + {% endfor %} +
+ Condiciones de seguridad : {{ resource_data|val_from_key:"Características"|val_from_key:"Condiciones de seguridad" }} +
+ {% endif %} +
+
+
Medios adjuntos
+ {% if resource_data|has_key:"Recursos adjuntos" %} +
+ {% for medio in resource_data|val_from_key:'Recursos adjuntos'|val_from_key:'Medio de información' %} + + {% endfor %} +
+ {% endif %} +
+
+
Observaciones
+ {% if resource_data|has_key:"Observaciones" %} +
+ {{ resource_data|val_from_key:"Observaciones"|val_from_key:"Tipo de descripción" }} : {{ resource_data|val_from_key:"Observaciones"|val_from_key:"Descripción"|safe|cut:"

 

" }}
+
+ {% endif %} +
+
+
Responsables
+ {% if resource_data|has_key:"Responsables" %} +
+ Entidad administrativa : {{ resource_data|val_from_key:"Responsables"|val_from_key:"Entidad administrativa" }} +
+ {% if resource_data|val_from_key:"Responsables"|has_key:"Responsable" %} + {% for item in resource_data|val_from_key:"Responsables"|val_from_key:"Responsable" %} +
+ {{ item|val_from_key:"Rol" }} ({{ item|val_from_key:"Fecha" }}) : {{ item|val_from_key:"@value" }} +
+ {% endfor %} + {% endif %} + {% endif %} +
+ {% if resource_data|has_key:"Recursos adjuntos" and resource.print_imgs %} +

Anexo de imágenes

+ + {% endif %} + {% else %} +

El recurso no tiene información.

+ {% endif %} + + {% endwith %} +{% endfor %} + \ No newline at end of file diff --git a/reports/pi_pdf_report.html b/reports/pi_pdf_report.html new file mode 100644 index 0000000..219102e --- /dev/null +++ b/reports/pi_pdf_report.html @@ -0,0 +1,312 @@ + +{% load template_tags %} +{% for resource in resources %} + {% with resource_data=resource.resource %} + + + + + + {{ resource.grafo }} ID de sistema: {{ resource.resourceinstanceid }} + + + + {% if resource_data %} +

{{ resource.displayname|truncatewords:10 }}

+
+
+
Identificación
+ {% if resource_data|has_key:"Identificación" %} +
+ Código principal: + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Código principal" }} +
+
+ Código anterior: + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Código anterior" }} +
+
+ Código alternativo: + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Código alternativo" }} +
+
+ Filiación cultural: + {{ resource_data|val_from_key:"Identificación"|val_from_key:"Filiación cultural" }} +
+
+ Ámbito / subámbito: + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Ámbito / subámbito' }} +
+
+ Nominación actual: + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Nominación actual' }} +
+
+ Origen o procedencia: + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Origen o procedencia' }} +
+
+ Nominación anterior: + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Nominación anterior' }} +
+
+ Manifestación cultural: + {{ resource_data|val_from_key:"Identificación"|val_from_key:'Manifestación cultural' }} +
+ {% endif %} +
+
+
+
Imagen de referencia
+ {% if resource_data|has_key:"Información gráfica" %} + {% with medios=resource_data|val_from_key:'Información gráfica'|val_from_key:'Medio de información' %} + {{medios.0.file}} + {% endwith %} + {% endif %} +
+
+
+
+
+
Ubicación
+ {% if resource_data|has_key:"Ubicación 2" %} +
+ Localidad: + {{ resource_data|val_from_key:"Ubicación 2"|val_from_key:"Departamento" }} +
+
+ Departamento: + {{ resource_data|val_from_key:"Ubicación 2"|val_from_key:"Ubicación extendida" }} +
+
+ Otra localidad: + {{ resource_data|val_from_key:"Ubicación 2"|val_from_key:"Otra localidad" }} +
+
+ Coordenadas / Geometría: +
+ {% if resource_data|val_from_key:"Ubicación 2"|has_key:"Coordenadas / Geometría" %} + {% with gis_vector=resource_data|val_from_key:"Ubicación 2"|val_from_key:"Coordenadas / Geometría"|val_from_key:"@value"|json_to_obj %} + {% for gis in gis_vector.features %} +
+ {{ gis.geometry }} +
+ {% endfor %} + {% endwith %} +
+ Geometría principal: + {{ resource_data|val_from_key:"Ubicación 2"|val_from_key:"Coordenadas / Geometría"|val_from_key:"Tipo de geometría" }} +
+ {% endif %} + {% endif %} +
+
+
+
Mapa de referencia
+
+
+
+
+
Marco legal
+ {% if resource_data|has_key:"Marco legal" %} +
+ Reconocimiento Internacional: + {{ resource_data|val_from_key:"Marco legal"|val_from_key:" Reconocimiento Internacional" }} +
+
+ Patrimonio Cultural Departamental: + {{ resource_data|val_from_key:"Marco legal"|val_from_key:"Patrimonio Cultural Departamental" }} +
+
+ Patrimonio Cultural Nacional: + {{ resource_data|val_from_key:"Marco legal"|val_from_key:"Patrimonio Cultural Nacional" }} +
+
+ Patrimonio Cultural Municipal: + {{ resource_data|val_from_key:"Marco legal"|val_from_key:"Patrimonio Cultural Municipal" }} +
+ {% endif %} +
+
+
Características
+ {% if resource_data|has_key:"Características" %} + {% for desc in resource_data|val_from_key:"Características" %} + {% if desc == "Principales transformaciones de la expresión Cultural" or desc == "Riesgos y amenazas" %} +
+ {{ desc }} : +
+
+ {{ resource_data|val_from_key:"Características"|val_from_key:desc|safe|cut:"

 

" }}
+
+ {% elif resource_data|val_from_key:"Características"|val_from_key:desc|has_key:"Descripción resumida" and resource_data|val_from_key:"Características"|val_from_key:desc|has_key:"@value" %} +
+ {{ desc }} : +
+
+ {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"@value" }} +
+
+ Descripción resumida : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Descripción resumida"|safe|cut:"

 

" }}
+
+ {% elif desc == "Descripción del ámbito" %} +
+ {{ desc }} : +
+
+ {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"@value" }} +
+
+ {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Descripción" }} +
+ {% elif desc == "Mecanismo de transmisión" %} +
+ {{ desc }} : +
+
+ Mecanismo : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Mecanismo" }} +
+
+ Otro mecanismo : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Otro mecanismo" }} +
+
+ Descripción resumida : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Descripción resumida"|safe|cut:"

 

" }}
+
+ {% elif desc == "Expresiones musicales" %} +
+ {{ desc }} : +
+
+ Historias de vida (música, canto y danza) : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Historias de vida (música, canto y danza)" }} +
+
+ Género musical : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Género musical" }} +
+
+ Forma musical (subgénero) : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Forma musical (subgénero)" }} +
+
+ Canto : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Canto" }} +
+
+ Danza : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Danza" }} +
+
+ Descripción resumida : {{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Descripción resumida"|safe|cut:"

 

" }}
+
+ {% elif desc == "Elementos significativos" %} +
+ {{ desc }} : +
+ {% for item in resource_data|val_from_key:"Características"|val_from_key:"Elementos significativos" %} +
+ Nombre : {{ item|val_from_key:"Nombre" }} +
+
+ Tipo : {{ item|val_from_key:"Tipo" }} +
+
+ Detalle del elemento : {{ item|val_from_key:"Detalle del elemento" }} +
+ {% endfor %} + {% endif %} + {% endfor %} + {% endif %} +
+
+
Medios adjuntos
+ {% if resource_data|has_key:"Información gráfica" %} +
+ {% for medio in resource_data|val_from_key:'Información gráfica'|val_from_key:'Medio de información' %} + + {% endfor %} +
+ {% endif %} +
+
+
Descripción general
+ {% if resource_data|has_key:"Descripción asignada" %} +
+ {{ resource_data|val_from_key:"Descripción asignada"|val_from_key:"Tipo de descripción" }} : +
+
+ {{ resource_data|val_from_key:"Descripción asignada"|val_from_key:"Descripción"|safe|cut:"

 

" }}
+
+ + {% endif %} +
+
+
Responsables
+ {% if resource_data|has_key:"Responsables" %} +
+ Entidad administrativa : {{ resource_data|val_from_key:"Responsables"|val_from_key:"Entidad administrativa" }} +
+ {% if resource_data|val_from_key:"Responsables"|has_key:"Responsable" %} + {% for item in resource_data|val_from_key:"Responsables"|val_from_key:"Responsable" %} +
+ {{ item|val_from_key:"Rol" }} ({{ item|val_from_key:"Fecha" }}) : {{ item|val_from_key:"@value" }} +
+ {% endfor %} + {% endif %} + {% endif %} +
+ {% if resource_data|has_key:"Información gráfica" and resource.print_imgs %} +

Anexo de imágenes

+ + {% endif %} + {% else %} +

El recurso no tiene información.

+ {% endif %} + + {% endwith %} +{% endfor %} + \ No newline at end of file