summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-12-29 19:17:06 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-12-29 19:17:06 +0100
commit64da07dfc6489858c151766ac07f22aba4ceb59f (patch)
tree4ded02e0b70766bc41cf11a377c2ffb7aeb328c6
parenta6e9f83052759cf4620dc30cb860293ea6534d14 (diff)
downloadIshtar-64da07dfc6489858c151766ac07f22aba4ceb59f.tar.bz2
Ishtar-64da07dfc6489858c151766ac07f22aba4ceb59f.zip
Add sheets for context record source and find source
-rw-r--r--archaeological_context_records/models.py3
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html11
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html18
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecordsource_window.html3
-rw-r--r--archaeological_context_records/urls.py5
-rw-r--r--archaeological_context_records/views.py4
-rw-r--r--archaeological_finds/models.py3
-rw-r--r--archaeological_finds/templates/ishtar/sheet_findsource.html11
-rw-r--r--archaeological_finds/templates/ishtar/sheet_findsource_pdf.html18
-rw-r--r--archaeological_finds/templates/ishtar/sheet_findsource_window.html3
-rw-r--r--archaeological_finds/urls.py6
-rw-r--r--archaeological_finds/views.py2
-rw-r--r--archaeological_operations/templates/ishtar/sheet_operationsource.html4
-rw-r--r--ishtar_common/templates/ishtar/sheet.html4
-rw-r--r--ishtar_common/templates/ishtar/sheet_source.html4
15 files changed, 89 insertions, 10 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 6fc950f52..52d976cfd 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -106,6 +106,7 @@ class IdentificationType(GeneralType):
class ContextRecord(BaseHistorizedItem, OwnPerms, ShortMenuItem):
+ SHOW_URL = 'show-contextrecord'
TABLE_COLS = ['parcel.town', 'operation.year',
'operation.operation_code',
'label', 'unit']
@@ -311,6 +312,8 @@ post_delete.connect(post_delete_record_relation, sender=RecordRelations)
class ContextRecordSource(Source):
+ SHOW_URL = 'show-contextrecordsource'
+
class Meta:
verbose_name = _(u"Context record documentation")
verbose_name_plural = _(u"Context record documentations")
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html
new file mode 100644
index 000000000..17d09d843
--- /dev/null
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html
@@ -0,0 +1,11 @@
+{% extends "ishtar/sheet_source.html" %}
+{% load i18n window_field link_to_window %}
+
+{% block head_sheet %}
+{{block.super}}
+<h1>{% trans "Context record source"%}</h1>
+{% endblock %}
+
+{% block related %}
+{% field "Related context record" item.owner '' item.owner|link_to_window %}
+{% endblock %}
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html
new file mode 100644
index 000000000..8e6b9bb85
--- /dev/null
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html
@@ -0,0 +1,18 @@
+{% extends "ishtar/sheet_contextrecordsource.html" %}
+{% block header %}
+<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" />
+{% endblock %}
+{% block main_head %}
+{{ block.super }}
+<div id="pdfheader">
+Ishtar &ndash; {{APP_NAME}} &ndash; {{item}}
+</div>
+{% endblock %}
+{%block head_sheet%}{%endblock%}
+{%block main_foot%}
+<div id="pdffooter">
+&ndash; <pdf:pagenumber/> &ndash;
+</div>
+</body>
+</html>
+{%endblock%}
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_window.html b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_window.html
new file mode 100644
index 000000000..21dd20758
--- /dev/null
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_window.html
@@ -0,0 +1,3 @@
+{% extends "ishtar/sheet_contextrecordsource.html" %}
+{% block main_head %}{%endblock%}
+{% block main_foot %}{%endblock%}
diff --git a/archaeological_context_records/urls.py b/archaeological_context_records/urls.py
index 6ffc2f194..da6d80a98 100644
--- a/archaeological_context_records/urls.py
+++ b/archaeological_context_records/urls.py
@@ -19,6 +19,7 @@
from django.conf.urls.defaults import *
+from archaeological_context_records import models
from ishtar_common.wizards import check_rights
import views
@@ -59,7 +60,7 @@ urlpatterns = patterns(
urlpatterns += patterns(
'archaeological_context_records.views',
url(r'show-contextrecord(?:/(?P<pk>.+))?/(?P<type>.+)?$',
- 'show_contextrecord', name='show-contextrecord'),
+ 'show_contextrecord', name=models.ContextRecord.SHOW_URL),
url(r'show-historized-contextrecord/(?P<pk>.+)?/(?P<date>.+)?$',
'show_contextrecord', name='show-historized-contextrecord'),
url(r'revert-contextrecord/(?P<pk>.+)/(?P<date>.+)$',
@@ -80,6 +81,8 @@ urlpatterns += patterns(
url(r'get-contextrecord-full/(?P<type>.+)?$',
'get_contextrecord', name='get-contextrecord-full',
kwargs={'full': True}),
+ url(r'show-contextrecordsource(?:/(?P<pk>.+))?/(?P<type>.+)?$',
+ 'show_contextrecordsource', name=models.ContextRecordSource.SHOW_URL),
url(r'get-contexrecordsource/(?P<type>.+)?$',
'get_contextrecordsource', name='get-contextrecordsource'),
)
diff --git a/archaeological_context_records/views.py b/archaeological_context_records/views.py
index 41d290a3f..ccd0eaf01 100644
--- a/archaeological_context_records/views.py
+++ b/archaeological_context_records/views.py
@@ -51,6 +51,10 @@ get_contextrecord_for_ope = get_item(
'get_contextrecord', 'contextrecord',
extra_request_keys=contextrecord_extra_keys,
own_table_cols=models.ContextRecord.TABLE_COLS_FOR_OPE)
+
+show_contextrecordsource = show_item(models.ContextRecordSource,
+ 'contextrecordsource')
+
get_contextrecordsource = get_item(
models.ContextRecordSource,
'get_contextrecordsource', 'contextrecordsource',
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index 32b4334ff..f677b1297 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -246,6 +246,7 @@ CHECK_CHOICES = (('NC', _(u"Not checked")),
class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
CHECK_DICT = dict(CHECK_CHOICES)
+ SHOW_URL = 'show-find'
TABLE_COLS = ['label', 'material_types', 'datings.period',
'base_finds.context_record.parcel.town',
'base_finds.context_record.operation.year',
@@ -533,6 +534,8 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
class FindSource(Source):
+ SHOW_URL = 'show-findsource'
+
class Meta:
verbose_name = _(u"Find documentation")
verbose_name_plural = _(u"Find documentations")
diff --git a/archaeological_finds/templates/ishtar/sheet_findsource.html b/archaeological_finds/templates/ishtar/sheet_findsource.html
new file mode 100644
index 000000000..04db0336c
--- /dev/null
+++ b/archaeological_finds/templates/ishtar/sheet_findsource.html
@@ -0,0 +1,11 @@
+{% extends "ishtar/sheet_source.html" %}
+{% load i18n window_field link_to_window %}
+
+{% block head_sheet %}
+{{block.super}}
+<h1>{% trans "Find source"%}</h1>
+{% endblock %}
+
+{% block related %}
+{% field "Related find" item.owner '' item.owner|link_to_window %}
+{% endblock %}
diff --git a/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html b/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html
new file mode 100644
index 000000000..b7f8ec473
--- /dev/null
+++ b/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html
@@ -0,0 +1,18 @@
+{% extends "ishtar/sheet_findsource.html" %}
+{% block header %}
+<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" />
+{% endblock %}
+{% block main_head %}
+{{ block.super }}
+<div id="pdfheader">
+Ishtar &ndash; {{APP_NAME}} &ndash; {{item}}
+</div>
+{% endblock %}
+{%block head_sheet%}{%endblock%}
+{%block main_foot%}
+<div id="pdffooter">
+&ndash; <pdf:pagenumber/> &ndash;
+</div>
+</body>
+</html>
+{%endblock%}
diff --git a/archaeological_finds/templates/ishtar/sheet_findsource_window.html b/archaeological_finds/templates/ishtar/sheet_findsource_window.html
new file mode 100644
index 000000000..b2a2974bf
--- /dev/null
+++ b/archaeological_finds/templates/ishtar/sheet_findsource_window.html
@@ -0,0 +1,3 @@
+{% extends "ishtar/sheet_findsource.html" %}
+{% block main_head %}{%endblock%}
+{% block main_foot %}{%endblock%}
diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py
index 7a01f952b..e38520329 100644
--- a/archaeological_finds/urls.py
+++ b/archaeological_finds/urls.py
@@ -22,6 +22,8 @@ from django.conf.urls.defaults import *
from ishtar_common.wizards import check_rights
import views
+from archaeological_finds import models
+
# be carreful: each check_rights must be relevant with ishtar_menu
# forms
@@ -76,8 +78,10 @@ urlpatterns += patterns(
name='get-find-full', kwargs={'full': True}),
url(r'get-findsource/(?P<type>.+)?$',
'get_findsource', name='get-findsource'),
+ url(r'show-findsource(?:/(?P<pk>.+))?/(?P<type>.+)?$', 'show_findsource',
+ name=models.FindSource.SHOW_URL),
url(r'show-find(?:/(?P<pk>.+))?/(?P<type>.+)?$', 'show_find',
- name='show-find'),
+ name=models.Find.SHOW_URL),
url(r'show-historized-find/(?P<pk>.+)?/(?P<date>.+)?$',
'show_find', name='show-historized-find'),
url(r'revert-find/(?P<pk>.+)/(?P<date>.+)$',
diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py
index 40c241cb1..16b47881e 100644
--- a/archaeological_finds/views.py
+++ b/archaeological_finds/views.py
@@ -64,6 +64,8 @@ get_find_for_ope = get_item(
extra_request_keys=find_extra_keys,
own_table_cols=models.Find.TABLE_COLS_FOR_OPE)
+show_findsource = show_item(models.FindSource, 'findsource')
+
get_findsource = get_item(
models.FindSource, 'get_findsource', 'findsource',
extra_request_keys={
diff --git a/archaeological_operations/templates/ishtar/sheet_operationsource.html b/archaeological_operations/templates/ishtar/sheet_operationsource.html
index 5e2a39826..5bb8518a5 100644
--- a/archaeological_operations/templates/ishtar/sheet_operationsource.html
+++ b/archaeological_operations/templates/ishtar/sheet_operationsource.html
@@ -6,10 +6,6 @@
<h1>{% trans "Operation source"%}</h1>
{% endblock %}
-{% block export %}
-<div class='tool'>{%trans "Export as:"%} <a href='{% url show-operationsource item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-operationsource item.pk "pdf" %}'>{%trans "PDF file"%}</a></div>
-{% endblock %}
-
{% block related %}
{% field "Related operation" item.owner '' item.owner|link_to_window %}
{% endblock %}
diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html
index 915376938..1302e4637 100644
--- a/ishtar_common/templates/ishtar/sheet.html
+++ b/ishtar_common/templates/ishtar/sheet.html
@@ -45,7 +45,9 @@ jQuery(document).ready(function(){
</script>
{% endblock %}
<div class="body">
-{% block content %}{% endblock %}
+{% block toolbar %}{% endblock %}
+{% block content %}
+{% endblock %}
</div>
</div>
{%block main_foot%}
diff --git a/ishtar_common/templates/ishtar/sheet_source.html b/ishtar_common/templates/ishtar/sheet_source.html
index 044d1b89d..962608e68 100644
--- a/ishtar_common/templates/ishtar/sheet_source.html
+++ b/ishtar_common/templates/ishtar/sheet_source.html
@@ -1,9 +1,7 @@
{% extends "ishtar/sheet.html" %}
{% load i18n window_field window_link %}
+{% block toolbar %}{% include "ishtar/sheet_toolbar.html" %}{% endblock %}
{% block content %}
-{% block export %}
-<div class='tool'>TO BE DEFINED</div>
-{% endblock %}
{% block general %}
{% field "Title" item.title %}
{% field "Source type" item.source_type %}