distdance unit conversion to meters

This commit is contained in:
bogo
2024-09-30 20:04:28 +02:00
parent 635bca66d9
commit d8e9eb7ba8
10 changed files with 68 additions and 39 deletions

View File

@@ -54,6 +54,23 @@
Wesprzyj projekt
</a>
</div>
{% with messages = get_flashed_messages(with_categories=True) %}
{% if messages %}
<div class="mt-4">
{% for category, message in messages %}
{% if category == 'danger' %}
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
<strong class="font-bold">{% trans %}Error{% endtrans %}</strong>
{%else%}
<div class="bg-blue-100 border border-blue-400 text-blue-700 px-4 py-3 rounded relative" role="alert">
<strong class="font-bold">{% trans %}Info{% endtrans %}</strong>
{%endif%}
<span class="block sm:inline">{{ message }}</span>
</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</div>

View File

@@ -7,7 +7,7 @@
{% include 'setup.html' %}
<div class="mb-6 max-w-2xl mx-auto mt-4">
<h2>{%trans%}Simulated distance{%endtrans%} [m]</h2>
<input type="number" id="simulated_distance" name="simulated_distance" min="1" max="300" class="w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-400" required>
<input type="number" id="simulated_distance" name="simulated_distance" step="0.1" min="1" max="5000" class="w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-400" required>
</div>
<div class="mb-6 max-w-2xl mx-auto">
<h2>{%trans%}Select the target type{%endtrans%}</h2>
@@ -19,7 +19,7 @@
{% with target_width=5, target_height=5 %}
{% include 'ts2_svg.html' %}
{% endwith %}
<input type="radio" id="ts2" name="target_type" value="ts2" required class="m-1"> <!-- Margin added for spacing -->
<input type="radio" id="ts2" name="target_type" value="ts2" required class="m-1">
</label>
</div>
<div class="flex flex-col justify-between h-full">
@@ -28,7 +28,7 @@
{% with target_width=3, target_height=8.5 %}
{% include 'popper_svg.html' %}
{% endwith %}
<input type="radio" id="popper" name="target_type" value="popper" required class="m-1"> <!-- Margin added for spacing -->
<input type="radio" id="popper" name="target_type" value="popper" required class="m-1">
</label>
</div>
<div class="flex flex-col justify-between h-full">
@@ -37,7 +37,7 @@
{% with target_width=4.5, target_height=5.8 %}
{% include 'ipsc_svg.html' %}
{% endwith %}
<input type="radio" id="ipsc" name="target_type" value="ipsc" required class="m-1"> <!-- Margin added for spacing -->
<input type="radio" id="ipsc" name="target_type" value="ipsc" required class="m-1">
</label>
</div>
<div class="flex flex-col justify-between h-full">

View File

@@ -3,7 +3,7 @@
<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
<title>Steel Training - {{ stage.split('_') | map('capitalize') | join(' ') }} - {{ distance }}m
- {{ size|capitalize }}</title>
<style>
@page {
@@ -83,11 +83,11 @@
</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%}Distance from wall{%endtrans%}: {{ distance }}m</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%}Set shooting box{%endtrans%} {{ box_position }}cm {%trans%}from 'ZERO' point (along the wall) and{%endtrans%} {{distance}}m {%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>

View File

@@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steel Training | {%trans%}Target{%endtrans%}: {{ target_type|upper }} | {%trans%}Simulated distance{%endtrans%}: {{ simulated_distance }}m | {%trans%}Place target on{%endtrans%}: {{distance}}cm</title>
<title>Steel Training | {%trans%}Target{%endtrans%}: {{ target_type|upper }} | {%trans%}Simulated distance{%endtrans%}: {{ simulated_distance }}m | {%trans%}Place target on{%endtrans%}: {{distance}}m</title>
<style>
@page {
size: {{size}};
@@ -75,7 +75,7 @@
{% endwith %}
<br>
<div class="mounting-info">
{%trans%}Target{%endtrans%}: {{ target_type|upper }} | {%trans%}Simulated distance{%endtrans%}: {{ simulated_distance }}m | {%trans%}Place target on{%endtrans%}: {{distance}}cm
{%trans%}Target{%endtrans%}: {{ target_type|upper }} | {%trans%}Simulated distance{%endtrans%}: {{ simulated_distance }}m | {%trans%}Place target on{%endtrans%}: {{distance}}m
<br>
Steel Training
</div>

View File

@@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steel Training - IPSC - El Presidente - {{ distance }} cm
<title>Steel Training - IPSC - El Presidente - {{ distance }} m
- {{ size|capitalize }}</title>
<style>
@page {
@@ -76,11 +76,11 @@
{% endfor %}
</div>
<p>{%trans%}Wall length required{%endtrans%}: {{ wall_length|round(1,'ceil') }}cm</p>
<p>{%trans%}Distance from wall{%endtrans%}: {{ distance|round(1,'ceil') }}cm</p>
<p>{%trans%}Distance from wall{%endtrans%}: {{ distance }}m</p>
<p>{%trans%}Stage preparation{%endtrans%}:</p>
<ul>
<li>{%trans%}Place the first target with the 'ZERO point' marker on the left or right side of the wall{%endtrans%}</li>
<li>{%trans%}Set shooting box{%endtrans%} {{ box_position|round(1,'ceil') }}cm {%trans%}from 'ZERO' point (along the wall) and{%endtrans%} {{distance}}cm {%trans%}from the wall{%endtrans%}</li>
<li>{%trans%}Set shooting box{%endtrans%} {{ box_position|round(1,'ceil') }}cm {%trans%}from 'ZERO' point (along the wall) and{%endtrans%} {{distance}}m {%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>

View File

@@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steel Training - Shootoff - {{ distance }} cm
<title>Steel Training - Shootoff - {{ distance }} m
- {{ size|capitalize }}</title>
<style>
@page {
@@ -110,11 +110,11 @@
{% endfor %}
</div>
<p>{%trans%}Wall length required{%endtrans%}: {{ wall_length|round(1,'ceil') }}cm</p>
<p>{%trans%}Distance from wall{%endtrans%}: {{ distance|round(1,'ceil') }}cm</p>
<p>{%trans%}Distance from wall{%endtrans%}: {{ distance }}m</p>
<p>{%trans%}Stage preparation{%endtrans%}:</p>
<ul>
<li>{%trans%}Place the first target with the 'ZERO point' marker on the left or right side of the wall{%endtrans%}</li>
<li>{%trans%}Set shooting box{%endtrans%} {{ box_position|round(1,'ceil') }}cm {%trans%}from 'ZERO' point (along the wall) and{%endtrans%} {{distance}}cm {%trans%}from the wall{%endtrans%}</li>
<li>{%trans%}Set shooting box{%endtrans%} {{ box_position|round(1,'ceil') }}cm {%trans%}from 'ZERO' point (along the wall) and{%endtrans%} {{distance}}m {%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>

View File

@@ -18,8 +18,8 @@
</div>
<div class="mb-6 max-w-2xl mx-auto mt-4">
<h2>{%trans%}Distance{%endtrans%} [cm]</h2>
<input type="number" id="distance" name="distance" min="100" max="700" class="w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-400" required>
<h2>{%trans%}Distance{%endtrans%} [m]</h2>
<input type="number" id="distance" name="distance" step="0.01" min="0.5" max="100" class="w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-400" required>
</div>
</div>
<div class="mb-6 max-w-2xl mx-auto mt-10">