{% extends "base.html" %} {% import "_fields.html" as fm %} {% import "_agreement_text.html" as ag %} {% import "_journal.html" as jn %} {% import "_conflicts.html" as cf %} {% block main %}
Contracts / {{ client_name }}
{{ head.code }}

{{ head.title }}

{% if artist %}artist {% endif %}{{ kind_label }}·for {{ client_name }}{% if shown.status %} {{ shown.status.label }}{% endif %}

Facts

{% for it in shown.items %}
{{ it.label }}
{% if it.href %}{{ it.value }}{% else %}{{ it.value }}{% endif %}
{% endfor %}
Opened
{{ opened }}{% if head.created_by %} by {{ head.created_by }}{% endif %}

Versions

never changed once added
{% for v in versions %}
Version {{ v.version }}{% if loop.first %}newest{% endif %}{{ v.at }} · {{ v.by }}
{{ v.note }}
{% if v.body_sha %}
text {{ v.body_sha[:16] }}…
{% endif %} {% if v.file_sha %}
file {{ v.file_sha[:16] }}…
{% endif %}
{% else %}

No version yet: add the first draft below, as a text, a file or both.

{% endfor %}

Parties

each one added is checked for conflicts
{% if not live_parties %}

No other party yet: add the other side, and the check looks for it among everyone on record.

{% endif %}
Add a party
{% if check.hits %}{{ cf.block(check) }}{% endif %}
{{ fm.text("party_name", "Name", party.name, err=party_errors.party_name, req=true, cls="wide", hint="As registered, or as in the ID card or passport.") }} {{ fm.text("party_name_th", "Name in Thai", party.name_th, err=party_errors.party_name_th, cls="wide") }} {{ fm.text("party_id_no", "ID, passport or registration number", party.id_no, err=party_errors.party_id_no, hint="The check compares numbers too.") }} {{ fm.text("party_role", "Role", party.role, err=party_errors.party_role, list="roles", ph="Label, venue, landlord") }}
{% for r in roles %}{% endfor %}

Shared draft

one text for every side, with tracked changes, until all agree
{% if draft.state == "open" %}

Open for edits, revision {{ draft.revision }}, last change {{ draft.changed }}.{% if draft.editing %} {{ draft.editing }} is editing{% endif %}

{% if draft.changes %}{{ draft.changes }} open {% if draft.changes == 1 %}change{% else %}changes{% endif %} {% endif %}{% if draft.highlights %}{{ draft.highlights }} {% if draft.highlights == 1 %}highlight{% else %}highlights{% endif %} {% endif %}{{ draft.have }} of {{ draft.need }} sides agree

Open the draft
{% elif draft.state == "locked" %}

Locked Every side agreed; the text is version {{ draft.locked_version }}, which never changes. See the draft.

{% endif %} {% if draft.state != "open" %} {% if text_versions %}
{{ fm.select("draft_version", "Start a shared draft from", text_versions[0][0], text_versions, req=true, blank="Choose") }}
{% else %}

Add a version with a text to start a shared draft: the editor works on the text.

{% endif %} {% endif %} {% if draft.parties %}

The other parties' links

{% elif not live_parties %}

Add the other parties above: each gets a link to the draft, and each must agree before it locks.

{% endif %}
{% if reading %}

{% if compare %}Version {{ reading }} against version {{ before }}{% else %}Version {{ reading }}{% endif %}{% if reading_note %}: {{ reading_note }}{% endif %}

{% if before %}{% if compare %}Show the text{% else %}Compare with version {{ before }}{% endif %}{% endif %}
{% if compare %} {% if diff %}

Lines taken out are struck through in red, lines added are marked in green.

{% for l in diff %}
{% if l.op == "removed" %}{{ l.text or " " }}{% elif l.op == "added" %}{{ l.text or " " }}{% else %}{{ l.text or " " }}{% endif %}
{% endfor %}
{% else %}

The texts are too long to compare here.

{% endif %} {% else %} {{ ag.text(blocks) }} {% if reading_sha %}

SHA-256 {{ reading_sha }}

{% endif %} {% endif %}
{% endif %}

Add version {{ next_version }}

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.

{{ 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.") }}
{% if uploads %}

PDF, JPEG, PNG or WebP, up to {{ file_mb }} MB. Stored encrypted, like every document.

{% else %}

This server keeps no files: add the text only.

{% endif %} {% if errors.file %}

{{ errors.file }}

{% endif %}

Paper copies

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.

{% if papers %}
{% for p in papers %} {% endfor %}
IdPaperWhere it is
{{ p.code }} {{ p.what }}{% if p.version %}
version {{ p.version }}
{% endif %}
{{ p.state_label }} {{ p.location }}{% if p.holder %}
with {{ p.holder }}
{% endif %}
since {{ p.moved }}
Label
Move
{% endif %}

Register a paper copy

{{ fm.text("what", "What it is", "", req=true, list="whats", ph="Signed original") }}
{{ fm.text("location", "Where it is filed", "", req=true, list="locations", cls="wide", ph="Office, cabinet A, drawer 2, folder of the client") }}
{% for w in whats %}{% endfor %} {% for l in locations %}{% endfor %}

Journal of this contract

The whole journal, checked
{% if entries %}{{ jn.list(entries) }}{% else %}

Nothing yet.

{% endif %}
{% endblock %}