Originals in our care (phase 12, step 1)
What clients hand Lanna Desk for a while (a passport for an extension, a signed contract, a title deed) gets a code and a label (OR-2026-0001), and a record of where it is: held at a place in the office, out with someone such as Chiang Mai Immigration until a date, or returned. - Migration 0013: table originals, owned by a client or a person; the database refuses a delete and a change of what it is, whose it is and how it came. - Every intake and move is a journal entry starting with the code; the item's page reads its history from there. The audit log has the new entity "original", with a view when a person's original is shown. - Pages: Legal, Originals (in our care, out, held, returned, all; a find box for a typed or scanned code), the item's page with the move form, intake from a client's or a person's page, and the label with a QR code to the item's page. Cards on the client's and the person's pages. - A field can show only for some choices of a selection (data-shown-when), so the move form asks "Where it lies", "With whom" or "Returned to" as fits. - Demo data: a passport out at Immigration, a title deed and a house registration held, a company certificate returned. - PLAN: phase 12, with step 2 (the inbox that files a pile of scans) and step 3 planned.
This commit is contained in:
1 parent
329b181c4f
commit
ff716eb9d3
23 files changed
+1815
-3
No files matched your search
@@ -0,0 +1,32 @@
|
||||
{#- Originals as table rows: the list's and the owner cards'. -#}
|
||||
{% macro table(rows, with_owner=true, id="original-list") -%}
|
||||
<div class="tblwrap">
|
||||
<table class="tbl" id="{{ id }}">
|
||||
<thead><tr><th>Code</th><th>Original</th>{% if with_owner %}<th>Whose</th>{% endif %}<th>Where it is</th></tr></thead>
|
||||
<tbody>
|
||||
{%- for r in rows %}
|
||||
<tr id="original-{{ r.id }}" data-q="{{ r.q }}"{% if r.state == "returned" %} class="old"{% endif %}>
|
||||
<td><a class="pcode mono" href="{{ r.href }}">{{ r.code }}</a></td>
|
||||
<td>{{ r.what }}{% if r.kind_note or r.contract_code %}<div class="sub">{{ r.kind_note }}{% if r.kind_note and r.contract_code %} · {% endif %}{{ r.contract_code or "" }}</div>{% endif %}</td>
|
||||
{%- if with_owner %}
|
||||
<td><a href="{{ r.owner_href }}">{{ r.owner }}</a></td>
|
||||
{%- endif %}
|
||||
<td><span class="chip {% if r.state == "held" %}ok{% elif r.state == "out" %}warn{% else %}plain{% endif %}">{{ r.state_label }}</span> {{ r.place }}{% if r.chip %} <span class="chip {{ r.chip[0] }}">{{ r.chip[1] }}</span>{% endif %}<div class="sub">since {{ r.since }}</div></td>
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
||||
{#- The card on a client's or a person's page. -#}
|
||||
{% macro card(rows, new_href) -%}
|
||||
<section class="card" id="originals">
|
||||
<header><h2>Originals in our care</h2><a class="btn sm" href="{{ new_href }}" id="new-original">+ Take one in</a></header>
|
||||
{%- if rows %}
|
||||
{{ table(rows, with_owner=false, id="owner-originals") }}
|
||||
{%- else %}
|
||||
<p class="empty-inline">Nothing of theirs is with us. A passport for an extension, a signed contract or a title deed gets a code and a label when it comes in, and its record says where it is until it goes back.</p>
|
||||
{%- endif %}
|
||||
</section>
|
||||
{%- endmacro %}
|
||||
@@ -25,6 +25,7 @@
|
||||
<span class="navh">Legal</span>
|
||||
<a href="/clients"{% if nav == "clients" %} class="on" aria-current="page"{% endif %}>Clients</a>
|
||||
<a href="/contracts"{% if nav == "contracts" %} class="on" aria-current="page"{% endif %}>Contracts</a>
|
||||
<a href="/originals"{% if nav == "originals" %} class="on" aria-current="page"{% endif %}>Originals</a>
|
||||
<a href="/lawyers"{% if nav == "lawyers" %} class="on" aria-current="page"{% endif %}>Lawyers</a>
|
||||
<a href="/journal"{% if nav == "journal" %} class="on" aria-current="page"{% endif %}>Journal</a>
|
||||
<span class="navh">Visas and stays</span>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_contract_rows.html" as cr %}
|
||||
{% import "_journal.html" as jn %}
|
||||
{% import "_originals.html" as og %}
|
||||
{% block main %}
|
||||
<div class="phead">
|
||||
<div class="crumbs"><a href="/clients">Clients</a></div>
|
||||
@@ -38,4 +39,5 @@
|
||||
{% if entries %}{{ jn.list(entries, links=true) }}{% else %}<p class="empty-inline">Nothing yet.</p>{% endif %}
|
||||
</section>
|
||||
</div>
|
||||
{{ og.card(originals, "/originals/new?client=" ~ id) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,46 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_fields.html" as fm %}
|
||||
{% import "_journal.html" as jn %}
|
||||
{% block main %}
|
||||
<div class="pagehead">
|
||||
<h1><span class="pcode mono">{{ o.code }}</span> {{ r.kind }}</h1>
|
||||
<div class="actions"><a class="btn sm" href="/originals/{{ o.id }}/label" target="_blank" rel="noopener" id="print-label">Label</a></div>
|
||||
</div>
|
||||
<p class="meta">Of <a href="{{ r.owner_href }}">{{ r.owner }}</a>. <span class="chip {% if o.state == "held" %}ok{% elif o.state == "out" %}warn{% else %}plain{% endif %}">{{ r.state_label }}</span> {{ r.place }}{% if r.chip %} <span class="chip {{ r.chip[0] }}">{{ r.chip[1] }}</span>{% endif %}</p>
|
||||
<div class="cols">
|
||||
<section class="card" id="details">
|
||||
<header><h2>The original</h2></header>
|
||||
<dl class="kv">
|
||||
<dt>What it is</dt><dd>{{ o.what }}</dd>
|
||||
<dt>Kind</dt><dd>{{ r.kind }}</dd>
|
||||
{% if r.contract_code %}<dt>Contract</dt><dd><a href="/contracts/{{ o.contract_id }}">{{ r.contract_code }}</a></dd>{% endif %}
|
||||
<dt>Received</dt><dd>{{ received }}, from {{ o.received_from }}, taken in by {{ o.received_by }}</dd>
|
||||
<dt>Belongs in</dt><dd>{{ o.location }}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section class="card" id="move">
|
||||
<header><h2>Where it is now</h2></header>
|
||||
<form method="post" action="/originals/{{ o.id }}/move" class="form" id="move-form">
|
||||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||||
{%- if errors %}
|
||||
<div class="notice warn">Correct what is marked; nothing was saved yet.</div>
|
||||
{%- endif %}
|
||||
<div class="grid">
|
||||
{{ fm.select("state", "State", form.state, states, err=errors.state, blank="Choose", req=true) }}
|
||||
<div class="when" data-shown-when="state:held">{{ fm.text("location", "Where it lies", form.location, err=errors.location, list="locations", ph="Office, safe, tray 2") }}</div>
|
||||
<div class="when" data-shown-when="state:out">{{ fm.text("holder", "With whom", form.holder, err=errors.holder, list="holders") }}</div>
|
||||
<div class="when" data-shown-when="state:out,held">{{ fm.text("due_on", "Back by, or goes back to the client by", due_on, err=errors.due_on, type="date") }}</div>
|
||||
<div class="when" data-shown-when="state:returned">{{ fm.text("returned_to", "Returned to", form.holder if form.state == "returned" else "", err=errors.holder) }}</div>
|
||||
{{ fm.text("note", "Note", form.note, err=errors.note, cls="wide", ph="Such as: filed with the extension application") }}
|
||||
</div>
|
||||
<div class="formactions"><button type="submit" class="btn pri" id="save-move">Save</button></div>
|
||||
</form>
|
||||
<datalist id="locations">{% for l in locations %}<option value="{{ l }}"></option>{% endfor %}</datalist>
|
||||
<datalist id="holders">{% for h in holders %}<option value="{{ h }}"></option>{% endfor %}</datalist>
|
||||
</section>
|
||||
</div>
|
||||
<section class="card" id="history">
|
||||
<header><h2>History</h2><a class="small" href="/journal">The journal</a></header>
|
||||
{% if history %}{{ jn.list(history) }}{% else %}<p class="empty-inline">Nothing yet.</p>{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,29 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_fields.html" as fm %}
|
||||
{% block main %}
|
||||
<div class="pagehead">
|
||||
<h1>Take in an original</h1>
|
||||
</div>
|
||||
<p class="meta">Of <a href="{{ owner_href }}">{{ owner_name }}</a>. It gets a code and a label; the journal records who took it in, from whom, and where it lies.</p>
|
||||
<form method="post" action="/originals" class="form" id="original-form">
|
||||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||||
<input type="hidden" name="owner" value="{{ owner }}">
|
||||
{%- if errors %}
|
||||
<div class="notice warn">Correct what is marked; nothing was saved yet.</div>
|
||||
{%- endif %}
|
||||
<section class="card">
|
||||
<div class="grid">
|
||||
{{ fm.select("kind", "Kind", form.kind, kinds, err=errors.kind, blank="Choose", req=true) }}
|
||||
{{ fm.text("what", "What it is", form.what, err=errors.what, req=true, cls="wide", ph="Passport C01X00T47, Germany", hint="As anyone in the office would recognize it: its number, its issuer, how many pages.") }}
|
||||
{{ fm.text("received_from", "Received from", form.received_from, err=errors.received_from, req=true, hint="Who handed it over: the client, a family member, a courier.") }}
|
||||
{{ fm.text("location", "Where it lies now", form.location, err=errors.location, req=true, list="locations", ph="Office, safe, tray 2") }}
|
||||
{{ fm.text("due_on", "Goes back to the client by", due_on, err=errors.due_on, type="date", hint="If it was agreed; the list then shows when it is due.") }}
|
||||
{%- if contracts %}
|
||||
{{ fm.select("contract", "Belongs to the contract", contract, contracts, err=errors.contract, blank="None") }}
|
||||
{%- endif %}
|
||||
</div>
|
||||
<div class="formactions"><button type="submit" class="btn pri" id="take-in">Take it in</button><a class="btn ghost" href="{{ owner_href }}">Cancel</a></div>
|
||||
</section>
|
||||
<datalist id="locations">{% for l in locations %}<option value="{{ l }}"></option>{% endfor %}</datalist>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
<title>{{ title }} · Lanna Desk</title>
|
||||
<script src="/static/theme-init.js?v={{ v }}"></script>
|
||||
<link rel="icon" href="/static/favicon.svg?v={{ v }}" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="/static/fonts.css?v={{ v }}">
|
||||
<link rel="stylesheet" href="/static/app.css?v={{ v }}">
|
||||
<script src="/static/app.js?v={{ v }}" defer></script>
|
||||
</head>
|
||||
<body class="labelpage">
|
||||
<div class="labelbar">
|
||||
<a href="/originals/{{ o.code }}">Back to the original</a>
|
||||
<button type="button" class="btn sm pri" data-print>Print the label</button>
|
||||
</div>
|
||||
<article class="plabel" id="label">
|
||||
<div class="pl-qr" aria-hidden="true">{{ qr|safe }}</div>
|
||||
<div class="pl-text">
|
||||
<div class="pl-brand">Lanna Desk · in our care</div>
|
||||
<div class="pl-code mono">{{ o.code }}</div>
|
||||
<div class="pl-title">{{ owner }}</div>
|
||||
<div class="pl-line">{% if kind %}{{ kind }} · {% endif %}{{ o.what }}</div>
|
||||
<div class="pl-line">Received {{ received }} from {{ o.received_from }}</div>
|
||||
<div class="pl-where">Belongs in: {{ o.location }}</div>
|
||||
</div>
|
||||
</article>
|
||||
<p class="labelhint">The QR code opens {{ url }} for the team, after signing in. The code alone finds it too: Originals, then Find.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_originals.html" as og %}
|
||||
{% block main %}
|
||||
<div class="pagehead">
|
||||
<h1>Originals</h1>
|
||||
</div>
|
||||
<p class="meta">What clients hand us for a while: passports for an extension, signed contracts, title deeds. Each has a code on its label and a record of where it is: held in the office, out with someone until a date, or returned. Every move goes into the journal. A new one comes in from the client's or the person's page.</p>
|
||||
<div class="toolbar">
|
||||
<div class="viewswitch" role="group" aria-label="Which originals">
|
||||
{% for t in tabs %}<a href="{{ t[0] }}"{% if t[2] %} class="on" aria-current="page"{% endif %}>{{ t[1] }}</a>{% endfor %}
|
||||
</div>
|
||||
{% if rows %}<input type="search" id="q" class="filter" placeholder="Filter by code, original or owner ( / )" aria-label="Filter the list" autocomplete="off">{% endif %}
|
||||
</div>
|
||||
<form method="get" action="/originals" class="card findpaper" id="find-original">
|
||||
<label for="original-code">Find an original by the code on its label, or scan the label</label>
|
||||
<div class="inline"><input id="original-code" name="code" placeholder="OR-2026-0001" autocomplete="off" class="mono" required><button type="submit" class="btn sm">Find</button></div>
|
||||
</form>
|
||||
{% if rows %}
|
||||
<div class="card flush">{{ og.table(rows) }}</div>
|
||||
<p class="empty-inline" data-filter-empty hidden>No original matches the filter.</p>
|
||||
{% else %}
|
||||
<div class="card">
|
||||
<h2>Nothing here</h2>
|
||||
<p>{% if show == "" %}No original is in our care. Take one in from the client's or the person's page.{% else %}None in this list. <a href="/originals?show=all">All originals</a>.{% endif %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -1,4 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_originals.html" as og %}
|
||||
{% block main %}
|
||||
{% include "_person_head.html" %}
|
||||
<div class="cols">
|
||||
@@ -103,6 +104,8 @@
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{{ og.card(originals, "/originals/new?person=" ~ p.id) }}
|
||||
|
||||
<section class="card" id="recent">
|
||||
<header><h2>Recent activity</h2><a class="btn sm ghost" href="/activity?person={{ p.id }}">All of it</a></header>
|
||||
<ul class="log">
|
||||
|
||||
Reference in new issue
Block a user