nandi/gleanpublic Fork 0
45ae5dc
Commits
Clone
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Display error when adding feed errorUnverified

Julien Robert committed 2026-04-23T21:07:40+02:00 Browse files
45ae5dc parent: c9bc9bc
modified internal/tmpl/feeds.html +5 -1
@@ -56,7 +56,10 @@
5656 <div class="space-y-6">
5757 <div class="bg-spot-surface rounded-xl p-4 space-y-4">
5858 <h2 class="text-sm font-bold text-spot-text uppercase tracking-wide">Add feed</h2>
59- <form hx-post="/feeds/add" hx-target="#feed-list" hx-swap="beforeend" class="space-y-3">
59+ <form hx-post="/feeds/add" hx-target="#feed-list" hx-swap="beforeend"
60+ hx-on::before-request="document.getElementById('add-feed-error').textContent=''"
61+ hx-on::after-request="if(event.detail.successful)this.reset();else document.getElementById('add-feed-error').textContent=event.detail.xhr.responseText"
62+ class="space-y-3">
6063 {{csrfInput .CSRFToken}}
6164 <input type="url" name="feed_url" placeholder="https://example.com/feed.xml"
6265 class="w-full bg-spot-hover text-spot-text rounded-pill px-5 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-spot-green placeholder:text-spot-placeholder"
@@ -65,6 +68,7 @@
6568 class="w-full bg-spot-hover text-spot-text rounded-pill px-5 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-spot-green placeholder:text-spot-placeholder">
6669 <button type="submit" class="w-full bg-spot-green text-white rounded-pill px-5 py-2 text-sm font-bold uppercase tracking-button hover:brightness-110 transition">Add</button>
6770 </form>
71+ <div id="add-feed-error" class="text-sm text-spot-red"></div>
6872 <div class="border-t border-spot-divider pt-4 space-y-3">
6973 <h2 class="text-xs text-spot-secondary font-bold uppercase tracking-wide">Import / Export</h2>
7074 <form hx-post="/feeds/opml/upload" hx-encoding="multipart/form-data" class="flex flex-col gap-2">
@@ -56,7 +56,10 @@
56 <div class="space-y-6">56 <div class="space-y-6">
57 <div class="bg-spot-surface rounded-xl p-4 space-y-4">57 <div class="bg-spot-surface rounded-xl p-4 space-y-4">
58 <h2 class="text-sm font-bold text-spot-text uppercase tracking-wide">Add feed</h2>58 <h2 class="text-sm font-bold text-spot-text uppercase tracking-wide">Add feed</h2>
59- <form hx-post="/feeds/add" hx-target="#feed-list" hx-swap="beforeend" class="space-y-3">59+ <form hx-post="/feeds/add" hx-target="#feed-list" hx-swap="beforeend"
60+ hx-on::before-request="document.getElementById('add-feed-error').textContent=''"
61+ hx-on::after-request="if(event.detail.successful)this.reset();else document.getElementById('add-feed-error').textContent=event.detail.xhr.responseText"
62+ class="space-y-3">
60 {{csrfInput .CSRFToken}}63 {{csrfInput .CSRFToken}}
61 <input type="url" name="feed_url" placeholder="https://example.com/feed.xml"64 <input type="url" name="feed_url" placeholder="https://example.com/feed.xml"
62 class="w-full bg-spot-hover text-spot-text rounded-pill px-5 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-spot-green placeholder:text-spot-placeholder"65 class="w-full bg-spot-hover text-spot-text rounded-pill px-5 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-spot-green placeholder:text-spot-placeholder"
@@ -65,6 +68,7 @@
65 class="w-full bg-spot-hover text-spot-text rounded-pill px-5 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-spot-green placeholder:text-spot-placeholder">68 class="w-full bg-spot-hover text-spot-text rounded-pill px-5 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-spot-green placeholder:text-spot-placeholder">
66 <button type="submit" class="w-full bg-spot-green text-white rounded-pill px-5 py-2 text-sm font-bold uppercase tracking-button hover:brightness-110 transition">Add</button>69 <button type="submit" class="w-full bg-spot-green text-white rounded-pill px-5 py-2 text-sm font-bold uppercase tracking-button hover:brightness-110 transition">Add</button>
67 </form>70 </form>
71+ <div id="add-feed-error" class="text-sm text-spot-red"></div>
68 <div class="border-t border-spot-divider pt-4 space-y-3">72 <div class="border-t border-spot-divider pt-4 space-y-3">
69 <h2 class="text-xs text-spot-secondary font-bold uppercase tracking-wide">Import / Export</h2>73 <h2 class="text-xs text-spot-secondary font-bold uppercase tracking-wide">Import / Export</h2>
70 <form hx-post="/feeds/opml/upload" hx-encoding="multipart/form-data" class="flex flex-col gap-2">74 <form hx-post="/feeds/opml/upload" hx-encoding="multipart/form-data" class="flex flex-col gap-2">