Every page of the pack is now A4 upright, so it prints as one stack. A
PDF page or a whole-page picture that lies wider than tall is turned
onto the page (a small one that fits as it is stays as it is), and a
PDF page is only made smaller, never larger.
A picture never prints larger than its resolution allows (the JFIF or
PNG dpi, else 150 dpi), nor larger than its kind's box: passport pages,
visas and stamps 180 x 128 mm, cards 130 x 90 mm, and a phone's
screenshot (the TDAC, or any picture about twice as tall as wide)
150 x 75 mm. These print at the top of the page.
Cards: a new kind "ID card", and the work permit, take two pictures in
one upload as front and back (migration 0008 documents.back_of). The
Documents tab marks them front/back, lists them together and offers
"Print both sides" (.../documents/{id}/sides.pdf); the pack prints both
on one sheet. The client link takes ID cards too. The demo seeds a TDAC
screenshot and an ID card's two sides.
Checks: fmt, clippy, 108 unit and 57 integration tests (print sizes,
dpi reading, the back following its front, the paired upload, its
audit and the sides PDF); the demo pack's pages checked as images.
The Documents tab's actions stack on a phone, so none is cut off.
39 lines
2.3 KiB
HTML
39 lines
2.3 KiB
HTML
{% extends "client_base.html" %}
|
|
{% import "_fields.html" as fm %}
|
|
{% block main %}
|
|
<div class="crumbs"><a href="{{ base }}">Your details</a></div>
|
|
<h1 class="chead">Documents</h1>
|
|
<p class="lead2">Scans or photos of your papers: the passport's photo page, a passport photo (4 x 6 cm), your visa, the arrival stamp, the TDAC, the work permit. Upload one kind at a time. For a card (ID card, work permit card), choose the photo of the front and the photo of the back together, front first.</p>
|
|
{% if files_on %}
|
|
<form method="post" action="{{ base }}/documents" enctype="multipart/form-data" class="upload card" id="upload">
|
|
<input type="hidden" name="csrf" value="{{ csrf }}">
|
|
{%- if errors %}
|
|
<div class="notice warn">Nothing was uploaded. Correct what is marked and choose the files again.</div>
|
|
{%- endif %}
|
|
{{ fm.select("kind", "What the files are", v.kind, kinds, err=errors.kind, blank="Choose", req=true) }}
|
|
<div class="drop{% if errors.file %} has-err{% endif %}" data-max="{{ file_limit }}">
|
|
<input type="file" id="f-file" name="file" multiple required accept="application/pdf,image/jpeg,image/png,image/webp" aria-describedby="h-file{% if errors.file %} e-file{% endif %}">
|
|
<span class="drop-icon" aria-hidden="true">+</span>
|
|
<label for="f-file"><b>Choose files</b> or take a photo</label>
|
|
<span class="drop-names" data-drop-names></span>
|
|
<span class="hint" id="h-file">PDF, JPEG, PNG or WebP, up to {{ file_limit_mb }} MB each, {{ max_files }} at once</span>
|
|
</div>
|
|
{%- if errors.file %}
|
|
<p class="err" id="e-file">{{ errors.file }}</p>
|
|
{%- endif %}
|
|
{{ fm.text("note", "Note", v.note, err=errors.note, ph="page 2") }}
|
|
<div class="formactions"><button type="submit" class="btn pri" id="upload-btn">Upload</button><a class="btn ghost" href="{{ base }}">Back</a></div>
|
|
</form>
|
|
{% else %}
|
|
<div class="notice warn">Uploads are switched off on this server. Give your papers to B4L instead.</div>
|
|
{% endif %}
|
|
<section class="card" id="uploaded">
|
|
<header><h2>Uploaded through this link</h2></header>
|
|
{% for d in uploaded %}
|
|
<div class="item"><div class="row"><b>{{ d.label }}</b><span class="muted small">{{ d.at }}</span></div><div class="muted small fname">{{ d.file_name }}, {{ d.size }}</div></div>
|
|
{% else %}
|
|
<p class="empty-inline">Nothing yet.</p>
|
|
{% endfor %}
|
|
</section>
|
|
{% endblock %}
|