templates: remove calc, do all through jinja

This commit is contained in:
Laurier Loiselle 2023-04-11 17:02:04 -04:00
parent 77770027ac
commit 19a6c04496
No known key found for this signature in database
GPG Key ID: 345920CC72089A3F
4 changed files with 16 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<style> <style>
.A4 #bom { /* BOM on top of title block */ .A4 #bom { /* BOM on top of title block */
position: absolute; position: absolute;
bottom: calc({{ titleblock_rows + 1 }} * 4.25mm); bottom: {{ (titleblock_rows + 1) * 4.25 }}mm;
right: 0; right: 0;
} }

View File

@ -67,11 +67,18 @@
top: 0; top: 0;
left: 0; left: 0;
max-width: 100%; max-width: 100%;
height: calc(100% - {{ bottom_rows }} * 4.25mm);
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
} }
#diagram {
{% if sheetsize == A2 %}
height: {{ 400 - bottom_rows * 4.25 }}mm;
{% else %}
height: {{ 277 - bottom_rows * 4.25 }}mm;
{% endif %}
}
#diagram svg, #diagram img { #diagram svg, #diagram img {
max-width: 95%; max-width: 95%;
max-height: 100%; max-height: 100%;
@ -104,7 +111,7 @@
{{ description }} {{ description }}
</div> </div>
<div id="diagram"> <div id="diagram" class={{ sheetsize }}>
{{ diagram }} {{ diagram }}
</div> </div>

View File

@ -2,9 +2,9 @@
.A4 #notes { /* NOTES on top of BOM */ .A4 #notes { /* NOTES on top of BOM */
position: absolute; position: absolute;
{% if show_bom %} {% if show_bom %}
bottom: calc({{ titleblock_rows + bom_rows + 2 }} * 4.25mm); bottom: {{ (titleblock_rows + bom_rows + 2) * 4.25 }}mm;
{% else %} {% else %}
bottom: calc({{ titleblock_rows + 1 }} * 4.25mm); bottom: {{ (titleblock_rows + 1) * 4.25 }}mm;
{% endif %} {% endif %}
right: 0; right: 0;
} }
@ -12,11 +12,11 @@
.A3 #notes, .A2 #notes { /* NOTES on top of title block */ .A3 #notes, .A2 #notes { /* NOTES on top of title block */
position: absolute; position: absolute;
{% if notes_on_right %} {% if notes_on_right %}
bottom: calc({{ titleblock_rows + 1 }} * 4.25mm); bottom: {{ (titleblock_rows + 1) * 4.25 }}mm;
right: 0; right: 0;
{% else %} {% else %}
{% if show_bom %} {% if show_bom %}
bottom: calc({{ bom_rows + 1 }} * 4.25mm); bottom: {{ (bom_rows + 1) * 4.25 }}mm;
{% else %} {% else %}
bottom: 0; bottom: 0;
{% endif %} {% endif %}

View File

@ -7,7 +7,7 @@
#titleblock { #titleblock {
width: 180mm; width: 180mm;
height: calc({{ titleblock_rows }} * 4.25mm)); height: {{ titleblock_rows * 4.25 }}mm;
} }
#titleblock table, th, td { #titleblock table, th, td {
@ -108,7 +108,7 @@
<!-- START OF TEMPLATE --!> <!-- START OF TEMPLATE --!>
<div id="titleblock"> <div id="titleblock">
<table id="titleblock"> <table>
<tr> <!-- ROW 1 --!> <tr> <!-- ROW 1 --!>
<!-- REVISIONS Column 1 to 4 --!> <!-- REVISIONS Column 1 to 4 --!>
{{ revision(1) }} {{ revision(1) }}