Files
visa/templates/agreements.html
T
grabowski d0e13dffd2
CI / secret scan (push) Successful in 6s
CI / fmt, clippy, tests (push) Successful in 1m0s
CI / release (push) Skipped
Agreements the client signs on the link (task 7.6)
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.
2026-11-20 20:18:59 +07:00

28 lines
1.2 KiB
HTML

{% extends "base.html" %}
{% block main %}
<div class="pagehead">
<h1>Agreements</h1>
<div class="actions"><a class="btn pri" href="/agreements/new" id="new-agreement">+ New agreement</a></div>
</div>
<p class="lead2">What clients sign through their link: every active agreement is asked for, in its current version. A published text never changes; a new version is signed again at the client's next link.</p>
{% if rows %}
<div class="tblwrap">
<table class="tbl" id="agreement-list">
<thead><tr><th>Agreement</th><th>Current version</th><th>Signed</th><th><span class="vh">State</span></th></tr></thead>
<tbody>
{% for r in rows %}
<tr>
<td><a class="strong" href="/agreements/{{ r.id }}">{{ r.title }}</a></td>
<td>{{ r.version }}, {{ r.published }}</td>
<td>{{ r.signed }}</td>
<td>{% if r.active %}<span class="chip ok">asked for</span>{% else %}<span class="chip plain">switched off</span>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="card"><p class="empty-inline">No agreement yet. Once one is added, every client link asks the client to read and sign it.</p></div>
{% endif %}
{% endblock %}