Open pdf in new tab & add distance from previous marker on mounting info

This commit is contained in:
bogo
2024-10-04 21:36:35 +02:00
parent f92496b83a
commit 767f0d2476
7 changed files with 22 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
{% block content %}
<form class="" action="/generate-pdf-custom" method="post">
<form class="" action="/generate-pdf-custom" method="post" target="_blank">
{% include 'setup.html' %}
<div class="mb-6 max-w-2xl mx-auto mt-4">
<h2>{%trans%}Simulated distance{%endtrans%} [m]</h2>

View File

@@ -3,7 +3,7 @@
{% block content %}
<form class="" action="/generate-pdf-ipsc" method="post">
<form class="" action="/generate-pdf-ipsc" method="post" target="_blank">
{% include 'setup.html' %}
<div class="mb-6 max-w-2xl mx-auto">
<h2>{%trans%}Select the stage{%endtrans%}</h2>

View File

@@ -94,6 +94,8 @@
</ul>
</div>
{% set ns = namespace(previous_position = 0) %}
{% for target in target_info %}
<div class="page-break">
<div class="content">
@@ -111,11 +113,16 @@
{% 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>
<div class="mounting-info">{{ target.position / 10 }}cm {%trans%}from ZERO point{%endtrans%}
{% if target.target != 't2' %}
{%trans%}or{%endtrans%} {{(target.position - ns.previous_position)/10}}cm {%trans%}from previous marker{%endtrans%}
{% endif %}
({{ stage.split('_') | map('capitalize') | join(' ') }})</div>
{% endif %}
<div class="mounting-point"></div>
</div>
</div>
{% set ns.previous_position = target.position %}
{% endfor %}
</body>

View File

@@ -2,7 +2,7 @@
{% block title %}Steel Challenge{% endblock %}
{% block content %}
<form class="" action="/generate-pdf" method="post">
<form class="" action="/generate-pdf" method="post" target="_blank">
{% include 'setup.html' %}
<div class="mb-6 max-w-2xl mx-auto">

View File

@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block title %}Shootoff{% endblock %}
{% block content %}
<form class="" action="/generate-pdf-shootoff" method="post">
<form class="" action="/generate-pdf-shootoff" method="post" target="_blank">
{% include 'setup.html' %}
<div class="mb-6 max-w-2xl mx-auto">

View File

@@ -96,3 +96,12 @@ msgstr "Dystans symulowany nie może być większy niż dystans od ściany"
msgid "Error"
msgstr "Błąd"
msgid "or"
msgstr "lub"
msgid "from previous marker"
msgstr "od poprzedniego znacznika"
msgid "from ZERO point"
msgstr "od punktu ZERO"