Lanna Desk's larger work is contracts, general ones and artists', for clients who are Thai or foreign, people or organizations, with several lawyers in the team. The back office gets a Legal section (phase 9 in docs/PLAN.md): - Lawyers: license number, contact, the login of one who uses the app (then "My contracts"), in the team or left. - Clients, as record cards: person or organization, names in English and Thai, stage name or brand, a Thai ID number (checked), a passport or a registration number, the lawyer in charge. - Contracts: code LD-<year>-<n>, the general kinds and the artist kinds (recording, management, publishing, performance, license, merchandise), other party, status, lawyer, dates and value; a contract in force shows its notice day and its end ahead. Filters: general or artists, a lawyer, mine, those over. - Versions: a text kept here, a file (PDF or scan, encrypted as the client's document) or both. They never change: the database refuses UPDATE and DELETE, a version's file cannot be deleted and no document's checksum can change. Any version reads against the one before as a line diff. - Paper copies: the id <code>-P<n> to write on the paper or print as a 90 x 50 mm label with a QR code; where it lies, its state and holder, each move journaled; found again by its id. - The journal: every change in words, in the change's transaction, each entry chained to the one before by SHA-256. The database refuses to change, delete or truncate it; /journal checks the chain and every version's text and fingerprints against its entry, shows the last hash and exports CSV. The sidebar groups its sections: Legal, Visas and stays, Office. Demo data (seed-demo) adds three lawyers, six clients and seven contracts with versions, papers and moves. Documents take a third owner, the client (migration 0009). Checks: fmt, clippy, 115 unit and 62 integration tests (new: versions and the journal, the database refusing changes, a change around the app breaking the chain, paper ids and moves, the demo checking whole); screenshots of the new pages in light, dark and on a phone.
46 lines
2.2 KiB
HTML
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="{{ crumb_href or '/companies' }}">{{ crumb or "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 %}
|