More changes to uploads:

- Have got upload images appearing in the post list
- Allowed for deleting uploads
- Allowed for seeing the upload progress
- Fixed the setting of upload properties like the MIME type
- Removed the stripe exif logic with just re-encoding PNGs and JPEGs by loading them and saving them
This commit is contained in:
Leon Mika 2026-03-04 22:33:39 +11:00
parent d0cebe6564
commit 199ff9feb9
21 changed files with 471 additions and 65 deletions

View file

@ -10,6 +10,9 @@
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/sites/{{.site.ID}}/posts">Posts</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/sites/{{.site.ID}}/uploads">Uploads</a>
</li>
</ul>
<form class="d-flex align-items-center" role="search">
<!--

View file

@ -18,10 +18,11 @@
<div data-controller="postlist"
data-postlist-site-id-value="{{ $p.SiteID }}"
data-postlist-post-id-value="{{ $p.ID }}"
data-postlist-nano-summary-value="{{ $p.NanoSummary }}">
<div class="my-4">
data-postlist-nano-summary-value="{{ $p.NanoSummary }}"
class="postlist">
<div class="my-4 post">
{{ if $p.Title }}<h4 class="mb-3">{{ $p.Title }}</h4>{{ end }}
{{ $p.Body | markdown }}
{{ markdown $p.Body $.site }}
<div class="mb-3 d-flex align-items-center">
{{ if eq .State 1 }}

View file

@ -1,7 +1,11 @@
<main class="container">
<div class="my-4 d-flex justify-content-between align-items-baseline"
<div class="my-4 d-flex justify-left align-items-baseline"
data-controller="upload" data-upload-site-id-value="{{ .site.ID }}">
<button class="btn btn-success" data-action="upload#upload">Upload</button>
<button class="btn btn-success" data-upload-target="uploadBtn" data-action="upload#upload">Upload</button>
<div class="progress upload-progressbar ms-3 d-none" data-upload-target="progressbar"
role="progressbar" aria-label="Basic example" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar" style="width: 0" data-upload-target="progressbarProgress"></div>
</div>
</div>
{{ range .uploads }}

View file

@ -1,8 +1,14 @@
<main class="container">
<main class="container show-upload">
<div class="my-4 d-flex justify-content-between align-items-baseline"
data-controller="show-upload" data-show-upload-copy-snippet-value="{{ .upload.CopyTemplate }}">
<button class="btn" data-action="show-upload#copy">Copy HTML</button>
data-controller="show-upload"
data-show-upload-copy-snippet-value="{{ .upload.CopyTemplate }}"
data-show-upload-site-id-value="{{ .upload.Upload.SiteID }}"
data-show-upload-upload-id-value="{{ .upload.Upload.ID }}">
<button class="btn btn-outline-dark" data-action="show-upload#copy">Copy HTML</button>
<button class="btn btn-danger" data-action="show-upload#delete">Delete</button>
</div>
<img src="{{ .upload.URL }}" alt="{{ .upload.Upload.Alt }}" class="img-fluid">
<figure>
<img src="{{ .upload.URL }}" alt="{{ .upload.Upload.Alt }}" class="img-fluid">
</figure>
</main>