The legal practice: clients, lawyers, contracts, papers, the journal
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.
This commit is contained in:
1 parent
424f212b23
commit
16e4cdc73d
32 files changed
+4758
-45
No files matched your search
@@ -0,0 +1,23 @@
|
||||
{#- Contracts as a table: the Contracts page and a client's page. -#}
|
||||
{% macro table(rows, with_client=true) -%}
|
||||
<div class="card flush">
|
||||
<div class="tblwrap">
|
||||
<table class="tbl" id="contracts">
|
||||
<thead><tr><th>Contract</th>{% if with_client %}<th>Client</th>{% endif %}<th class="hs">Kind</th><th>Status</th><th class="hs">Lawyer</th><th class="hs">Versions</th></tr></thead>
|
||||
<tbody>
|
||||
{% for c in rows %}
|
||||
<tr data-q="{{ c.q }}"{% if not c.chip %} class="old"{% endif %}>
|
||||
<td><a class="strong" href="/contracts/{{ c.id }}">{{ c.title }}</a><div class="sub"><span class="mono">{{ c.code }}</span>{% if c.counterparty %} · with {{ c.counterparty }}{% endif %}</div></td>
|
||||
{% if with_client %}<td><a href="/clients/{{ c.client_id }}">{{ c.client }}</a></td>{% endif %}
|
||||
<td class="hs">{% if c.artist %}<span class="tag gold">artist</span> {% endif %}{{ c.kind_label|replace("Artist: ", "") }}</td>
|
||||
<td>{% if c.chip %}<span class="chip {{ c.chip.level }}">{{ c.chip.label }}</span>{% else %}<span class="chip plain">{{ c.status_label }}</span>{% endif %}{% if c.ends %}<div class="sub">ends {{ c.ends }}</div>{% endif %}</td>
|
||||
<td class="hs nowrap">{% if c.lawyer %}<a href="/contracts?lawyer={{ c.lawyer_id }}">{{ c.lawyer }}</a>{% else %}<span class="muted">none</span>{% endif %}</td>
|
||||
<td class="hs nowrap">{{ c.versions }}{% if c.papers %} <span class="muted small">· {{ c.papers }} on paper</span>{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="filter-empty" data-filter-empty hidden>No contract matches the filter.</p>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
@@ -0,0 +1,12 @@
|
||||
{#- Journal entries, newest first. -#}
|
||||
{% macro list(entries, links=false) -%}
|
||||
<ol class="jlist">
|
||||
{% for e in entries %}
|
||||
<li id="j-{{ e.seq }}">
|
||||
<div class="jhead"><span class="jseq mono">#{{ e.seq }}</span><b>{{ e.event }}</b>{% if links and e.contract_id %} <a class="small" href="/contracts/{{ e.contract_id }}">contract</a>{% endif %}<span class="muted small">{{ e.at }} · {{ e.actor }}</span></div>
|
||||
<p class="jdetail">{{ e.detail }}</p>
|
||||
<div class="jhash mono" title="SHA-256 of this entry and the one before: {{ e.hash }}">{{ e.short }}…</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{%- endmacro %}
|
||||
@@ -22,10 +22,17 @@
|
||||
<div class="app">
|
||||
<aside class="side">
|
||||
<nav class="nav" aria-label="Sections">
|
||||
<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="/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>
|
||||
<a href="/desk"{% if nav == "deadlines" %} class="on" aria-current="page"{% endif %}>Deadlines</a>
|
||||
<a href="/people"{% if nav == "people" %} class="on" aria-current="page"{% endif %}>People</a>
|
||||
<a href="/companies"{% if nav == "companies" %} class="on" aria-current="page"{% endif %}>Companies</a>
|
||||
<a href="/agreements"{% if nav == "agreements" %} class="on" aria-current="page"{% endif %}>Agreements</a>
|
||||
<span class="navh">Office</span>
|
||||
<a href="/activity"{% if nav == "activity" %} class="on" aria-current="page"{% endif %}>Activity</a>
|
||||
</nav>
|
||||
<div class="who">
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
{% extends "base.html" %}
|
||||
{% block main %}
|
||||
<div class="pagehead">
|
||||
<h1>{% if former %}Former clients{% else %}Clients{% endif %}</h1>
|
||||
<div class="actions"><a class="btn pri" href="/clients/new" id="new-client">+ New client</a></div>
|
||||
</div>
|
||||
<p class="meta">People and organizations, Thai or foreign, whom Lanna Desk advises or acts for: artists, labels, festivals, companies and private clients. Each has a lawyer in charge and their contracts.</p>
|
||||
{% if cards or n_former %}
|
||||
<div class="toolbar">
|
||||
{% if cards %}<input type="search" id="q" class="filter" placeholder="Filter by name, stage name or email ( / )" aria-label="Filter the list" autocomplete="off">{% endif %}
|
||||
{% if former %}<a href="/clients">Back to the current clients</a>{% elif n_former %}<a href="/clients?former=1">Former clients ({{ n_former }})</a>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if cards %}
|
||||
<ul class="rcards" id="client-cards">
|
||||
{% for c in cards %}
|
||||
<li class="rcard" data-q="{{ c.q }}">
|
||||
<a class="rc-head" href="/clients/{{ c.id }}">
|
||||
<span class="rc-mono{% if c.kind == "organization" %} org{% endif %}" aria-hidden="true">{{ c.initials }}</span>
|
||||
<span class="rc-who">
|
||||
<span class="rc-name">{{ c.name }}</span>
|
||||
<span class="rc-sub">{% if c.known_as %}<span>“{{ c.known_as }}”</span> · {% endif %}<span>{% if c.kind == "organization" %}Organization{% else %}{{ c.nationality or "Person" }}{% endif %}</span></span>
|
||||
</span>
|
||||
{% if c.open %}<span class="chip ok">{{ c.open }} open</span>{% endif %}
|
||||
</a>
|
||||
{% if c.name_th %}<p class="rc-th">{{ c.name_th }}</p>{% endif %}
|
||||
<div class="rc-label">Contracts</div>
|
||||
<dl class="rc-dates">
|
||||
<div><dt>In all</dt><dd>{{ c.contracts }}</dd></div>
|
||||
{% if c.artist %}<div><dt>Artist contracts</dt><dd>{{ c.artist }}</dd></div>{% endif %}
|
||||
<div><dt>Last entry in the journal</dt><dd>{% if c.last %}{{ c.last }}{% else %}<span class="muted">none</span>{% endif %}</dd></div>
|
||||
</dl>
|
||||
<div class="rc-foot">
|
||||
<span>{% if c.lawyer %}Lawyer: {{ c.lawyer }}{% else %}<span class="muted">No lawyer in charge</span>{% endif %}</span>
|
||||
{% if c.email %}<a href="mailto:{{ c.email }}">{{ c.email }}</a>{% elif c.phone %}<span>{{ c.phone }}</span>{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p class="filter-empty card" data-filter-empty hidden>No client matches the filter.</p>
|
||||
{% elif former %}
|
||||
<div class="card"><p class="empty-inline">No former clients.</p></div>
|
||||
{% else %}
|
||||
<div class="card">
|
||||
<h2>No clients yet</h2>
|
||||
<p>Add a person or an organization with <b>+ New client</b>, then their contracts on the client's page.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,133 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_fields.html" as fm %}
|
||||
{% import "_agreement_text.html" as ag %}
|
||||
{% import "_journal.html" as jn %}
|
||||
{% block main %}
|
||||
<div class="phead">
|
||||
<div class="crumbs"><a href="/contracts">Contracts</a> <span class="sep">/</span> <a href="/clients/{{ head.client_id }}">{{ client_name }}</a></div>
|
||||
<div class="pagehead">
|
||||
<div>
|
||||
<div class="ccode mono">{{ head.code }}</div>
|
||||
<h1>{{ head.title }}</h1>
|
||||
</div>
|
||||
<div class="actions"><a class="btn sm" href="/contracts/{{ id }}/edit" id="edit-contract">Edit the facts</a></div>
|
||||
</div>
|
||||
<p class="meta">{% if artist %}<span class="tag gold">artist</span> {% endif %}{{ kind_label }}<span class="sep">·</span>for <a href="/clients/{{ head.client_id }}">{{ client_name }}</a>{% if shown.status %} <span class="chip {{ shown.status.level }}">{{ shown.status.label }}</span>{% endif %}</p>
|
||||
</div>
|
||||
<div class="cols">
|
||||
<section class="card" id="details">
|
||||
<header><h2>Facts</h2></header>
|
||||
<dl class="kv">
|
||||
{% for it in shown.items %}
|
||||
<dt>{{ it.label }}</dt><dd class="{% if it.pre %}pre{% endif %}{% if it.mono %} mono{% endif %}">{% if it.href %}<a href="{{ it.href }}">{{ it.value }}</a>{% else %}{{ it.value }}{% endif %}</dd>
|
||||
{% endfor %}
|
||||
<dt>Opened</dt><dd>{{ opened }}{% if head.created_by %} by {{ head.created_by }}{% endif %}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section class="card" id="versions">
|
||||
<header><h2>Versions</h2><span class="muted small">never changed once added</span></header>
|
||||
{% for v in versions %}
|
||||
<div class="item{% if reading and v.version != reading %} old{% endif %}" id="version-{{ v.version }}">
|
||||
<div class="row"><b>Version {{ v.version }}</b>{% if loop.first %}<span class="tag">newest</span>{% endif %}<span class="muted small">{{ v.at }} · {{ v.by }}</span></div>
|
||||
<div>{{ v.note }}</div>
|
||||
<div class="vlinks small">
|
||||
{% if v.has_text %}<a href="/contracts/{{ id }}?v={{ v.version }}#reading">Read the text</a> <span class="muted">({{ v.chars }} characters)</span>{% endif %}
|
||||
{% if v.file %}<a href="{{ v.file }}" target="_blank" rel="noopener">{{ v.file_name }}</a> <a href="{{ v.file }}?download=1">download</a>{% endif %}
|
||||
</div>
|
||||
{% if v.body_sha %}<div class="muted small mono" title="SHA-256 of the text: {{ v.body_sha }}">text {{ v.body_sha[:16] }}…</div>{% endif %}
|
||||
{% if v.file_sha %}<div class="muted small mono" title="SHA-256 of the file: {{ v.file_sha }}">file {{ v.file_sha[:16] }}…</div>{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="empty-inline">No version yet: add the first draft below, as a text, a file or both.</p>
|
||||
{% endfor %}
|
||||
</section>
|
||||
</div>
|
||||
{% if reading %}
|
||||
<section class="card" id="reading">
|
||||
<header><h2>{% if compare %}Version {{ reading }} against version {{ before }}{% else %}Version {{ reading }}{% endif %}{% if reading_note %}: {{ reading_note }}{% endif %}</h2>
|
||||
{% if before %}{% if compare %}<a class="small" href="/contracts/{{ id }}?v={{ reading }}#reading">Show the text</a>{% else %}<a class="small" href="/contracts/{{ id }}?v={{ reading }}&compare=1#reading" id="compare">Compare with version {{ before }}</a>{% endif %}{% endif %}
|
||||
</header>
|
||||
{% if compare %}
|
||||
{% if diff %}
|
||||
<p class="hint">Lines taken out are struck through in red, lines added are marked in green.</p>
|
||||
<div class="diff">{% for l in diff %}<div class="dl {{ l.op }}">{% if l.op == "removed" %}<del>{{ l.text or " " }}</del>{% elif l.op == "added" %}<ins>{{ l.text or " " }}</ins>{% else %}{{ l.text or " " }}{% endif %}</div>{% endfor %}</div>
|
||||
{% else %}<p class="empty-inline">The texts are too long to compare here.</p>{% endif %}
|
||||
{% else %}
|
||||
{{ ag.text(blocks) }}
|
||||
{% if reading_sha %}<p class="muted small mono hashline">SHA-256 {{ reading_sha }}</p>{% endif %}
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endif %}
|
||||
<form method="post" action="/contracts/{{ id }}/versions" enctype="multipart/form-data" class="form upload" id="version-form">
|
||||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||||
<section class="card">
|
||||
<header><h2>Add version {{ next_version }}</h2></header>
|
||||
<p class="hint lead">A new draft, the other side's changes, the final text, the scan of the signed paper: each is a version. Keep the text here, attach the file (PDF or a scan), or both. A version never changes once added; its fingerprints go into the journal.</p>
|
||||
<div class="grid">
|
||||
{{ fm.text("note", "What this version is", draft_note, err=errors.note, req=true, cls="wide", ph="Such as: first draft, the label's changes, signed by both sides") }}
|
||||
{{ fm.area("body", "Text", draft_body, err=errors.body, rows=14, fcls="wide", hint="Paragraphs separated by an empty line, # before a heading, - before a list item. It starts as the last version's text; leave it as it is to add only a file.") }}
|
||||
<div class="field wide{% if errors.file %} has-err{% endif %}">
|
||||
<label for="f-file">File</label>
|
||||
{% if uploads %}<input id="f-file" name="file" type="file" accept="application/pdf,image/jpeg,image/png,image/webp">
|
||||
<p class="hint">PDF, JPEG, PNG or WebP, up to {{ file_mb }} MB. Stored encrypted, like every document.</p>{% else %}<p class="hint">This server keeps no files: add the text only.</p>{% endif %}
|
||||
{% if errors.file %}<p class="err" id="e-file">{{ errors.file }}</p>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="formactions"><button type="submit" class="btn pri" id="add-version">Add version {{ next_version }}</button></div>
|
||||
</section>
|
||||
</form>
|
||||
<h2 class="sechead" id="papers">Paper copies</h2>
|
||||
<p class="meta">Each paper gets an id to write on it, or a label to print. Its record says where it lies; every move goes into the journal.</p>
|
||||
{% if papers %}
|
||||
<div class="card flush">
|
||||
<div class="tblwrap">
|
||||
<table class="tbl" id="paper-list">
|
||||
<thead><tr><th>Id</th><th>Paper</th><th>Where it is</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for p in papers %}
|
||||
<tr id="paper-{{ p.id }}"{% if p.gone %} class="old"{% endif %}>
|
||||
<td><span class="pcode mono">{{ p.code }}</span></td>
|
||||
<td>{{ p.what }}{% if p.version %}<div class="sub">version {{ p.version }}</div>{% endif %}</td>
|
||||
<td><span class="chip {% if p.state == "filed" %}ok{% elif p.state == "out" %}warn{% else %}plain{% endif %}">{{ p.state_label }}</span> {{ p.location }}{% if p.holder %}<div class="sub">with {{ p.holder }}</div>{% endif %}<div class="sub">since {{ p.moved }}</div></td>
|
||||
<td class="pacts">
|
||||
<a class="btn sm ghost" href="/papers/{{ p.id }}/label" target="_blank" rel="noopener">Label</a>
|
||||
<details class="move"><summary class="btn sm ghost">Move</summary>
|
||||
<form method="post" action="/papers/{{ p.id }}/move" class="form mini">
|
||||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||||
<label>Where it is now<input name="location" value="{{ p.location }}" list="locations" required></label>
|
||||
<label>State<select name="state">{% for s in states %}<option value="{{ s[0] }}"{% if s[0] == p.state %} selected{% endif %}>{{ s[1] }}</option>{% endfor %}</select></label>
|
||||
<label>With whom<input name="holder" value="{{ p.holder }}" placeholder="While it is out, or whom it went to"></label>
|
||||
<label>Note<input name="note" placeholder="Such as: for the signing at the label"></label>
|
||||
<button type="submit" class="btn sm pri">Save the move</button>
|
||||
</form>
|
||||
</details>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<form method="post" action="/contracts/{{ id }}/papers" class="form" id="paper-form">
|
||||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||||
<section class="card">
|
||||
<header><h2>Register a paper copy</h2></header>
|
||||
<div class="grid">
|
||||
{{ fm.text("what", "What it is", "", req=true, list="whats", ph="Signed original") }}
|
||||
<div class="field">
|
||||
<label for="f-version">Version</label>
|
||||
<select id="f-version" name="version"><option value="">Not known</option>{% for v in versions %}<option value="{{ v.version }}"{% if loop.first %} selected{% endif %}>Version {{ v.version }}: {{ v.note }}</option>{% endfor %}</select>
|
||||
</div>
|
||||
{{ fm.text("location", "Where it is filed", "", req=true, list="locations", cls="wide", ph="Office, cabinet A, drawer 2, folder of the client") }}
|
||||
</div>
|
||||
<div class="formactions"><button type="submit" class="btn" id="add-paper">Register and give it an id</button></div>
|
||||
</section>
|
||||
</form>
|
||||
<datalist id="whats">{% for w in whats %}<option value="{{ w }}"></option>{% endfor %}</datalist>
|
||||
<datalist id="locations">{% for l in locations %}<option value="{{ l }}"></option>{% endfor %}</datalist>
|
||||
<section class="card" id="contract-journal">
|
||||
<header><h2>Journal of this contract</h2><a class="small" href="/journal">The whole journal, checked</a></header>
|
||||
{% if entries %}{{ jn.list(entries) }}{% else %}<p class="empty-inline">Nothing yet.</p>{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_contract_rows.html" as cr %}
|
||||
{% block main %}
|
||||
<div class="pagehead">
|
||||
<h1>{% if mine %}My contracts{% elif lawyer_name %}Contracts of {{ lawyer_name }}{% else %}Contracts{% endif %}</h1>
|
||||
<div class="actions"><a class="btn pri" href="/contracts/new" id="new-contract">+ New contract</a></div>
|
||||
</div>
|
||||
<p class="meta">General contracts and the artists' contracts, each with its versions, which never change, and its paper copies with the place where they lie.{% if lawyer_name or mine %} <a href="/contracts">All lawyers</a>{% elif me %} <a href="/contracts?mine=1">My contracts</a>{% endif %}</p>
|
||||
<div class="toolbar">
|
||||
<div class="viewswitch" role="group" aria-label="Kind of contract">
|
||||
{% 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, title, client or other party ( / )" aria-label="Filter the list" autocomplete="off">{% endif %}
|
||||
<a href="{{ over_href }}">{% if all %}Only those under way{% else %}Also those that are over{% endif %}</a>
|
||||
</div>
|
||||
<form method="get" action="/papers" class="card findpaper" id="find-paper">
|
||||
<label for="paper-code">Find a paper copy by the id on its label</label>
|
||||
<div class="inline"><input id="paper-code" name="code" placeholder="LD-2026-0001-P1" autocomplete="off" class="mono" required><button type="submit" class="btn sm">Find</button></div>
|
||||
</form>
|
||||
{% if rows %}
|
||||
{{ cr.table(rows) }}
|
||||
{% else %}
|
||||
<div class="card">
|
||||
<h2>No contracts here</h2>
|
||||
<p>Add one with <b>+ New contract</b>, or from a client's page.{% if not all %} Contracts that are over show with <a href="{{ over_href }}">Also those that are over</a>.{% endif %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_journal.html" as jn %}
|
||||
{% block main %}
|
||||
<div class="pagehead">
|
||||
<h1>Journal</h1>
|
||||
<div class="actions"><a class="btn sm" href="/journal.csv" id="journal-csv">Download as CSV</a></div>
|
||||
</div>
|
||||
<p class="meta">Every change to the lawyers, clients, contracts, versions and paper copies, in order. Each entry carries the SHA-256 of the entry before it, so an entry changed or removed afterwards breaks the chain at that place. The database refuses to change or delete entries.</p>
|
||||
{% if whole %}
|
||||
<div class="notice ok" role="status" id="journal-check"><b>The journal is whole.</b> {{ count }} entries{% if head_at %}, the last on {{ head_at }}{% endif %}; every version's text and file match their fingerprints. The last hash is <span class="mono hashline">{{ head }}</span>. Written down or kept in the CSV, it shows later that nothing before it changed.</div>
|
||||
{% else %}
|
||||
<div class="notice bad" role="alert" id="journal-check"><b>The journal is broken.</b>
|
||||
<ul>{% for p in problems %}<li>{{ p }}</li>{% endfor %}</ul>
|
||||
Tell the team's lead: something was changed outside the app.</div>
|
||||
{% endif %}
|
||||
{% if filtered %}<p><a href="/journal">The whole journal</a></p>{% endif %}
|
||||
<section class="card">
|
||||
{% if entries %}{{ jn.list(entries, links=true) }}{% else %}<p class="empty-inline">No entries yet.</p>{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,31 @@
|
||||
{% extends "base.html" %}
|
||||
{% block main %}
|
||||
<div class="pagehead">
|
||||
<h1>Lawyers</h1>
|
||||
<div class="actions"><a class="btn pri" href="/lawyers/new" id="new-lawyer">+ New lawyer</a></div>
|
||||
</div>
|
||||
<p class="meta">The team. Each client and each contract has a lawyer in charge; a lawyer's name leads to their contracts.</p>
|
||||
{% if rows %}
|
||||
<div class="card flush">
|
||||
<div class="tblwrap">
|
||||
<table class="tbl" id="lawyers">
|
||||
<thead><tr><th>Lawyer</th><th class="hs">License</th><th>Clients</th><th>Contracts under way</th><th class="hs">Contact</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for l in rows %}
|
||||
<tr{% if l.status == "left" %} class="old"{% endif %}>
|
||||
<td><a class="strong" href="/contracts?lawyer={{ l.id }}">{{ l.name }}</a>{% if l.name_th %}<div class="sub">{{ l.name_th }}</div>{% endif %}{% if l.status == "left" %} <span class="chip plain">left</span>{% endif %}</td>
|
||||
<td class="hs mono">{{ l.license_no }}</td>
|
||||
<td>{{ l.clients }}</td>
|
||||
<td>{{ l.open }}</td>
|
||||
<td class="hs">{% if l.email %}<a href="mailto:{{ l.email }}">{{ l.email }}</a>{% endif %}{% if l.phone %}<div class="sub">{{ l.phone }}</div>{% endif %}</td>
|
||||
<td><a class="btn sm ghost" href="/lawyers/{{ l.id }}/edit">Edit</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card"><h2>No lawyers yet</h2><p>Add the team's lawyers with <b>+ New lawyer</b>; clients and contracts then name the lawyer in charge.</p></div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,41 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_contract_rows.html" as cr %}
|
||||
{% import "_journal.html" as jn %}
|
||||
{% block main %}
|
||||
<div class="phead">
|
||||
<div class="crumbs"><a href="/clients">Clients</a></div>
|
||||
<div class="pagehead">
|
||||
<div class="titled">
|
||||
<span class="rc-mono big{% if kind == "organization" %} org{% endif %}" aria-hidden="true">{{ initials }}</span>
|
||||
<div>
|
||||
<h1>{{ name }}</h1>
|
||||
<p class="meta">{% if name_th %}{{ name_th }}{% endif %}{% if known_as %}{% if name_th %}<span class="sep">·</span>{% endif %}known as “{{ known_as }}”{% endif %}{% if former %} <span class="chip plain">former client</span>{% endif %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<a class="btn sm" href="/clients/{{ id }}/edit" id="edit-client">Edit</a>
|
||||
<a class="btn sm pri" href="/contracts/new?client={{ id }}" id="new-contract">+ New contract</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="sechead first">Contracts</h2>
|
||||
{% if contracts %}
|
||||
{{ cr.table(contracts, with_client=false) }}
|
||||
{% else %}
|
||||
<div class="card"><p class="empty-inline">No contracts yet. <a href="/contracts/new?client={{ id }}">Add the first</a>.</p></div>
|
||||
{% endif %}
|
||||
<div class="cols">
|
||||
<section class="card" id="details">
|
||||
<header><h2>Details</h2></header>
|
||||
<dl class="kv">
|
||||
{% for it in shown.items %}
|
||||
<dt>{{ it.label }}</dt><dd class="{% if it.pre %}pre{% endif %}{% if it.mono %} mono{% endif %}">{% if it.href %}<a href="{{ it.href }}">{{ it.value }}</a>{% else %}{{ it.value }}{% endif %}</dd>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
</section>
|
||||
<section class="card" id="client-journal">
|
||||
<header><h2>Journal</h2><a class="small" href="/journal?client={{ id }}">All entries</a></header>
|
||||
{% if entries %}{{ jn.list(entries, links=true) }}{% else %}<p class="empty-inline">Nothing yet.</p>{% endif %}
|
||||
</section>
|
||||
</div>
|
||||
{% 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="/contracts/{{ head.id }}#paper-{{ p.id }}">Back to the contract</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</div>
|
||||
<div class="pl-code mono">{{ p.code }}</div>
|
||||
<div class="pl-title">{{ head.title }}</div>
|
||||
<div class="pl-line">{{ client }} · {{ p.what }}{% if paper_version %} · version {{ paper_version }}{% endif %}</div>
|
||||
{% if fingerprint %}<div class="pl-line mono">SHA-256 {{ fingerprint }}…</div>{% endif %}
|
||||
<div class="pl-where">Belongs in: {{ p.location }}</div>
|
||||
</div>
|
||||
</article>
|
||||
<p class="labelhint">The QR code opens {{ url }} for the team, after signing in. The id alone finds the paper too: Contracts, then Find a paper copy.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,7 +4,7 @@
|
||||
{% if p %}
|
||||
{% include "_person_head.html" %}
|
||||
{% else %}
|
||||
<div class="crumbs"><a href="/companies">Companies</a></div>
|
||||
<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">
|
||||
|
||||
Reference in new issue
Block a user