313 lines
23 KiB
HTML
313 lines
23 KiB
HTML
<!-- mi_proyecto/templates/reports/pi_pdf_report.html -->
|
|
{% load template_tags %}
|
|
{% for resource in resources %}
|
|
{% with resource_data=resource.resource %}
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<style>
|
|
:root {--oscuro: #242424; --carbon: #4c4c4c; --ceniza: #999; --claro: #fafafa; --resaltado: #d1a21c;}
|
|
html { color: var(carbon); font-family: 'Helvetica', sans-serif; font-size: 9pt; font-weight: 300; line-height: 1.2;}
|
|
body { margin: 0;}
|
|
h1 { color: var(--resaltado); font-size: 13pt; text-align: center; width: 100%;}
|
|
h2, h3, h4 { color: black; font-weight: 400;}
|
|
h2 { break-before: always; font-size: 12pt;}
|
|
h3 { font-size: 12pt;}
|
|
h4 { font-size: 11pt;}
|
|
a { font-size:.85em;}
|
|
.flex-container { display: flex; flex-wrap: wrap; gap: 0 4px; margin-top: 5px;}
|
|
.flex-item {flex: 0 0 calc(50% - 5px); box-sizing: border-box;}
|
|
.tiles-grid-grp { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 2px;}
|
|
.tiles-grid-grp-col { grid-column: 2; contain: size;}
|
|
.tile-block { border: 1px solid var(--ceniza); border-radius: 4px; padding: 2px; margin: 2px 0; background-color: var(--claro);}
|
|
.tile-title { font-size: 11pt; font-weight: bold; color: var(--oscuro); border-bottom: 1px solid var(--ceniza); padding-bottom: 2px; margin-bottom: 5px;}
|
|
.data-row { display: flex; padding: 2px 0; border-bottom: 1px solid var(--claro);}
|
|
.data-label { font-weight: 600; letter-spacing: -0.05em; width: 40%; color: var(--oscuro);}
|
|
.data-value { width: 60%; font-size:.9em; word-wrap: break-word;}
|
|
.no-data { color: var(--ceniza); font-style: italic;}
|
|
.tiles-grid-grp-col .tile-block img { object-fit: cover; width: 330px; max-height: 230px;}
|
|
|
|
.gallery { display: grid; grid-template-columns: repeat(2, 340px); grid-auto-rows: 272px; gap: 5px; justify-content: center; }
|
|
.gallery-item { overflow: hidden; border-radius: 5px; background-color: var(--ceniza); position: relative;}
|
|
.gallery-item img { width: 100%; height: 100%; object-fit: cover;}
|
|
.gallery-item a {position: absolute; bottom: 6px; left: 6px; color: var(--carbon); text-decoration: none; background-color: rgb(255 255 255 / 50%); font-size: .75em;}
|
|
|
|
@page {
|
|
@top-left { background: var(--resaltado); content: counter(page); height: 1cm; text-align: center; width: 1cm;}
|
|
@top-center { background: var(--resaltado); content: ''; display: block; height: .05cm; opacity: .5; width: 100%;}
|
|
@top-right { content: '{{ resource.grafo }} \A UUID: {{ resource.resourceinstanceid }}'; white-space: pre-line; color: var(--ceniza); font-size: 8pt; height: 1cm; vertical-align: middle; width: 100%;}
|
|
@bottom-center { background: var(--resaltado); content: ''; display: block; height: .05cm; opacity: .5; width: 100%;}
|
|
@bottom-left { content: 'Sistema Plurinacional de Registro de Patrimonio Cultural Boliviano\ASPRPCB - {{ resource.eta_group }}'; white-space: pre-line; color: var(--ceniza); font-size: 8pt; height: 1cm; vertical-align: middle; width: 100%;}
|
|
@bottom-right { content: '{{ resource.fecha }} \A BOLIVIA'; white-space: pre-line; color: var(--ceniza); font-size: 8pt; height: 1cm; vertical-align: middle; width: 100%;}
|
|
size: Letter;
|
|
margin-top: 1.5cm; margin-bottom: 1.8cm; margin-left: 2cm; margin-right: 1.5cm;
|
|
}
|
|
</style>
|
|
<title>{{ resource.grafo }} ID de sistema: {{ resource.resourceinstanceid }}</title>
|
|
<meta name="description" content="Ficha PDF">
|
|
</head>
|
|
<body>
|
|
{% if resource_data %}
|
|
<h1>{{ resource.displayname|truncatewords:10 }}</h1>
|
|
<div class="tiles-grid-grp">
|
|
<div class="tile-block column" >
|
|
<div class="tile-title">Identificación</div>
|
|
{% if resource_data|has_key:"Identificación" %}
|
|
<div class="data-row">
|
|
<span class="data-label">Código principal: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Identificación"|val_from_key:"Código principal" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Código anterior: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Identificación"|val_from_key:"Código anterior" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Código alternativo: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Identificación"|val_from_key:"Código alternativo" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Filiación cultural: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Identificación"|val_from_key:"Filiación cultural" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Ámbito / subámbito: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Identificación"|val_from_key:'Ámbito / subámbito' }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Nominación actual: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Identificación"|val_from_key:'Nominación actual' }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Origen o procedencia: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Identificación"|val_from_key:'Origen o procedencia' }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Nominación anterior: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Identificación"|val_from_key:'Nominación anterior' }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Manifestación cultural: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Identificación"|val_from_key:'Manifestación cultural' }}</span>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="tiles-grid-grp-col">
|
|
<div class="tile-block">
|
|
<div class="tile-title">Imagen de referencia</div>
|
|
{% 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' %}
|
|
<img class="imagen-calzada" src="{{resource.sprpcb_url}}{{ medios.0.url }}" alt="{{medios.0.file}}">
|
|
{% endwith %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tiles-grid-grp">
|
|
<div class="tile-block">
|
|
<div class="tile-title">Ubicación</div>
|
|
{% if resource_data|has_key:"Ubicación 2" %}
|
|
<div class="data-row">
|
|
<span class="data-label">Localidad: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Ubicación 2"|val_from_key:"Departamento" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Departamento: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Ubicación 2"|val_from_key:"Ubicación extendida" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Otra localidad: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Ubicación 2"|val_from_key:"Otra localidad" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label" style="width: 100%;">Coordenadas / Geometría: </span>
|
|
</div>
|
|
{% 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 %}
|
|
<div class="data-row">
|
|
<span class="data-value" style="width: 100%; font-size: .72em;">{{ gis.geometry|truncatewords:24 }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
{% endwith %}
|
|
<div class="data-row">
|
|
<span class="data-label">Geometría principal: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Ubicación 2"|val_from_key:"Coordenadas / Geometría"|val_from_key:"Tipo de geometría" }}</span>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
<div class="tiles-grid-grp-col">
|
|
<div class="tile-block">
|
|
<div class="tile-title">Mapa de referencia</div>
|
|
<img src="data:image/png;base64,{{ resource.map_img }}">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tile-block">
|
|
<div class="tile-title">Marco legal</div>
|
|
{% if resource_data|has_key:"Marco legal" %}
|
|
<div class="data-row">
|
|
<span class="data-label">Reconocimiento Internacional: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Marco legal"|val_from_key:" Reconocimiento Internacional" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Patrimonio Cultural Departamental: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Marco legal"|val_from_key:"Patrimonio Cultural Departamental" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Patrimonio Cultural Nacional: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Marco legal"|val_from_key:"Patrimonio Cultural Nacional" }}</span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-label">Patrimonio Cultural Municipal: </span>
|
|
<span class="data-value">{{ resource_data|val_from_key:"Marco legal"|val_from_key:"Patrimonio Cultural Municipal" }}</span>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="tile-block">
|
|
<div class="tile-title">Características</div>
|
|
{% 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" %}
|
|
<div class="data-row">
|
|
<span class="data-label" style="width: 100%;">{{ desc }} : </span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;">{{ resource_data|val_from_key:"Características"|val_from_key:desc|safe|cut:"<p> </p>" }}</span>
|
|
</div>
|
|
{% 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" %}
|
|
<div class="data-row">
|
|
<span class="data-label" style="width: 100%;">{{ desc }} : </span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;">{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"@value" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Descripción resumida : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Descripción resumida"|safe|cut:"<p> </p>" }}</span>
|
|
</div>
|
|
{% elif desc == "Descripción del ámbito" %}
|
|
<div class="data-row">
|
|
<span class="data-label" style="width: 100%;">{{ desc }} : </span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;">{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"@value" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;">{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Descripción" }}</span>
|
|
</div>
|
|
{% elif desc == "Mecanismo de transmisión" %}
|
|
<div class="data-row">
|
|
<span class="data-label" style="width: 100%;">{{ desc }} : </span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Mecanismo : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Mecanismo" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Otro mecanismo : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Otro mecanismo" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Descripción resumida : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Descripción resumida"|safe|cut:"<p> </p>" }}</span>
|
|
</div>
|
|
{% elif desc == "Expresiones musicales" %}
|
|
<div class="data-row">
|
|
<span class="data-label" style="width: 100%;">{{ desc }} : </span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Historias de vida (música, canto y danza) : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Historias de vida (música, canto y danza)" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Género musical : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Género musical" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Forma musical (subgénero) : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Forma musical (subgénero)" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Canto : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Canto" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Danza : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Danza" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Descripción resumida : </b>{{ resource_data|val_from_key:"Características"|val_from_key:desc|val_from_key:"Descripción resumida"|safe|cut:"<p> </p>" }}</span>
|
|
</div>
|
|
{% elif desc == "Elementos significativos" %}
|
|
<div class="data-row">
|
|
<span class="data-label" style="width: 100%;">{{ desc }} : </span>
|
|
</div>
|
|
{% for item in resource_data|val_from_key:"Características"|val_from_key:"Elementos significativos" %}
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Nombre : </b>{{ item|val_from_key:"Nombre" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Tipo : </b>{{ item|val_from_key:"Tipo" }}</span>
|
|
</div>
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Detalle del elemento : </b>{{ item|val_from_key:"Detalle del elemento" }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
<div class="tile-block">
|
|
<div class="tile-title">Medios adjuntos</div>
|
|
{% if resource_data|has_key:"Información gráfica" %}
|
|
<div class="flex-container">
|
|
{% for medio in resource_data|val_from_key:'Información gráfica'|val_from_key:'Medio de información' %}
|
|
<div class="flex-item">
|
|
<div class="data-row" style="margin-left: 15px;">
|
|
<a href={{resource.sprpcb_url}}{{ medio.url }} >{{ medio.tipo }} : {{ medio|val_from_key:'@value' }} ({{ medio.formato|slice:"-4:" }})</a>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="tile-block">
|
|
<div class="tile-title">Descripción general</div>
|
|
{% if resource_data|has_key:"Descripción asignada" %}
|
|
<div class="data-row">
|
|
<span class="data-label" style="width: 100%;">{{ resource_data|val_from_key:"Descripción asignada"|val_from_key:"Tipo de descripción" }} : </span>
|
|
</div>
|
|
<div class="data-row">
|
|
<span class="data-value" style="width: 100%;">{{ resource_data|val_from_key:"Descripción asignada"|val_from_key:"Descripción"|safe|cut:"<p> </p>" }}</span>
|
|
</div>
|
|
|
|
{% endif %}
|
|
</div>
|
|
<div class="tile-block">
|
|
<div class="tile-title">Responsables</div>
|
|
{% if resource_data|has_key:"Responsables" %}
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>Entidad administrativa : </b>{{ resource_data|val_from_key:"Responsables"|val_from_key:"Entidad administrativa" }} </span>
|
|
</div>
|
|
{% if resource_data|val_from_key:"Responsables"|has_key:"Responsable" %}
|
|
{% for item in resource_data|val_from_key:"Responsables"|val_from_key:"Responsable" %}
|
|
<div class="data-row" style="margin-left: 20px;">
|
|
<span class="data-value" style="width: 100%;"><b>{{ item|val_from_key:"Rol" }} ({{ item|val_from_key:"Fecha" }}) : </b>{{ item|val_from_key:"@value" }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
{% if resource_data|has_key:"Información gráfica" and resource.print_imgs %}
|
|
<h2>Anexo de imágenes</h2>
|
|
<div class="gallery">
|
|
{% for medio in resource_data|val_from_key:'Información gráfica'|val_from_key:'Medio de información' %}
|
|
{% if medio.formato in "image/bmp, image/gif, image/jpg, image/jpeg, image/png, image/tif, image/tiff" %}
|
|
<div class="gallery-item">
|
|
<img src="{{resource.sprpcb_url}}{{ medio.url }}" alt="{{medio.file}}">
|
|
<a href="{{resource.sprpcb_url}}{{ medio.url }}"> {{ medio.tipo }} : {{ medio|val_from_key:'@value' }} </a>
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% else %}
|
|
<p class="no-data">El recurso no tiene información.</p>
|
|
{% endif %}
|
|
</body>
|
|
{% endwith %}
|
|
{% endfor %}
|
|
</html> |