diff options
| author | gramanas <grm@eyesin.space> | 2026-09-12 11:24:17 +0300 |
|---|---|---|
| committer | gramanas <grm@eyesin.space> | 2026-09-12 11:24:17 +0300 |
| commit | 3eb04b1a2bdf9e53231fe862cfd76327371a9741 (patch) | |
| tree | b38b2d82a47233fd8e0bb18c59e4a8f3dd2412d7 /internal/web/templates/dashboard/images.html | |
| download | blogspace-3eb04b1a2bdf9e53231fe862cfd76327371a9741.tar.gz blogspace-3eb04b1a2bdf9e53231fe862cfd76327371a9741.tar.bz2 blogspace-3eb04b1a2bdf9e53231fe862cfd76327371a9741.zip | |
Initial multi-tenant blog host
Go + Postgres application serving a management dashboard on the base
domain and one public blog per subdomain. Markdown posts organised in
pages, form-based theme customisation, image uploads stored in Postgres,
JWT cookie sessions with CSRF, superadmin user management, RSS feeds.
Docker/compose deployment and a Makefile-driven dev environment with
seed data.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/web/templates/dashboard/images.html')
| -rw-r--r-- | internal/web/templates/dashboard/images.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/web/templates/dashboard/images.html b/internal/web/templates/dashboard/images.html new file mode 100644 index 0000000..5383e73 --- /dev/null +++ b/internal/web/templates/dashboard/images.html @@ -0,0 +1,22 @@ +{{define "title"}}Images ยท {{.Blog.Title}}{{end}} +{{define "content"}} +<h1>Images</h1> +<div class="card"> + <form method="post" action="/b/{{.Blog.Subdomain}}/images/upload" enctype="multipart/form-data"> + <input type="hidden" name="_csrf" value="{{.CSRF}}"> + <label>Upload an image <span class="muted">(PNG, JPEG, GIF or WebP)</span><br><input type="file" name="file" accept="image/*" required></label> + <button type="submit">Upload</button> + </form> +</div> +<p class="muted">To put an image in a post, copy its Markdown line into the post text.</p> +<div class="gallery"> +{{range .Data.images}} + <div class="card thumb"> + <a href="/media/{{.ID}}" target="_blank"><img src="/media/{{.ID}}" alt="{{.Filename}}"></a> + <div class="meta">{{.Filename}} <span class="muted">({{kb .Size}})</span></div> + <input class="copy" readonly value="" onclick="this.select()"> + <form method="post" action="/b/{{$.Blog.Subdomain}}/images/{{.ID}}/delete" class="inline"><input type="hidden" name="_csrf" value="{{$.CSRF}}"><button class="mini danger">delete</button></form> + </div> +{{else}}<p class="muted">No images yet.</p>{{end}} +</div> +{{end}} |
