Files
visa/templates/record_form.html
T
grabowski a2cedcdd7e
CI / secret scan (push) Successful in 5s
CI / fmt, clippy, tests (push) Successful in 39s
Phase 5: the Immigration Bureau's forms, filled in from the records
A Forms tab on each person fills in TM.7, STM.2, STM.9, STM.11 and STM.1
for an extension of stay, TM.47 for a 90-day report and TM.8 for a re-entry
permit. The Bureau's blank pages (forms/, with their sources and checksums)
go unchanged into a new PDF, and the values are written on the dotted lines
in Sarabun; boxes are ticked and the title circled where a form asks.
scripts/gen_layout.py measures the blanks into src/papers/layout.rs.

The tab says what would stay blank and links to where it is added. What only
the application says (the date, the office, the reason, the days, a trip) is
carried in the links and never stored. The extension's five forms also come
in one PDF. Opening or downloading a form is audited as entity "form" with
the forms' codes, never their values.

Migration 0005 adds what STM.1 and STM.11 ask of the company (capital,
revenue, equity, staff, a coordinator), a work permit's salary and contract
dates, and where an arrival came from. The Nix package now takes forms/.
2026-11-18 12:30:03 +07:00

46 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% import "_fields.html" as fm %}
{% block main %}
{% if p %}
{% include "_person_head.html" %}
{% else %}
<div class="crumbs"><a href="/companies">Companies</a></div>
<div class="pagehead"><h1>{{ heading }}</h1></div>
{% endif %}
<form method="post" action="{{ action }}" class="form" id="record-form">
<input type="hidden" name="csrf" value="{{ csrf }}">
<section class="card">
{% if p %}<header><h2>{{ heading }}</h2></header>{% endif %}
{% if lead %}<p class="hint lead">{{ lead }}</p>{% endif %}
<div class="grid">
{%- for fl in fields %}
{%- if fl.section %}
<h3 class="fsec">{{ fl.section }}</h3>
{%- endif %}
{%- if fl.kind == "area" %}
{{ fm.area(fl.name, fl.label, values[fl.name], err=errors[fl.name], hint=fl.hint, rows=3, fcls="wide") }}
{%- elif fl.kind == "select" %}
{{ fm.select(fl.name, fl.label, values[fl.name], fl.options, err=errors[fl.name], hint=fl.hint, blank=fl.blank, cls=("wide" if fl.wide else ""), req=fl.required) }}
{%- else %}
{{ fm.text(fl.name, fl.label, values[fl.name], err=errors[fl.name], hint=fl.hint, req=fl.required, type=fl.kind, list=fl.suggest, cls=("wide" if fl.wide else "")) }}
{%- endif %}
{%- endfor %}
</div>
</section>
<div class="formactions">
<button type="submit" class="btn pri" id="save">{% if mode == "new" %}Add the {{ one }}{% else %}Save{% endif %}</button>
<a class="btn ghost" href="{{ cancel }}">Cancel</a>
</div>
</form>
<datalist id="ports">{% for x in ports %}<option value="{{ x }}"></option>{% endfor %}</datalist>
<datalist id="offices">{% for x in offices %}<option value="{{ x }}"></option>{% endfor %}</datalist>
<datalist id="provinces">{% for x in provinces %}<option value="{{ x }}"></option>{% endfor %}</datalist>
{% if mode == "edit" and p %}
<form method="post" action="{{ action }}/delete" class="dangerzone" data-confirm="Delete this {{ one }} from the record?">
<input type="hidden" name="csrf" value="{{ csrf }}">
<button type="submit" class="btn sm danger">Delete this {{ one }}</button>
<span class="muted small">For a record entered by mistake. The activity log keeps a note that it existed.</span>
</form>
{% endif %}
{% endblock %}