Add upload log and pinnable latest version #91

Merged
qwc merged 1 commit from feature/upload-log-and-pin-version into main 2026-03-05 09:17:01 +01:00
Owner

Summary

  • Upload log (#88): Records every upload (new and re-upload) with version tag, content type, filename, and uploader. Displayed as a collapsible section on the project detail page for editors/admins (last 50 entries).
  • Pin as latest (#89): Adds "Pin" and "Temp. pin" buttons to each version in the version list. Permanent pins persist across new uploads; temporary pins are automatically cleared when a new version is uploaded. Pinned versions take priority over semver sorting for the frontpage and search.

Changes

Area Files
Migration 008 upload_logs table + pinned_version/pin_permanent columns on projects (all 3 dialects)
Model UploadLog struct, PinnedVersion/PinPermanent on Project
Store UploadLogStore interface + SQL implementation; project queries updated for new columns
Handlers Upload log recording in upload.go/api.go; pin/unpin handlers in project.go; frontpage/search respect pinned versions
Templates Version list with pin/unpin buttons + badges; upload log table on project detail
CSS Styles for pin badges (Pinned, Temp. latest, Latest), upload log table
Docs New how-to guide, updated index/uploading-docs/search-indexing
Tests Store tests for UploadLogStore and ProjectStore pinned version; handler tests for pin/unpin flow, upload log creation, temp/permanent pin behavior, auth checks

Test plan

  • go build passes
  • go test ./... passes (all existing + 12 new tests)
  • Manual: upload a version, verify upload log entry appears
  • Manual: pin a version, verify frontpage shows it as latest
  • Manual: upload new version with temp pin, verify pin is cleared
  • Manual: upload new version with permanent pin, verify pin persists

Closes #88, closes #89

🤖 Generated with Claude Code

## Summary - **Upload log** (#88): Records every upload (new and re-upload) with version tag, content type, filename, and uploader. Displayed as a collapsible section on the project detail page for editors/admins (last 50 entries). - **Pin as latest** (#89): Adds "Pin" and "Temp. pin" buttons to each version in the version list. Permanent pins persist across new uploads; temporary pins are automatically cleared when a new version is uploaded. Pinned versions take priority over semver sorting for the frontpage and search. ## Changes | Area | Files | |------|-------| | Migration 008 | `upload_logs` table + `pinned_version`/`pin_permanent` columns on `projects` (all 3 dialects) | | Model | `UploadLog` struct, `PinnedVersion`/`PinPermanent` on `Project` | | Store | `UploadLogStore` interface + SQL implementation; project queries updated for new columns | | Handlers | Upload log recording in `upload.go`/`api.go`; pin/unpin handlers in `project.go`; frontpage/search respect pinned versions | | Templates | Version list with pin/unpin buttons + badges; upload log table on project detail | | CSS | Styles for pin badges (Pinned, Temp. latest, Latest), upload log table | | Docs | New how-to guide, updated index/uploading-docs/search-indexing | | Tests | Store tests for `UploadLogStore` and `ProjectStore` pinned version; handler tests for pin/unpin flow, upload log creation, temp/permanent pin behavior, auth checks | ## Test plan - [x] `go build` passes - [x] `go test ./...` passes (all existing + 12 new tests) - [ ] Manual: upload a version, verify upload log entry appears - [ ] Manual: pin a version, verify frontpage shows it as latest - [ ] Manual: upload new version with temp pin, verify pin is cleared - [ ] Manual: upload new version with permanent pin, verify pin persists Closes #88, closes #89 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add upload log and pinnable latest version
All checks were successful
CI / test (pull_request) Successful in 1m1s
CI / build (pull_request) Successful in 44s
CI / docker (pull_request) Has been skipped
972a5362dd
Upload log: Records every upload (new and re-upload) with version tag,
content type, filename, and uploader. Displayed as a collapsible section
on the project detail page for editors/admins.

Pinnable latest version: Adds "Pin" and "Temp. pin" buttons to each
version. Permanent pins persist across new uploads; temporary pins are
automatically cleared when a new version is uploaded. Pinned versions
take priority over semver sorting for the frontpage and search.

Includes migration 008, UploadLogStore, handler tests, and store tests.

Closes #88, closes #89

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
qwc merged commit b71d93fc2b into main 2026-03-05 09:17:01 +01:00
qwc deleted branch feature/upload-log-and-pin-version 2026-03-05 09:17:01 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
qwc-open/asiakirjat!91
No description provided.