Provide indicator when editing bookmarks
This commit is contained in:
parent
2d488ffdcc
commit
1904bfd265
@ -30,7 +30,10 @@
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<button type="button" hx-confirm="Delete this bookmark permanently?" hx-delete="/edit/{{.bookmark.ID}}" class="alert button">delete</button>
|
||||
<button type="button" class="button" hx-post="/edit/{{.bookmark.ID}}">save</button>
|
||||
<button type="button" hx-confirm="Delete this bookmark permanently?" hx-delete="/edit/{{.bookmark.ID}}" class="alert button">Delete</button>
|
||||
<button type="button" class="button" hx-indicator="#saving" hx-post="/edit/{{.bookmark.ID}}"> {{ if .saved }} Saved {{ else }} Save {{ end }}</button>
|
||||
<span id="saving" class="htmx-indicator">
|
||||
<img style="height:1em;" src="/assets/image/beating.gif" /> Saving...
|
||||
</span>
|
||||
</p>
|
||||
</form>
|
@ -371,7 +371,7 @@ func Create(bmm *db.BookmarkManager, cmm *db.ConfigManager) *Server {
|
||||
bmm.SaveBookmark(&bookmark)
|
||||
bmm.UpdateIndexForBookmark(&bookmark) // because title may have changed
|
||||
|
||||
meta := gin.H{"page": "edit", "bookmark": bookmark, "tw": gin.H{"tags": bookmark.Tags, "tags_hidden": strings.Join(bookmark.Tags, "|")}}
|
||||
meta := gin.H{"page": "edit", "bookmark": bookmark, "saved": true, "tw": gin.H{"tags": bookmark.Tags, "tags_hidden": strings.Join(bookmark.Tags, "|")}}
|
||||
|
||||
c.HTML(http.StatusOK,
|
||||
"edit_form.html", meta,
|
||||
|
Loading…
x
Reference in New Issue
Block a user