Added title to print

This commit is contained in:
David Taylor
2015-08-09 23:53:38 +03:00
committed by Tom Price
parent 09dc2a3eb4
commit 5862646314
2 changed files with 6 additions and 12 deletions

View File

@@ -1,17 +1,14 @@
<setNextFrame name="main"/> <setNextFrame name="main"/>
<nextFrame/> <nextFrame/>
<h1><b>{{ form.schema.schema_type.name }}</b><small></small></h1>
{% autoescape off %} <spacer length="10"/>
{% autoescape off %}
{{ formData }} {{ formData }}
{% endautoescape %} {% endautoescape %}
<namedString id="lastPage"><pageNumber/></namedString> <namedString id="lastPage"><pageNumber/></namedString>

View File

@@ -141,7 +141,6 @@ class FormPrint(generic.TemplateView):
} }
return template.render(context) return template.render(context)
def _render_boolean(self, field, value, current_indent): def _render_boolean(self, field, value, current_indent):
template = get_template('rigForms/print/render-boolean.xml') template = get_template('rigForms/print/render-boolean.xml')
context = { context = {
@@ -176,7 +175,6 @@ class FormPrint(generic.TemplateView):
return result return result
def _render_field(self, parentField, parentValue, current_indent): def _render_field(self, parentField, parentValue, current_indent):
result = "" result = ""
for (key,field) in parentField.items(): for (key,field) in parentField.items():
@@ -213,7 +211,8 @@ class FormPrint(generic.TemplateView):
'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF', 'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF',
} }
}, },
'formData':formData 'formData':formData,
'form':form
}) })
rml = template.render(context) rml = template.render(context)
@@ -228,6 +227,4 @@ class FormPrint(generic.TemplateView):
response = HttpResponse(content_type='application/pdf') response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = "filename=Form.pdf" response['Content-Disposition'] = "filename=Form.pdf"
response.write(pdfData) response.write(pdfData)
return response return response