flask_template_codex/app/templates/tasks/transfer.html
2026-08-08 03:26:12 +02:00

90 lines
4 KiB
HTML

{% extends "base.html" %}
{% block title %}Data & backups · Steady{% endblock %}
{% block content %}
<div class="page-heading">
<div>
<p class="eyebrow">Portable and recoverable</p>
<h1>Data &amp; backups</h1>
<p>Capture a list, download your data, or restore a Steady backup.</p>
</div>
</div>
{% if undo_batch %}
<aside class="undo-banner" aria-labelledby="undo-heading">
<div>
<h2 id="undo-heading">Completed tasks were cleared</h2>
<p>They are safely hidden, not permanently deleted.</p>
</div>
<form method="post" action="{{ url_for('tasks.undo_completed_clear', batch_id=undo_batch) }}">
{{ action_form.hidden_tag() }}
<button class="button" type="submit">Undo clear</button>
</form>
</aside>
{% endif %}
<div class="transfer-grid">
<section class="transfer-card" aria-labelledby="text-import-heading">
<h2 id="text-import-heading">Import a task list</h2>
<p>Upload UTF-8 Markdown or plain text. Each non-empty line becomes a normal-priority task; headings and code blocks are ignored.</p>
<pre class="format-example"><code># Weekend
- [ ] Buy groceries
- [x] Book appointment
1. Water the plants</code></pre>
<p class="field__help">Maximum 200 tasks. Checked items import as completed.</p>
<form method="post" enctype="multipart/form-data" action="{{ url_for('tasks.import_markdown_file') }}">
{{ markdown_form.hidden_tag() }}
<div class="field">
{{ markdown_form.markdown_file.label }}
{{ markdown_form.markdown_file(accept=".md,.markdown,.txt,text/plain,text/markdown") }}
</div>
<div class="check-field">
{{ markdown_form.confirm() }} {{ markdown_form.confirm.label }}
</div>
{{ markdown_form.submit(class="button") }}
</form>
</section>
<section class="transfer-card" aria-labelledby="backup-heading">
<h2 id="backup-heading">Download a backup</h2>
<p>Export active tasks, subtasks, focus setup, completion history, and preferences as versioned JSON.</p>
<p class="field__help">Credentials, email, internal IDs, and cleared tasks are never included.</p>
<a class="button" href="{{ url_for('tasks.export_json') }}">Download JSON backup</a>
</section>
<section class="transfer-card" aria-labelledby="restore-heading">
<h2 id="restore-heading">Restore a backup</h2>
<p>Merge a Steady JSON backup into this account. The complete file is validated before anything changes.</p>
<form method="post" enctype="multipart/form-data" action="{{ url_for('tasks.import_json') }}">
{{ backup_form.hidden_tag() }}
<div class="field">
{{ backup_form.backup_file.label }}
{{ backup_form.backup_file(accept=".json,application/json") }}
</div>
<div class="check-field check-field--warning">
{{ backup_form.replace_existing() }} {{ backup_form.replace_existing.label }}
<small>Replacement removes this account's current tasks only after the backup passes validation.</small>
</div>
<div class="check-field">
{{ backup_form.confirm() }} {{ backup_form.confirm.label }}
</div>
{{ backup_form.submit(class="button") }}
</form>
</section>
<section class="transfer-card" aria-labelledby="clear-heading">
<h2 id="clear-heading">Clear completed tasks</h2>
<p>Hide completed work from active views. Your streak history remains intact.</p>
<details>
<summary>Show clear action</summary>
<p>You will receive an undo action immediately afterward.</p>
<form method="post" action="{{ url_for('tasks.clear_completed') }}">
{{ action_form.hidden_tag() }}
<button class="button button--quiet" type="submit">Clear completed tasks</button>
</form>
</details>
</section>
</div>
{% endblock %}