Built into the app rather than a separate signing service: any number of agreements (the processing of the client's data first, legal services and consultations later), each in versions whose text never changes. - Staff (Agreements in the sidebar, src/web/agreements.rs): paste the lawyers' text (empty line = paragraph, "# " heading, "- " list item), preview it as the client reads it, publish version 1; a changed text is the next version, the same text again is refused, and the database refuses any change to a published one (migrations/0007, trigger). Switch an agreement off and links stop asking for it. - Client: every active agreement is the first step of every link. The client reads it, ticks that they accept, types their name and signs with a finger or the mouse (static/signature.js; a PNG of the pad). A text changed while they read it is refused. A new version is asked for again at the next link. - The signed copy (src/agreements/pdf.rs, Sarabun so Thai prints, long Thai words cut without parting marks from their letter): the text, the name, the record, the time, the drawing, the link, the forwarded address, the browser and the text's SHA-256; kept as the person's encrypted document of kind "agreement", all in one transaction with the signature and the audit rows (actor link N). - The person's page shows each agreement's state (signed, not signed, to sign again) and every signed copy. - Phones: the section row now scrolls sideways instead of wrapping, so it keeps one height with five sections and Sign out. - Demo data: an invented agreement with a Thai paragraph. Checks: fmt, clippy; 105 unit and 56 integration tests (tests/agreements.rs: versions that never change, signing with a drawing, address and browser recorded, the PDF, signing again after a change, a stale version refused, switched off); layout check light/dark desk/phone on the agreement pages, the client's agreement page, the person page and the people list: no problems; a drawn signature in Edge at 390x844 signed and printed.
24 lines
1.6 KiB
HTML
24 lines
1.6 KiB
HTML
{% extends "client_base.html" %}
|
|
{% block main %}
|
|
<h1 class="chead">{% if first_name %}Hello {{ first_name }}{% else %}Hello{% endif %}</h1>
|
|
<p class="lead2">B4L looks after your visa and your stay in Thailand. Fill in the parts below. Each part is saved on its own, so you can stop and come back to this link. When everything is in, press Send.</p>
|
|
{% if saved %}<div class="notice ok" role="status">Saved: {{ saved }}.</div>{% endif %}
|
|
<ol class="parts">
|
|
{% for p in parts %}
|
|
<li>
|
|
<a class="part{% if p.done %} done{% endif %}" href="{{ base }}/{{ p.slug }}" id="part-{{ p.slug|replace("/", "-") }}">
|
|
<span class="pmark" aria-hidden="true">{% if p.done %}✓{% else %}{{ loop.index }}{% endif %}</span>
|
|
<span class="pbody"><b>{{ p.title }}</b><span class="muted small">{{ p.what }}</span></span>
|
|
<span class="chip {% if p.done %}ok{% else %}warn{% endif %}">{{ p.status }}</span>
|
|
</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ol>
|
|
<form method="post" action="{{ base }}/send" class="card sendcard" id="send"{% if missing %} data-confirm="Still to do: {{ missing|join(", ") }}. Send anyway? The link closes once it is sent."{% else %} data-confirm="Send your details to B4L? The link closes once it is sent."{% endif %}>
|
|
<input type="hidden" name="csrf" value="{{ csrf }}">
|
|
<h2>Send</h2>
|
|
<p class="muted">{% if missing %}Still to do: {{ missing|join(", ") }}. You can send now and give the rest to B4L later.{% else %}Everything is in. Send it, and B4L checks it.{% endif %} After Send the link closes.</p>
|
|
<button type="submit" class="btn pri" id="send-btn">Send to B4L</button>
|
|
</form>
|
|
{% endblock %}
|