One shared draft a contract, locked when all agree (phase 13, step 2)
Until a contract is set, it is one open text for every side, as Alex asked: our team edits it in the app, each other party on its link. Edits are tracked changes in the author's color (crossed out, added, highlighted with a comment) until the other side accepts or rejects them. When no change or highlight is open and Lanna Desk and every party agree, the text becomes a contract version that never changes, and the draft locks. - One side edits at a time: Edit takes the draft for 45 seconds, which every save renews; Done editing, leaving the page or silence gives it up. The editor saves 0.7 s after the last keystroke; the other pages ask for news every 3 s, so each side sees edits, who edits, agreements and the lock without reloading. - A save may only touch the saver's own marks (reviews::check_save); accept, reject (or withdraw) and resolve are their own steps, journaled with the text concerned. A later change voids the agreements given. - Notices: the other side's edits (one a half hour of editing), settled changes, agreements, the lock. The bell in the top bar counts the unseen (every 15 s); Notices lists them and marks them seen. - The draft as a diff: the standing text against every open change taken. - Migration 0015: contract_drafts, draft_saves and draft_agreements (both kept unchanged by a trigger), notices, notice_reads; drops step 1's review_rounds (only the demo held any). The review links stay as each party's way in. - Property tests for the save rule and settling, the fuzz text target runs the parser, the save check and settling; integration tests play both sides to the lock. The demo's recording agreement has an open draft with the label's changes and a notice. - PLAN: phase 13 rewritten; step 3 is the PDF and signing.
This commit is contained in:
1 parent
a4155548b8
commit
3dd9ab60e8
36 files changed
+3812
-2161
No files matched your search
@@ -0,0 +1,40 @@
|
||||
{#- The shared draft's editor, on our page and on a party's link; the
|
||||
script draws it from the data and keeps it up to date. -#}
|
||||
<div class="drwrap" id="draft-editor" data-draft>
|
||||
<div class="drbar" id="dr-bar">
|
||||
<span class="drstate" id="dr-state" aria-live="polite">Loading the draft…</span>
|
||||
<span class="drbtns">
|
||||
<button type="button" class="btn sm pri" id="dr-edit" hidden>Edit</button>
|
||||
<button type="button" class="btn sm" id="dr-done" hidden>Done editing</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="rvtools" id="dr-tools" role="toolbar" aria-label="Marking tools" aria-controls="dr-text" hidden>
|
||||
<button type="button" class="btn sm" data-rv="del" title="Cross out the selection (Delete)"><del>Cross out</del></button>
|
||||
<button type="button" class="btn sm" data-rv="mark" title="Highlight the selection"><mark>Highlight</mark></button>
|
||||
<input type="text" id="dr-comment" class="rvcomment" placeholder="Comment for the highlight" aria-label="Comment for the highlight" maxlength="500" autocomplete="off">
|
||||
<button type="button" class="btn sm ghost" data-rv="restore" title="Take your own marks back from the selection">Restore</button>
|
||||
<button type="button" class="btn sm ghost" data-rv="undo" title="Undo (Ctrl+Z)">Undo</button>
|
||||
</div>
|
||||
<div class="drcols">
|
||||
<div class="drmain">
|
||||
<div class="rvtext rvedit dr" id="dr-text" spellcheck="true" role="textbox" aria-multiline="true" aria-label="The contract text"></div>
|
||||
<p class="muted small" id="dr-note" aria-live="polite"></p>
|
||||
<ul class="drlegend" id="dr-legend" aria-label="Whose marks are which color"></ul>
|
||||
</div>
|
||||
<aside class="drside">
|
||||
<section id="dr-changes-box"><h3 class="minihead">Open changes <span class="muted" id="dr-changes-n"></span></h3><ol class="drlist" id="dr-changes"></ol></section>
|
||||
<section id="dr-marks-box"><h3 class="minihead">Highlights <span class="muted" id="dr-marks-n"></span></h3><ol class="drlist" id="dr-marks"></ol></section>
|
||||
<section id="dr-agree-box"><h3 class="minihead">Agreement</h3>
|
||||
<ul class="drsides" id="dr-sides"></ul>
|
||||
<div id="dr-agree-form">
|
||||
{% if not staff %}<label class="drname">Your name <input type="text" id="dr-name" autocomplete="name" maxlength="200"></label>{% endif %}
|
||||
<button type="button" class="btn pri" id="dr-agree">Agree to this text</button>
|
||||
<p class="muted small" id="dr-agree-note"></p>
|
||||
</div>
|
||||
</section>
|
||||
</aside>
|
||||
</div>
|
||||
<noscript><p class="notice warn">The draft needs JavaScript in the browser.</p></noscript>
|
||||
<script type="application/json" id="dr-data">{{ data|safe }}</script>
|
||||
</div>
|
||||
<script src="/static/draft-editor.js?v={{ v }}" defer></script>
|
||||
@@ -1,5 +0,0 @@
|
||||
{#- A marked-up text: unchanged, added (green), crossed out (red), highlighted
|
||||
(yellow, its comment on hover and after it); each change numbered. -#}
|
||||
{% macro marked(shown, id="rv-marked") -%}
|
||||
<div class="rvtext" id="{{ id }}">{% for p in shown %}{% if p.n %}<sup class="rvn" aria-label="change {{ p.n }}">{{ p.n }}</sup>{% endif %}{% if p.op == "ins" %}<ins>{{ p.text }}</ins>{% elif p.op == "del" %}<del>{{ p.text }}</del>{% elif p.op == "mark" %}<mark{% if p.comment %} title="{{ p.comment }}"{% endif %}>{{ p.text }}</mark>{% if p.comment %}<span class="rvc">{{ p.comment }}</span>{% endif %}{% else %}{{ p.text }}{% endif %}{% endfor %}</div>
|
||||
{%- endmacro %}
|
||||
+4
-1
@@ -17,7 +17,10 @@
|
||||
{% include "_mark.html" %}
|
||||
<span class="nm">Lanna Desk</span><span class="sub">Back office</span>
|
||||
</a>
|
||||
<button type="button" class="ib" id="themeBtn" aria-label="Switch between light and dark" title="Switch between light and dark">◐</button>
|
||||
<span class="topacts">
|
||||
<a class="ib bell" href="/notices" id="bell" aria-label="Notices" title="Notices"><svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path fill="currentColor" d="M12 22a2.5 2.5 0 0 0 2.45-2h-4.9A2.5 2.5 0 0 0 12 22Zm7-6V11a7 7 0 0 0-5.5-6.84V3.5a1.5 1.5 0 0 0-3 0v.66A7 7 0 0 0 5 11v5l-2 2v1h18v-1l-2-2Z"/></svg><span class="bellcount" id="bell-count" hidden></span></a>
|
||||
<button type="button" class="ib" id="themeBtn" aria-label="Switch between light and dark" title="Switch between light and dark">◐</button>
|
||||
</span>
|
||||
</header>
|
||||
<div class="app">
|
||||
<aside class="side">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<button type="button" class="ib" id="themeBtn" aria-label="Switch between light and dark" title="Switch between light and dark">◐</button>
|
||||
</header>
|
||||
<main class="cmain" id="main">
|
||||
{% if demo %}<p class="demo-note" id="demo-note"><b>Demo.</b> This is the page a client sees on their link, with invented details. It starts over every night; uploads are off.</p>{% endif %}
|
||||
{% if demo %}<p class="demo-note" id="demo-note"><b>Demo.</b> {{ demo_text or "This is the page a client sees on their link, with invented details." }} It starts over every night; uploads are off.</p>{% endif %}
|
||||
{% block main %}{% endblock %}
|
||||
{% if until %}<footer class="ft">This link works until {{ until }}. What you save here goes to Lanna Desk, which looks after your visa and stay in Thailand; nobody else sees it.</footer>{% endif %}
|
||||
</main>
|
||||
|
||||
+29
-31
@@ -74,37 +74,35 @@
|
||||
</details>
|
||||
<datalist id="roles">{% for r in roles %}<option value="{{ r }}"></option>{% endfor %}</datalist>
|
||||
</section>
|
||||
<section class="card" id="reviews">
|
||||
<header><h2>Review by the other side</h2><span class="muted small">a link where a party marks up a version and sends it back</span></header>
|
||||
{% for l in reviews %}
|
||||
<div class="item{% if not l.open %} old{% endif %}" id="review-link-{{ l.id }}">
|
||||
<div class="row"><b>{{ l.party }}</b><span class="muted small">{{ l.state }}</span>
|
||||
{% if l.open %}<form method="post" action="/contracts/{{ id }}/review-links/{{ l.id }}/close" class="inline-form" data-confirm="Close {{ l.party }}'s review link? It stops working; sending again makes a new one."><input type="hidden" name="csrf" value="{{ csrf }}"><button type="submit" class="btn sm ghost">Close the link</button></form>{% endif %}
|
||||
</div>
|
||||
<ul class="rvrounds">
|
||||
{% for r in l.rounds %}
|
||||
<li id="round-{{ r.id }}">Version {{ r.version }} sent {{ r.sent }} by {{ r.by }}:
|
||||
{% if r.replied %}<a href="/contracts/{{ id }}/reviews/{{ r.id }}">sent back {{ r.replied }}</a>, <span class="chip {% if r.changes %}warn{% else %}ok{% endif %}">{{ r.changes }} {% if r.changes == 1 %}change{% else %}changes{% endif %}</span>{% if r.highlights %} <span class="chip plain">{{ r.highlights }} {% if r.highlights == 1 %}highlight{% else %}highlights{% endif %}</span>{% endif %}
|
||||
{% elif loop.first %}<span class="muted">waiting for them</span>{% else %}<span class="muted">not sent back; a newer version followed</span>{% endif %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if live_parties and text_versions %}
|
||||
<details class="addparty"{% if not reviews %} open{% endif %}>
|
||||
<summary class="btn sm" id="send-review-open">Send a version for review</summary>
|
||||
<form method="post" action="/contracts/{{ id }}/reviews" class="form" id="send-form">
|
||||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||||
<div class="grid">
|
||||
{{ fm.select("review_party", "To", "", review_parties, req=true, blank="Choose the party") }}
|
||||
{{ fm.select("review_version", "Version", text_versions[0][0], text_versions, req=true, blank="Choose") }}
|
||||
{{ fm.area("review_message", "Message to them", "", rows=3, fcls="wide", hint="Optional: what to look at, by when.") }}
|
||||
</div>
|
||||
<div class="formactions"><button type="submit" class="btn pri" id="send-review">Send</button></div>
|
||||
</form>
|
||||
</details>
|
||||
{% elif not live_parties %}<p class="empty-inline">Add the other party above to send them a version to review.</p>
|
||||
{% else %}<p class="empty-inline">Add a version with a text to send it for review: the editor works on the text.</p>{% endif %}
|
||||
<section class="card" id="draft">
|
||||
<header><h2>Shared draft</h2><span class="muted small">one text for every side, with tracked changes, until all agree</span></header>
|
||||
{% if draft.state == "open" %}
|
||||
<p><b>Open for edits</b>, revision {{ draft.revision }}, last change {{ draft.changed }}.{% if draft.editing %} <span class="chip warn">{{ draft.editing }} is editing</span>{% endif %}</p>
|
||||
<p>{% if draft.changes %}<span class="chip warn">{{ draft.changes }} open {% if draft.changes == 1 %}change{% else %}changes{% endif %}</span> {% endif %}{% if draft.highlights %}<span class="chip plain">{{ draft.highlights }} {% if draft.highlights == 1 %}highlight{% else %}highlights{% endif %}</span> {% endif %}<span class="chip {% if draft.have == draft.need %}ok{% else %}plain{% endif %}">{{ draft.have }} of {{ draft.need }} sides agree</span></p>
|
||||
<div class="formactions"><a class="btn pri" href="/contracts/{{ id }}/draft" id="open-draft">Open the draft</a></div>
|
||||
{% elif draft.state == "locked" %}
|
||||
<p><span class="chip ok">Locked</span> Every side agreed; the text is <a href="/contracts/{{ id }}?v={{ draft.locked_version }}#reading">version {{ draft.locked_version }}</a>, which never changes. <a href="/contracts/{{ id }}/draft">See the draft</a>.</p>
|
||||
{% endif %}
|
||||
{% if draft.state != "open" %}
|
||||
{% if text_versions %}
|
||||
<form method="post" action="/contracts/{{ id }}/draft/open" class="form inline-form" id="draft-open-form">
|
||||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||||
<div class="grid">{{ fm.select("draft_version", "Start a shared draft from", text_versions[0][0], text_versions, req=true, blank="Choose") }}</div>
|
||||
<div class="formactions"><button type="submit" class="btn pri" id="draft-open">{% if draft.state == "locked" %}Start a new draft{% else %}Start the shared draft{% endif %}</button></div>
|
||||
</form>
|
||||
{% else %}<p class="empty-inline">Add a version with a text to start a shared draft: the editor works on the text.</p>{% endif %}
|
||||
{% endif %}
|
||||
{% if draft.parties %}
|
||||
<h3 class="minihead">The other parties' links</h3>
|
||||
<ul class="rvrounds">
|
||||
{% for p in draft.parties %}
|
||||
<li id="party-link-{{ p.id }}"><b>{{ p.name }}</b>: {{ p.link_state }}
|
||||
<form method="post" action="/contracts/{{ id }}/invites" class="inline-form"><input type="hidden" name="csrf" value="{{ csrf }}"><input type="hidden" name="party" value="{{ p.id }}"><button type="submit" class="btn sm ghost">{% if p.link %}New link{% else %}Make the link{% endif %}</button></form>
|
||||
{% if p.link %}<form method="post" action="/contracts/{{ id }}/review-links/{{ p.link }}/close" class="inline-form" data-confirm="Close {{ p.name }}'s link? It stops working at once."><input type="hidden" name="csrf" value="{{ csrf }}"><button type="submit" class="btn sm ghost">Close the link</button></form>{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% elif not live_parties %}<p class="empty-inline">Add the other parties above: each gets a link to the draft, and each must agree before it locks.</p>{% endif %}
|
||||
</section>
|
||||
{% if reading %}
|
||||
<section class="card" id="reading">
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends "base.html" %}
|
||||
{% block main %}
|
||||
<div class="phead">
|
||||
<div class="crumbs"><a href="/contracts">Contracts</a> <span class="sep">/</span> <a href="/contracts/{{ id }}#draft">{{ head.code }}</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 }}/draft/diff" id="draft-diff">As a diff</a></div>
|
||||
</div>
|
||||
<p class="meta">The shared draft for {{ client }}. Every side edits the same text; changes stay marked in their author's color until the other side accepts or rejects them. When no change is open and every side agrees, the text locks as a contract version.</p>
|
||||
</div>
|
||||
{% include "_draft_editor.html" %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,19 @@
|
||||
{% extends "base.html" %}
|
||||
{% block main %}
|
||||
<div class="phead">
|
||||
<div class="crumbs"><a href="/contracts">Contracts</a> <span class="sep">/</span> <a href="/contracts/{{ id }}#draft">{{ head.code }}</a> <span class="sep">/</span> <a href="/contracts/{{ id }}/draft">Shared draft</a></div>
|
||||
<div class="pagehead"><h1>The draft as a diff</h1></div>
|
||||
<p class="meta">The text as it stands against the text with every open change taken, at revision {{ rev }}.</p>
|
||||
</div>
|
||||
{% if changes %}
|
||||
<section class="card" id="changes">
|
||||
<header><h2>Open changes</h2></header>
|
||||
<ol class="rvchanges">{% for c in changes %}<li id="change-{{ c.n }}"><span class="rvn">{{ c.n }}</span> <span class="muted">{{ c.who }}:</span> {% if c.removed %}<del>{{ c.removed }}</del>{% endif %}{% if c.added %}<ins>{{ c.added }}</ins>{% endif %}</li>{% endfor %}</ol>
|
||||
</section>
|
||||
{% endif %}
|
||||
<section class="card" id="diff">
|
||||
{% if git %}
|
||||
<div class="gitdiff">{% for l in git %}{% if l.op == "hunk" %}<div class="gl hunk"><span class="gn"></span><span class="gn"></span><span class="gt">@@ line {{ l.old or l.new }} @@</span></div>{% else %}<div class="gl {{ l.op }}"><span class="gn">{{ l.old or "" }}</span><span class="gn">{{ l.new or "" }}</span><span class="gt"><span class="gs" aria-hidden="true">{% if l.op == "removed" %}-{% elif l.op == "added" %}+{% else %} {% endif %}</span>{% for s in l.segs %}{% if s.hl %}<b>{{ s.text }}</b>{% else %}{{ s.text }}{% endif %}{% endfor %}</span></div>{% endif %}{% else %}<p class="empty-inline">No open change: the text stands as it is.</p>{% endfor %}</div>
|
||||
{% else %}<p class="empty-inline">The text is too long to compare here.</p>{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,17 @@
|
||||
{% extends "base.html" %}
|
||||
{% block main %}
|
||||
<div class="phead">
|
||||
<div class="crumbs"><a href="/contracts">Contracts</a> <span class="sep">/</span> <a href="/contracts/{{ id }}#draft">{{ head.code }}</a></div>
|
||||
<div class="pagehead"><h1>The link for {{ party }}</h1></div>
|
||||
</div>
|
||||
<section class="card linkcard" id="invite-made">
|
||||
<p>Give this link to {{ party }}: by email or chat, or let them scan the code. On it they see the shared draft, edit it with tracked changes, and agree to it. It works until {{ until }}, and longer while they use it.</p>
|
||||
<div class="linkrow">
|
||||
<input type="text" readonly value="{{ url }}" id="link-url" aria-label="The link" data-select-all>
|
||||
<button type="button" class="btn" data-copy="#link-url">Copy</button>
|
||||
</div>
|
||||
<div class="qr" aria-label="The link as a QR code">{{ qr|safe }}</div>
|
||||
<p class="notice warn">The link is shown only now: the app keeps only a fingerprint of it. Copy it before you leave this page; otherwise make a new one, which closes this one.</p>
|
||||
<div class="formactions"><a class="btn pri" href="/contracts/{{ id }}#draft">Done</a></div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,16 @@
|
||||
{% extends "base.html" %}
|
||||
{% block main %}
|
||||
<div class="pagehead"><h1>Notices</h1></div>
|
||||
<p class="meta">What the other sides did on the shared drafts, and what colleagues did that you should know. The bell counts what you have not seen yet; this page marks it seen.</p>
|
||||
{% if rows %}
|
||||
<div class="card flush">
|
||||
<ul class="notices" id="notice-list">
|
||||
{% for n in rows %}
|
||||
<li class="{% if n.new %}new{% endif %} k-{{ n.kind }}"><a href="{{ n.href }}">{{ n.text }}</a><span class="muted small">{{ n.at }}</span>{% if n.new %} <span class="chip warn">new</span>{% endif %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card"><p class="empty-inline">Nothing yet. When another party edits or agrees to a shared draft, it shows here and on the bell.</p></div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends "client_base.html" %}
|
||||
{% block main %}
|
||||
<section class="card" id="draft-head">
|
||||
<div class="ccode mono">{{ head.code }}</div>
|
||||
<h1>{{ head.title }}</h1>
|
||||
<p>The draft Lanna Desk shares with {{ me }}, for {{ client }}. Press Edit to change it: what you delete stays crossed out and what you type is marked, in your color, until the other side accepts or rejects it. Highlight a passage to discuss it. When no change is open and every side agrees, the text is locked and becomes the contract to sign.</p>
|
||||
</section>
|
||||
<section class="card">
|
||||
{% include "_draft_editor.html" %}
|
||||
</section>
|
||||
<footer class="ft">Only Lanna Desk's team, who act for {{ client }}, and the other parties to this contract see this draft.</footer>
|
||||
{% endblock %}
|
||||
@@ -1,57 +0,0 @@
|
||||
{% extends "client_base.html" %}
|
||||
{% import "_review_marks.html" as rm %}
|
||||
{% import "_fields.html" as fm %}
|
||||
{% block main %}
|
||||
<section class="card" id="review-head">
|
||||
<div class="ccode mono">{{ head.code }}</div>
|
||||
<h1>{{ head.title }}</h1>
|
||||
<p>Version {{ round.version }}, sent by Lanna Desk for {{ client }} to {{ party }} on {{ round.sent }}.</p>
|
||||
{% if round.message %}<p class="pre rvmsg">{{ round.message }}</p>{% endif %}
|
||||
</section>
|
||||
{% if replied %}
|
||||
<section class="card" id="sent-back">
|
||||
<h2>Thank you</h2>
|
||||
<p>You sent this version back on {{ round.replied }} with {{ round.changes }} {% if round.changes == 1 %}change{% else %}changes{% endif %} and {{ round.highlights }} {% if round.highlights == 1 %}highlight{% else %}highlights{% endif %}. Lanna Desk reads it and answers here with the next version. This is what you sent:</p>
|
||||
{{ rm.marked(shown) }}
|
||||
</section>
|
||||
{% else %}
|
||||
<form method="post" action="{{ action }}" class="form" id="review-form">
|
||||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||||
<input type="hidden" name="round" value="{{ round_id }}">
|
||||
<input type="hidden" name="pieces" id="rv-pieces" value="">
|
||||
<section class="card" id="editor-card">
|
||||
<header><h2>Your changes</h2><span class="muted small" id="rv-count" aria-live="polite"></span></header>
|
||||
<p class="hint">Edit the text as you would any text. What you delete stays in place, crossed out; what you type is marked as added; so Lanna Desk sees every change. To mark a passage for discussion, select it and press Highlight, with a comment if you like. Restore takes your marks back from what you select.</p>
|
||||
{% if errors.pieces %}<div class="notice warn">{{ errors.pieces }}</div>{% endif %}
|
||||
<div class="rvtools" role="toolbar" aria-label="Marking tools" aria-controls="rv-editor">
|
||||
<button type="button" class="btn sm" data-rv="del" title="Cross out the selection (Delete)"><del>Cross out</del></button>
|
||||
<button type="button" class="btn sm" data-rv="mark" title="Highlight the selection"><mark>Highlight</mark></button>
|
||||
<input type="text" id="rv-comment" class="rvcomment" placeholder="Comment for the highlight" aria-label="Comment for the highlight" maxlength="500" autocomplete="off">
|
||||
<button type="button" class="btn sm ghost" data-rv="restore" title="Take your marks back from the selection">Restore</button>
|
||||
<button type="button" class="btn sm ghost" data-rv="undo" title="Undo (Ctrl+Z)">Undo</button>
|
||||
</div>
|
||||
<div class="rvtext rvedit" id="rv-editor" contenteditable="true" spellcheck="true" role="textbox" aria-multiline="true" aria-label="The contract text, to mark up" data-rv-editor></div>
|
||||
<p class="muted small" id="rv-note" aria-live="polite"></p>
|
||||
<noscript><p class="notice warn">The editor needs JavaScript. Without it, write your changes in the message below.</p></noscript>
|
||||
<script type="application/json" id="rv-data">{{ pieces|safe }}</script>
|
||||
</section>
|
||||
<section class="card" id="send-back">
|
||||
<header><h2>Send it back</h2></header>
|
||||
<div class="grid">
|
||||
{{ fm.text("name", "Your name", name, err=errors.name, req=true, auto="name", hint="Who at " ~ party ~ " sends this.") }}
|
||||
{{ fm.area("message", "Message to Lanna Desk", reply_message, err=errors.message, rows=4, fcls="wide", hint="Optional: what your changes are about.") }}
|
||||
</div>
|
||||
<div class="formactions"><button type="submit" class="btn pri" id="send-review">Send it back</button></div>
|
||||
<p class="muted small">You can send this version back once. Lanna Desk then answers with its next version on this same link.</p>
|
||||
</section>
|
||||
</form>
|
||||
<script src="/static/review-editor.js?v={{ v }}" defer></script>
|
||||
{% endif %}
|
||||
{% if earlier %}
|
||||
<section class="card" id="earlier">
|
||||
<header><h2>Earlier versions</h2></header>
|
||||
<ul class="rvrounds">{% for r in earlier %}<li>Version {{ r.version }}, sent {{ r.sent }}{% if r.replied %}; you sent it back {{ r.replied }} with {{ r.changes }} {% if r.changes == 1 %}change{% else %}changes{% endif %}{% else %}; not sent back{% endif %}</li>{% endfor %}</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
<footer class="ft">This link works until {{ link_until }}. Only Lanna Desk's team, who act for {{ client }}, see what you send here.</footer>
|
||||
{% endblock %}
|
||||
@@ -1,53 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "_review_marks.html" as rm %}
|
||||
{% block main %}
|
||||
<div class="phead">
|
||||
<div class="crumbs"><a href="/contracts">Contracts</a> <span class="sep">/</span> <a href="/contracts/{{ id }}#reviews">{{ head.code }}</a></div>
|
||||
<div class="pagehead"><h1>{{ party }}'s review of version {{ review_version }}</h1></div>
|
||||
<p class="meta">Sent {{ round.sent }} by {{ round.by }}.{% if replied %} Sent back {{ round.replied }} by {{ round.reply_name }}: {{ round.changes }} {% if round.changes == 1 %}change{% else %}changes{% endif %}, {{ round.highlights }} {% if round.highlights == 1 %}highlight{% else %}highlights{% endif %}.{% endif %}</p>
|
||||
</div>
|
||||
{% if not replied %}
|
||||
<section class="card"><h2>Nothing back yet</h2><p>{{ party }} has not sent this version back yet.</p></section>
|
||||
{% else %}
|
||||
{% if reply_message %}
|
||||
<section class="card" id="reply-message">
|
||||
<header><h2>Their message</h2></header>
|
||||
<p class="pre">{{ reply_message }}</p>
|
||||
</section>
|
||||
{% endif %}
|
||||
<section class="card" id="take">
|
||||
<header><h2>The changes</h2></header>
|
||||
{% if changes %}
|
||||
<form method="post" action="/contracts/{{ id }}/reviews/{{ round.id }}/take" id="take-form">
|
||||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||||
<p class="hint">Tick the changes to take. The contract page then opens with the version form filled with version {{ review_version }} and those changes, to finish and add as the next version.</p>
|
||||
<ol class="rvchanges">
|
||||
{% for c in changes %}
|
||||
<li id="change-{{ c.n }}"><label class="check"><input type="checkbox" name="take" value="{{ c.n }}" checked><span class="rvn">{{ c.n }}</span><span class="rvchange"><span class="muted">{{ c.before }}</span>{% if c.removed %}<del>{{ c.removed }}</del>{% endif %}{% if c.added %}<ins>{{ c.added }}</ins>{% endif %}<span class="muted">{{ c.after }}</span></span></label></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
<div class="formactions"><button type="submit" class="btn pri" id="take-changes">Take the ticked changes</button></div>
|
||||
</form>
|
||||
{% else %}
|
||||
<p class="empty-inline">They changed nothing{% if highlights %}; they highlighted what is listed below{% endif %}.</p>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% if highlights %}
|
||||
<section class="card" id="highlights">
|
||||
<header><h2>Highlighted</h2></header>
|
||||
<ul class="rvhl">{% for h in highlights %}<li><mark>{{ h.text }}</mark>{% if h.comment %}<div class="sub">{{ h.comment }}</div>{% endif %}</li>{% endfor %}</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
<section class="card" id="diff">
|
||||
<header><h2>As a diff</h2><span class="muted small">our version {{ review_version }} against their text</span></header>
|
||||
{% if git %}
|
||||
<div class="gitdiff">{% for l in git %}{% if l.op == "hunk" %}<div class="gl hunk"><span class="gn"></span><span class="gn"></span><span class="gt">@@ line {{ l.old or l.new }} @@</span></div>{% else %}<div class="gl {{ l.op }}"><span class="gn">{{ l.old or "" }}</span><span class="gn">{{ l.new or "" }}</span><span class="gt"><span class="gs" aria-hidden="true">{% if l.op == "removed" %}-{% elif l.op == "added" %}+{% else %} {% endif %}</span>{% for s in l.segs %}{% if s.hl %}<b>{{ s.text }}</b>{% else %}{{ s.text }}{% endif %}{% endfor %}</span></div>{% endif %}{% else %}<p class="empty-inline">No line changed.</p>{% endfor %}</div>
|
||||
{% else %}<p class="empty-inline">The texts are too long to compare here.</p>{% endif %}
|
||||
</section>
|
||||
<section class="card" id="markup">
|
||||
<header><h2>As they marked it</h2></header>
|
||||
{{ rm.marked(shown) }}
|
||||
<p class="muted small mono hashline">Their text, SHA-256 {{ reply_sha }}</p>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -1,23 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
{% block main %}
|
||||
<div class="phead">
|
||||
<div class="crumbs"><a href="/contracts">Contracts</a> <span class="sep">/</span> <a href="/contracts/{{ id }}">{{ head.code }}</a></div>
|
||||
<div class="pagehead"><h1>Sent for review</h1></div>
|
||||
</div>
|
||||
<section class="card linkcard" id="review-made">
|
||||
{% if url %}
|
||||
<header><h2>The link for {{ party }}</h2></header>
|
||||
<p>Give this link to {{ party }}: by email or chat, or let them scan the code. On it they read version {{ review_version }}, cross out, add and highlight, and send it back. It works until {{ until }}; every version you send them later comes on the same link.</p>
|
||||
<div class="linkrow">
|
||||
<input type="text" readonly value="{{ url }}" id="link-url" aria-label="The link" data-select-all>
|
||||
<button type="button" class="btn" data-copy="#link-url">Copy</button>
|
||||
</div>
|
||||
{% if qr %}<div class="qr" aria-label="The link as a QR code">{{ qr|safe }}</div>{% endif %}
|
||||
<p class="notice warn">The link is shown only now: the app keeps only a fingerprint of it. Copy it before you leave this page; otherwise close the link on the contract page and send again, which makes a new one.</p>
|
||||
{% else %}
|
||||
<header><h2>On {{ party }}'s link</h2></header>
|
||||
<p>Version {{ review_version }} is now on the link {{ party }} has already. Tell them it is there; the link works until {{ until }}.</p>
|
||||
{% endif %}
|
||||
<div class="formactions"><a class="btn pri" href="/contracts/{{ id }}#reviews">Done</a></div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user