From af882e54f8a13c730e3b4bca1affeed6c45d7134 Mon Sep 17 00:00:00 2001 From: aniversarioperu Date: Sat, 6 Dec 2014 11:53:30 +0200 Subject: [PATCH] showing PDF, Expediente buttons. #3 --- HISTORY.rst | 1 + .../templates/seguimientos/index.html | 50 +++++++++++++++++++ proyectos_de_ley/seguimientos/utils.py | 1 + 3 files changed, 52 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 23749af..67aa835 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,7 @@ History * v1.4.X (2014-XX-XX) Only accept as search keywords strings with len > 2. Sort simple search result by codigo desc. Fix bug on pagination links. Keywords were shown with brackets. Search box of simple search show user's query. + Added links to PDF and Expediente in Seguimientos page. * v1.4.1 (2014-11-11) Improved general search engine, also events in `seguimientos` are queried. Autofocus on search box when page loads. Better highlighting of keywords. Check errors in datefield widget (advanced search). diff --git a/proyectos_de_ley/seguimientos/templates/seguimientos/index.html b/proyectos_de_ley/seguimientos/templates/seguimientos/index.html index 74d5248..ba8bd68 100644 --- a/proyectos_de_ley/seguimientos/templates/seguimientos/index.html +++ b/proyectos_de_ley/seguimientos/templates/seguimientos/index.html @@ -35,8 +35,32 @@

Proyecto de Ley {{ item.codigo }}

+ + +
@@ -114,6 +138,32 @@

Proyecto de Ley {{ item.codigo }}

{% endif %} +
+
+
+
Enlaces externos
+
+ {% if item.pdf_url != ''%} + PDF + {% else %} + Sin PDF + {% endif %} + + {% if item.expediente != ''%} + EXPEDIENTE + {% else %} + Sin EXPEDIENTE + {% endif %} +
+
+
+
+ +
diff --git a/proyectos_de_ley/seguimientos/utils.py b/proyectos_de_ley/seguimientos/utils.py index bf1e01b..f7fcdb1 100644 --- a/proyectos_de_ley/seguimientos/utils.py +++ b/proyectos_de_ley/seguimientos/utils.py @@ -20,6 +20,7 @@ def get_proyecto_from_short_url(short_url): item.congresistas_with_links = hiperlink_congre(item.congresistas) item.fecha_presentacion = convert_string_to_time(item.fecha_presentacion) item.numero_congresistas = len(item.congresistas.split(",")) + print(item.pdf_url) return item