From e85e8e15aa12576b8903d94fee9adf8ea33532c1 Mon Sep 17 00:00:00 2001 From: Leo Torres Date: Sat, 28 Mar 2026 20:17:52 +0100 Subject: [PATCH 1/2] Add Upload New Version button to dashboard and revision upload form variant Dashboard shows an "Upload New Version" button for each published scroll, linking to /upload?revises={url_hash}. The upload form detects the revises parameter and shows a revision context box with current version info, pre-fills metadata, and changes header/button text accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/templates/dashboard.html | 69 +++++++++-- app/templates/partials/upload_form.html | 15 ++- static/css/main.css | 37 ++++++ tests/test_upload_new_version.py | 156 ++++++++++++++++++++++++ 4 files changed, 263 insertions(+), 14 deletions(-) create mode 100644 tests/test_upload_new_version.py diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index 034a87e..0e3f8d5 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -57,19 +57,27 @@

Your Scrolls ({{ papers|length }})

{% for paper_row in papers %} {% set paper = paper_row[0] %} {% set subject_name = paper_row[1] %} - {{ scroll_card( - paper.title, - paper.authors, - paper.abstract, - paper.keywords, - subject_name, - "recently", - "v" + paper.version|string, - paper.url_hash, - doi=paper.doi, - doi_status=paper.doi_status, - canonical_url=paper.canonical_url - ) }} +
+ {{ scroll_card( + paper.title, + paper.authors, + paper.abstract, + paper.keywords, + subject_name, + "recently", + "v" + paper.version|string, + paper.url_hash, + doi=paper.doi, + doi_status=paper.doi_status, + canonical_url=paper.canonical_url + ) }} + +
{% endfor %} {% else %} @@ -555,6 +563,41 @@

Delete Account

padding: var(--space-sm) var(--space-md); font-size: var(--text-sm); } + +.scroll-card-wrapper { + border: 1px solid var(--gray-lightest); + border-radius: var(--border-radius); + overflow: hidden; +} + +.scroll-card-wrapper .scroll.preview { + border: none; + border-radius: 0; +} + +.scroll-card-actions { + padding: 0.5rem 1rem; + border-top: 1px solid var(--gray-lightest); + background: var(--gray-bg); + display: flex; + justify-content: flex-end; +} + +.scroll-card-actions .btn { + display: inline-flex; + align-items: center; + gap: 0.375rem; +} + +@media (max-width: 768px) { + .scroll-card-actions { + justify-content: center; + } + .scroll-card-actions .btn { + width: 100%; + justify-content: center; + } +}