| @@ -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"> |