Subject: [PATCH links] Adding Delete buttons on bookmark and note Detail and Edit views.

From: Peter Sanchez <[email-masked]>
Date: Thu, 27 Nov 2025 12:28:07 -0600

Implements: https://todo.code.netlandish.com/~netlandish/links/120
Changelog-updated: Add Delete buttons to bookmark/note detail and edit
  views.
---
 core/routes.go             | 4 ++++
 templates/link_create.html | 3 +++
 templates/link_detail.html | 1 +
 templates/note_create.html | 3 +++
 4 files changed, 11 insertions(+)

diff --git a/core/routes.go b/core/routes.go
index 2677123..f34443b 100644
--- a/core/routes.go
+++ b/core/routes.go
@@ -2562,6 +2562,7 @@ func (s *Service) OrgLinkDetail(c echo.Context) error {
 	lt := localizer.GetSessionLocalizer(c)
 	pd := localizer.NewPageData(lt.Translate("Link Detail"))
 	pd.Data["edit"] = lt.Translate("Edit")
+	pd.Data["delete"] = lt.Translate("Delete")
 	pd.Data["public_post"] = lt.Translate("Public Post")
 	pd.Data["private_post"] = lt.Translate("Private Post")
 	pd.Data["tags"] = lt.Translate("Tags")
@@ -2716,6 +2717,7 @@ func (s *Service) OrgLinkUpdate(c echo.Context) error {
 	pd.Data["organization"] = lt.Translate("Organization")
 	pd.Data["tags"] = lt.Translate("Tags")
 	pd.Data["cancel"] = lt.Translate("Cancel")
+	pd.Data["delete"] = lt.Translate("Delete")
 	pd.Data["back"] = lt.Translate("Back")
 	pd.Data["unread"] = lt.Translate("Unread")
 	pd.Data["starred"] = lt.Translate("Starred")
@@ -3547,6 +3549,7 @@ func (s *Service) NoteUpdate(c echo.Context) error {
 	pd.Data["organization"] = lt.Translate("Organization")
 	pd.Data["tags"] = lt.Translate("Tags")
 	pd.Data["cancel"] = lt.Translate("Cancel")
+	pd.Data["delete"] = lt.Translate("Delete")
 	pd.Data["back"] = lt.Translate("Back")
 	pd.Data["starred"] = lt.Translate("Starred")
 	pd.Data["confirm_message"] = lt.Translate("Do you want to delete")
@@ -3685,6 +3688,7 @@ func (s *Service) NoteDetail(c echo.Context) error {
 	lt := localizer.GetSessionLocalizer(c)
 	pd := localizer.NewPageData(lt.Translate("Note"))
 	pd.Data["edit"] = lt.Translate("Edit")
+	pd.Data["delete"] = lt.Translate("Delete")
 	pd.Data["public_post"] = lt.Translate("Public Post")
 	pd.Data["private_post"] = lt.Translate("Private Post")
 	pd.Data["tags"] = lt.Translate("Tags")
diff --git a/templates/link_create.html b/templates/link_create.html
index ebbb2cc..e3202ea 100644
--- a/templates/link_create.html
+++ b/templates/link_create.html
@@ -88,6 +88,9 @@
     <div class="is-right">
     <button type="submit" form="link-form" class="button dark">{{.pd.Data.save}}</button>
     <a href="{{reverse "core:home_link_list"}}" class="button error">{{.pd.Data.cancel}}</a>
+    {{if .orgLinkHash}}
+    <a class="button error" href="{{reverse "core:link_delete" .orgLinkHash}}">{{.pd.Data.delete}}</a>
+    {{end}}
     </div>
     <div>{{ .pd.Data.also_save }} <a href="{{ reverse "accounts:settings" }}">{{ .pd.Data.bookmarklet }}</a>.</div>
   </footer>
diff --git a/templates/link_detail.html b/templates/link_detail.html
index 56cb1a2..23bdf12 100644
--- a/templates/link_detail.html
+++ b/templates/link_detail.html
@@ -47,6 +47,7 @@
     {{else}}
         <a class="button dark" href="{{reverse "core:note_edit" .link.Hash}}">{{.pd.Data.edit}}</a>
     {{end}}
+    <a class="button error" href="{{reverse "core:link_delete" .link.Hash}}">{{.pd.Data.delete}}</a>
   </footer>
   {{end}}
 </section>
diff --git a/templates/note_create.html b/templates/note_create.html
index bf5daa0..ba82ba6 100644
--- a/templates/note_create.html
+++ b/templates/note_create.html
@@ -72,6 +72,9 @@
   <footer class="is-right">
     <button type="submit" form="link-form" class="button dark">{{.pd.Data.save}}</button>
     <a href="{{reverse "core:home_link_list"}}" class="button error">{{.pd.Data.cancel}}</a>
+    {{if .orgLinkHash}}
+    <a class="button error" href="{{reverse "core:link_delete" .orgLinkHash}}">{{.pd.Data.delete}}</a>
+    {{end}}
   </footer>
 </section>
 {{template "base_footer" .}}
-- 
2.49.1

---

From: "Peter Sanchez" <[email-masked]>
Date: Thu, 27 Nov 2025 12:31:46 -0600

Applied.

To [email-masked]:~netlandish/links
   a484451..155fc39  master -> master