Add processing for <ul> in RML

This commit is contained in:
Tom Price
2016-01-07 20:02:07 +00:00
parent 088e23749d
commit 2d3262cb0b
3 changed files with 170 additions and 132 deletions

View File

@@ -10,7 +10,11 @@
<td> <td>
{% endif %} {% endif %}
<h1><b>N{{ object.pk|stringformat:"05d" }}:</b> '{{ object.name }}'<small></small></h1> <h1>
<b>N{{ object.pk|stringformat:"05d" }}:</b>
'{{ object.name }}'
<small></small>
</h1>
<para style="style.event_description"> <para style="style.event_description">
<b>{{ object.start_date|date:"D jS N Y" }}</b> <b>{{ object.start_date|date:"D jS N Y" }}</b>
@@ -28,19 +32,25 @@
<spacer length="10"/> <spacer length="10"/>
<blockTable style="eventDetails" colWidths="100,175"> <blockTable style="eventDetails" colWidths="100,175">
<tr> <tr>
<td><para style="invoice_titles">Invoice Number</para></td> <td>
<para style="invoice_titles">Invoice Number</para>
</td>
<td> <td>
<para style="invoice_numbers">{{ invoice.pk|stringformat:"05d" }}</para> <para style="invoice_numbers">{{ invoice.pk|stringformat:"05d" }}</para>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><para style="invoice_titles">Invoice Date</para></td> <td>
<para style="invoice_titles">Invoice Date</para>
</td>
<td> <td>
<para style="invoice_numbers">{{ invoice.invoice_date|date:"d/m/Y" }}</para> <para style="invoice_numbers">{{ invoice.invoice_date|date:"d/m/Y" }}</para>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><para style="invoice_titles">PO Number</para></td> <td>
<para style="invoice_titles">PO Number</para>
</td>
<td> <td>
<para style="invoice_numbers">{{ object.purchase_order|default_if_none:"" }}</para> <para style="invoice_numbers">{{ object.purchase_order|default_if_none:"" }}</para>
</td> </td>
@@ -107,7 +117,9 @@
<h2>Timings</h2> <h2>Timings</h2>
<blockTable style="eventDetails" colWidths="55,75"> <blockTable style="eventDetails" colWidths="55,75">
<tr> <tr>
<td leftPadding="0" topPadding="0"><h3>Start</h3></td> <td leftPadding="0" topPadding="0">
<h3>Start</h3>
</td>
<td> <td>
<para style="times">{{ object.start_time|time:"H:i" }} <para style="times">{{ object.start_time|time:"H:i" }}
{{ object.start_date|date:"d/m/Y" }} {{ object.start_date|date:"d/m/Y" }}
@@ -115,7 +127,9 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td leftPadding="0"><h3>End</h3></td> <td leftPadding="0">
<h3>End</h3>
</td>
<td> <td>
<para style="times">{{ object.end_time|default_if_none:""|time:"H:i" }} <para style="times">{{ object.end_time|default_if_none:""|time:"H:i" }}
{{ object.end_date|date:"d/m/Y" }} {{ object.end_date|date:"d/m/Y" }}
@@ -124,7 +138,9 @@
</tr> </tr>
{% if object.access_at and not invoice %} {% if object.access_at and not invoice %}
<tr> <tr>
<td leftPadding="0"><h3>Access</h3></td> <td leftPadding="0">
<h3>Access</h3>
</td>
<td> <td>
<para style="times">{{ object.access_at|time:"H:i" }} <para style="times">{{ object.access_at|time:"H:i" }}
{{ object.access_at|date:"d/m/Y" }} {{ object.access_at|date:"d/m/Y" }}
@@ -173,7 +189,7 @@
<para>{{ item.name }} <para>{{ item.name }}
{% if item.description %} {% if item.description %}
</para> </para>
<indent left="1cm"> <indent left="0.5cm">
{{ item.description|markdown:"rml" }} {{ item.description|markdown:"rml" }}
</indent> </indent>
<para> <para>
@@ -254,14 +270,17 @@
{% if object.organisation.union_account %} {% if object.organisation.union_account %}
<para style="blockPara"> <para style="blockPara">
<i> <i>
I agree that am authorised to sign this invoice. I agree that I am the President/Treasurer of the hirer, or I agree that am authorised to sign this invoice. I agree that I am the President/Treasurer of the hirer,
that I have provided written permission from either the President or Treasurer of the hirer stating that I can or
that I have provided written permission from either the President or Treasurer of the hirer stating that
I can
sign for this invoice. sign for this invoice.
</i> </i>
</para> </para>
<para style="blockPara"> <para style="blockPara">
<i> <i>
I have read, understood and fully accepted the current conditions of hire. I agree to return any dry hire I have read, understood and fully accepted the current conditions of hire. I agree to return any dry
hire
items to TEC PA &amp; Lighting in the same condition at the end of the hire period. items to TEC PA &amp; Lighting in the same condition at the end of the hire period.
</i> </i>
</para> </para>
@@ -287,8 +306,10 @@
{% else %} {% else %}
<para style="blockPara"> <para style="blockPara">
<i> <i>
I, the hirer, have read, understand and fully accept the current conditions of hire. This document forms a I, the hirer, have read, understand and fully accept the current conditions of hire. This document forms
binding contract between TEC PA &amp; Lighting and the hirer, the aforementioned conditions of hire forming a
binding contract between TEC PA &amp; Lighting and the hirer, the aforementioned conditions of hire
forming
an integral part of it. an integral part of it.
</i> </i>
</para> </para>
@@ -306,7 +327,8 @@
</para> </para>
<para style="blockPara"> <para style="blockPara">
<i> <i>
I, the hirer, have received the goods/services as requested and in good order. I agree to return any dry hire I, the hirer, have received the goods/services as requested and in good order. I agree to return any dry
hire
items to TEC PA &amp; Lighting in a similar condition at the end of the hire period. items to TEC PA &amp; Lighting in a similar condition at the end of the hire period.
</i> </i>
</para> </para>
@@ -315,4 +337,6 @@
{% include "RIGS/event_print_signature.xml" %} {% include "RIGS/event_print_signature.xml" %}
</keepTogether> </keepTogether>
{% endif %} {% endif %}
<namedString id="lastPage"><pageNumber/></namedString> <namedString id="lastPage">
<pageNumber/>
</namedString>

View File

@@ -30,6 +30,20 @@ def markdown_filter(text, format='html'):
bq.name = 'pre' bq.name = 'pre'
bq.string = bq.text bq.string = bq.text
for ul in soup('ul'):
ul['value'] = 'square'
ul['bulletFontSize'] = '8'
for li in ul.findAll('li'):
p = soup.new_tag('p')
p.string = li.text
li.string = ''
li.append(p)
indent = soup.new_tag('indent')
indent['left'] = '1.2cm'
content = ul.replace_with(indent)
indent.append(content)
# Paragraphs have a different tag # Paragraphs have a different tag
for p in soup('p'): for p in soup('p'):
p.name = 'para' p.name = 'para'

Binary file not shown.