Skip to content

Commit

Permalink
remove split_good_name_across_lines as not needed and add fixed-layou…
Browse files Browse the repository at this point in the history
…t to all tables
  • Loading branch information
markj0hnst0n committed Dec 10, 2024
1 parent a4c12e6 commit 3dfc6ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
8 changes: 4 additions & 4 deletions api/letter_templates/templates/letter_templates/siel.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1>Standard Individual Export Licence</h1>
<img class="dbt-logo" src="{% static 'images/dbt.png' %}">

<table id="first-page-table" class="fixed-layout">
<table id="first-page-table">
<!--
Table is broken up into 12 evenly-spaced columns.
Cell width is controlled by colspan attributes on cells.
Expand Down Expand Up @@ -217,7 +217,7 @@ <h1>Standard Individual Export Licence</h1>
</table>

<p style="page-break-before: always">
<table id="products-table" class="fixed-layout">
<table id="products-table">
<tr>
<td class="border-top-black padding-none align-centre" rowspan="999">
<div class="text-large border-left-black border-bottom-black">1</div>
Expand Down Expand Up @@ -282,12 +282,12 @@ <h1>Standard Individual Export Licence</h1>
<table border="0">
<tr id="row-{{ forloop.counter}}-description-name">
<td><strong>Name:</strong></td>
<td>{% if good.name %}{{ good.name|split_good_name_across_lines }}{% else %}{{ good.description|split_good_name_across_lines }}{% endif %}
<td>{% if good.name %}{{ good.name }}{% else %}{{ good.description }}{% endif %}
</td>
</tr>
<tr>
<td><strong>Description:</strong></td>
<td>{{ good.description|default_na }}</td>
<td>{{ good.description|default_na }}</td>
</tr>
<tr id="row-{{ forloop.counter}}-description-part-number">
<td><strong>Part number:</strong></td>
Expand Down
5 changes: 0 additions & 5 deletions api/letter_templates/templatetags/custom_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,3 @@ def remove_duplicate_provisos(goods_approved):
provisos.add(good_item["proviso_reason"])

return provisos


@register.filter(name="split_good_name_across_lines")
def split_good_name_across_lines(value):
return value.replace(",", "\n") if "," in value else value
4 changes: 2 additions & 2 deletions assets/css/siel_preview.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
container-type: inline-size;
}
.document * {
font-size: 1.75cqw;
font-size: 12px;
font-family: Helvetica;
word-wrap: break-word;
}
Expand All @@ -29,7 +29,7 @@
margin: 0;
padding: 5px;
}
.document table.fixed-layout {
.document table {
table-layout: fixed;
}
.document .border-black {
Expand Down

0 comments on commit 3dfc6ab

Please sign in to comment.