2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-05-13 09:44:40 +01:00
Files
troggle/templates/new_hole.html
T
2026-05-11 15:04:24 +01:00

153 lines
4.7 KiB
HTML

{% extends "cavebase.html" %}
{% block title %}New Cave Creation Form{% endblock %}
{% block extraheaders %}
<style>
/* Direct match from editcave.html */
div > label {
display: block;
font-weight: bold;
margin-top: 5px;
}
/* MATCHING FIELD LENGTHS TO DATA SHEET */
div.field-discoverers input,
div.field-proposed_name input { width: 400px; }
div.field-tag_id input,
div.field-tag_text input,
div.field-surface_wallet input,
div.field-survey_wallet input,
div.field-gps_owner input,
div.field-gps_coords input { width: 300px; }
div.field-gps_time input,
div.field-dist_to_ent input,
div.field-bear_to_ent input { width: 100px; }
/* SIDE BY SIDE LAYOUT */
.side-by-side {
display: flex;
gap: 20px;
align-items: flex-start;
}
/* CHECKBOX STYLING TO MATCH editcave.html VISUALLY */
.checkbox-container {
display: flex;
flex-direction: row; /* Keep box on the left */
align-items: center;
gap: 10px;
margin-top: 10px;
}
/* Override the 'block' display only for labels attached to checkboxes */
.checkbox-container label {
display: inline;
margin-top: 0;
font-weight: bold; /* Match editcave.html bolding */
}
.submit-btn {
font-weight: bold;
font-size: 200%; /* Match editcave.html submit size */
font-variant-caps: small-caps;
margin-left: 40%;
padding: 10px 20px;
cursor: pointer;
}
.input-unit-group {
display: flex;
align-items: center;
gap: 5px;
}
.unit-label {
font-weight: bold;
font-size: 1.1em;
color: #555;
}
div.field-gps_lat input,
div.field-gps_long input {
width: 140px;
}
</style>
{% endblock %}
{% block content %}
<h1>New Cave Datasheet</h1>
<h3>Instructions</h3>
<p>Refer to the handbook <a href="">New Cave Datasheet</a> page for what all these mean and how to fill them in.</p>
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="form-container">
{% for field in form %}
{# Logic to catch the first coordinate and start a side-by-side div #}
{% if field.name == "gps_lat" %}
<div class="side-by-side">
<div class="field-{{ field.name }}">
{{ field.label_tag }}
{{ field }}<span class="unit-label"> N</span>
{{ field.errors }}
</div>
{% elif field.name == "gps_long" %}
<div class="field-{{ field.name }}">
{{ field.label_tag }}
{{ field }}<span class="unit-label"> E
{%if areatext %}&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue"> {{areatext}}</font>{% endif %}</span>
{{ field.errors }}
</div>
</div> {# Standard Checkbox rendering #}
{% elif field.field.widget.input_type == "checkbox" %}
<div class="field-{{ field.name }} checkbox-container">
{{ field }}
{{ field.label_tag }}
</div>
{{ field.errors }}
{# Standard Field rendering #}
{% else %}
<div class="field-{{ field.name }}">
{{ field.label_tag }}
{{ field }}
{{ field.errors }}
</div>
{% endif %}
{% endfor %}
</div>
<p>
<input class="submit-btn" type="submit" value="Submit" />
</p>
</form>
<h3>What this will do:</h3>
<p>
<ul>
<li>Calculate whether this new cave is in area 1623 or 1626
<li>Create a <span style="font-variant: small-caps;">fixed point</span> record by inserting into :loser:/fixedpts/gps/auto.svx
<li>Create a new Cave record with associated new Entrance record
<li>Do a git commit (expoweb) of the new Cave and Entrance description files
<li>Do a git commit (loser) of the new GPS position<br />
(git commits use your logged-in identity in the "Who are you ?" field)
<li>Update the database with this new information
<li>Take you to a new Wallet for this information and this trip (if it does not exist)
<li>Return you to this form if any important data is missing or invalid
<li>If all is correct, will take you to <br />
- the Entrance edit page for you to upload the photos<br />
- the GPSlogs upload page to upload your prospecting track<br />
- the new Survex page to upload survey data (if any)
- a new Logbook page if you have not already recorded this
</ul>
</p>
{% endblock %}