A lawyer sends a contract version to one of its parties with a link. On it the other side marks the text up in an editor that keeps every change visible, as tracked changes do: deleting our text crosses it out in red, typing is marked as added in green, and the highlighter marks a passage in yellow with a comment. Restore and Undo take marks back. They send it back once a round; each later version comes on the same link. - Migration 0014: review_links (token kept as a SHA-256, one open link a party) and review_rounds (the reply written once: their pieces, text, SHA-256, name, message; a trigger refuses any other change and every delete). Journal entries "sent for review", "review returned" (with the fingerprint of their text) and "review link closed"; audit entity "review". - The reply is a list of pieces (same, ins, del, mark). The server checks that the pieces without the added ones are exactly the version sent, so nothing changes unseen (reviews::check). - Our review page: their message, the changes numbered with the words around them and a box each, the highlights with comments, a git-style diff (line numbers, - and + lines, the changed words marked, three lines of context per hunk) and their markup. "Take the ticked changes" opens the contract page with the version form filled with our text plus those changes. - static/review-editor.js: edits work on the pieces and redraw, so our text cannot vanish; keyboard compositions and edits the browser will not cancel are compared with the text and taken as edits. - Property tests (any markup is accepted and taken back exactly; markup that changes our text unseen is refused), the fuzz text target runs reviews::check, integration tests, and the demo has the label's review of the recording agreement. - PLAN: phase 13.
58 lines
4.1 KiB
HTML
58 lines
4.1 KiB
HTML
{% 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 %}
|