Files
steel-training/templates/pdf_template.html
2024-09-27 15:01:44 +02:00

122 lines
4.7 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steel Training - {{ stage.split('_') | map('capitalize') | join(' ') }} - {{ distance }} cm
- {{ size|capitalize }}</title>
<style>
@page {
size: {{ size }};
margin: 5mm;
}
body {
font-family: sans-serif;
}
.target {
background-color: dodgerblue;
position: absolute;
}
.circle {
border-radius: 50%;
}
.post {
margin: auto;
background-color: black;
position: relative;
}
.stop-plate {
background-color: red !important;
}
.page-break {
page-break-after: always;
}
.content {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.mounting-point {
height: 10mm;
width: 0.5mm;
background-color: #ccc;
margin: auto;
}
.mounting-info {
font-size: xx-small;
color: #ccc;
text-align: center;
}
.preview {
position: relative;
display: block;
border-bottom: solid 1px black;
border-top: solid 1px black;
width: 100%;
height: 75mm;
}
.preview-post {
position: absolute;
}
</style>
</head>
<body>
<div class="page-break">
<h1>Steel Training</h1>
<h2>{{ stage.split('_') | map('capitalize') | join(' ') }}</h2>
<div class="preview">
{% for target in preview_target_info %}
<div class="post preview-post {% if target.stop_plate %} stop-plate {% endif %}"
style="top: {{ 50 - target.post_height }}mm; left: {{ target.position + 3 }}mm; width: {{ target.post_width }}mm; height: {{ target.height }}mm;">
<div class="target {% if target.width == target.height %} circle {% endif %}"
style="width: {{ target.width }}mm; height: {{ target.height }}mm;
bottom: {{(target.height/2) }}mm;
right: {{ (target.post_width/2) - (target.width/2)}}mm;"></div>
</div>
{% endfor %}
</div>
<p>{%trans%}Wall length required{%endtrans%}: {{ wall_length/10 }}cm</p>
<p>{%trans%}Distance from wall{%endtrans%}: {{ distance|round(1,'ceil') }}cm</p>
<p>{%trans%}Stage preparation{%endtrans%}:</p>
<ul>
<li>{%trans%}Place the first target with the 'ZERO point' marker on the left side of the wall{%endtrans%}</li>
<li>{%trans%}Set shooting box{%endtrans%} {{ box_position }}cm {%trans%}from 'ZERO' point (along the wall) and{%endtrans%} {{distance}}cm {%trans%}from the wall{%endtrans%}</li>
<li>{%trans%}Ensure that the starting field is positioned in a convenient location within the room, so that nothing obstructs the drawing and aiming at targets across the entire width of the wall{%endtrans%}</li>
<li>{%trans%}If necessary, adjust the first target along with the ZERO point and repeat the two previous steps{%endtrans%}</li>
<li>{%trans%}Place the remaining targets on the wall according to the distances indicated on the position markers at the bottom of each target. Ensure that all targets are aligned in a single line parallel to the ground{%endtrans%}</li>
</ul>
</div>
{% for target in target_info %}
<div class="page-break">
<div class="content">
<div class="post {% if target.stop_plate %} stop-plate {% endif %}" style="width: {{ target.post_width }}mm; height: {{ target.post_height }}mm;">
<div class="target {% if target.width == target.height %} circle {% endif %}"
style="
width: {{ target.width }}mm;
height: {{ target.height }}mm;
bottom: {{ target.post_height - (target.height/2) }}mm;
right: {{ (target.post_width/2) - (target.width/2)}}mm;
">
</div>
</div>
{% if target.target == 't1' %}
<div class="mounting-info">{%trans%}ZERO point{%endtrans%} ({{ stage.split('_') | map('capitalize') | join(' ') }})</div>
{% else %}
<div class="mounting-info">{{ target.position / 10 }}cm {%trans%}from ZERO point{%endtrans%} ({{ stage.split('_') | map('capitalize') | join(' ') }})</div>
{% endif %}
<div class="mounting-point"></div>
</div>
</div>
{% endfor %}
</body>
</html>