summaryrefslogtreecommitdiff
path: root/ishtar_common/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-02-24 01:58:25 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-02-24 01:58:25 +0100
commita15f6165f04cc249a42edde5f01851ccd2d7d4ac (patch)
treef048ebfbdc4dac598b0e3bafdb3aa04efb693657 /ishtar_common/views.py
parentb8c911e12b380efc49865ad8b18e825d23c4bdd0 (diff)
downloadIshtar-a15f6165f04cc249a42edde5f01851ccd2d7d4ac.tar.bz2
Ishtar-a15f6165f04cc249a42edde5f01851ccd2d7d4ac.zip
Fix dynamic table display in ODT and PDF
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r--ishtar_common/views.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 1c944441f..5ea53374d 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -729,6 +729,7 @@ def show_item(model, name, extra_dct=None):
dct.update(extra_dct(request, item))
context_instance = RequestContext(request)
context_instance.update(dct)
+ context_instance['output'] = 'html'
filename = ""
if hasattr(item, 'history_object'):
filename = item.history_object.associated_filename
@@ -736,6 +737,7 @@ def show_item(model, name, extra_dct=None):
filename = item.associated_filename
if doc_type == "odt" and settings.ODT_TEMPLATE:
tpl = loader.get_template('ishtar/sheet_%s.html' % name)
+ context_instance['output'] = 'ODT'
content = tpl.render(context_instance)
try:
tidy_options = {'output-xhtml': 1, 'indent': 1,
@@ -775,6 +777,7 @@ def show_item(model, name, extra_dct=None):
return response
elif doc_type == 'pdf':
tpl = loader.get_template('ishtar/sheet_%s_pdf.html' % name)
+ context_instance['output'] = 'PDF'
content = tpl.render(context_instance)
result = StringIO.StringIO()
html = content.encode('utf-8')