From cd50c0849269635f2a20b2bf67750344cee4d5f5 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 9 Jan 2014 19:20:45 +0100 Subject: Add window for administrativ acts (refs #1587) --- .../templates/ishtar/sheet_administrativeact.html | 29 ++++++++++++++++++++++ .../ishtar/sheet_administrativeact_pdf.html | 18 ++++++++++++++ .../ishtar/sheet_administrativeact_window.html | 3 +++ archaeological_operations/urls.py | 2 ++ archaeological_operations/views.py | 1 + ishtar_common/views.py | 2 ++ 6 files changed, 55 insertions(+) create mode 100644 archaeological_operations/templates/ishtar/sheet_administrativeact.html create mode 100644 archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html create mode 100644 archaeological_operations/templates/ishtar/sheet_administrativeact_window.html diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact.html b/archaeological_operations/templates/ishtar/sheet_administrativeact.html new file mode 100644 index 000000000..5e80b3f75 --- /dev/null +++ b/archaeological_operations/templates/ishtar/sheet_administrativeact.html @@ -0,0 +1,29 @@ +{% extends "ishtar/sheet.html" %} +{% load i18n %} + +{% block head_sheet %} +{{block.super}} +

{% trans "Administrative act"%}

+{% endblock %} + +{% block content %} +
{%trans "Export as:"%} {%trans "OpenOffice.org file"%}, {%trans "PDF file"%}
+

{% trans "General"%}

+

+

{{ item.year }}{% if item.numeric_reference %} {{ item.numeric_reference }}

{% endif %} +

+

{{ item.act_type }}

+

{{ item.signature_date }}

+

{{ item.in_charge.full_label }}

+{% if item.operator %}

{{ item.operator }}

{% endif %} + +{% comment %}

{{ item.creation_date }}

{% endcomment %} +{% if item.associated_file %}

{{ item.associated_file }}

{% endif %} +{% if item.operation %}

{{ item.operation }}

{% endif %} + +{% if item.operation %}{% if item.operation.surface %}

{{ item.operation.surface }} m2 ({{ item.operation.surface_ha }} ha)

{%endif%} {% endif %} +{%comment%}{% if item.general_contractor.attached_to %}

{{ item.general_contractor.attached_to }}

{% endif %} +{% if item.general_contractor %}

{{ item.general_contractor.full_label }}

{% endif %} +{%endcomment%} + +{% endblock %} diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html b/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html new file mode 100644 index 000000000..e3c78d733 --- /dev/null +++ b/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html @@ -0,0 +1,18 @@ +{% extends "ishtar/sheet_administrativeact.html" %} +{% block header %} + +{% endblock %} +{% block main_head %} +{{ block.super }} +
+Ishtar – {{APP_NAME}} – {{item}} +
+{% endblock %} +{%block head_sheet%}{%endblock%} +{%block main_foot%} +
+– – +
+ + +{%endblock%} diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact_window.html b/archaeological_operations/templates/ishtar/sheet_administrativeact_window.html new file mode 100644 index 000000000..4ed562ea5 --- /dev/null +++ b/archaeological_operations/templates/ishtar/sheet_administrativeact_window.html @@ -0,0 +1,3 @@ +{% extends "ishtar/sheet_administrativeact.html" %} +{% block main_head %}{%endblock%} +{% block main_foot %}{%endblock%} diff --git a/archaeological_operations/urls.py b/archaeological_operations/urls.py index bd207dd80..26dc5b3d0 100644 --- a/archaeological_operations/urls.py +++ b/archaeological_operations/urls.py @@ -81,6 +81,8 @@ urlpatterns += patterns('archaeological_operations.views', url(r'get-administrativeact-full/(?P.+)?$', 'get_administrativeact', name='get-administrativeact-full', kwargs={'full':True}), + url(r'show-administrativeact(?:/(?P.+))?/(?P.+)?$', + 'show_administrativeact', name='show-administrativeact'), url(r'generatedoc-administrativeactop/(?P.+)?/(?P.+)?$', 'generatedoc_administrativeactop', name='generatedoc-administrativeactop'), diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 714fd62e4..7e5a64ab4 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -154,6 +154,7 @@ get_administrativeactop = get_item(models.AdministrativeAct, get_administrativeact = get_item(models.AdministrativeAct, 'get_administrativeact', 'administrativeact', extra_request_keys={}) +show_administrativeact = show_item(models.AdministrativeAct, 'administrativeact') def dashboard_operation(request, *args, **kwargs): """ diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 3e0bffd32..7963dc46a 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -385,6 +385,8 @@ def get_item(model, func_name, default_name, extra_request_keys=[], lnk = link_template % reverse('show-'+default_name, args=[data[0], '']) except NoReverseMatch: + print '"show-' + default_name + "\" args (" + \ + unicode(data[0]) + ") url not available" lnk = '' res = {'id':data[0], 'link':lnk} for idx, value in enumerate(data[1:]): -- cgit v1.2.3