From a2d219b2c0e9dca16b8b45fd5b243846ca4823e2 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sat, 31 Aug 2024 12:17:30 +0200 Subject: [PATCH] Don't show autogenerated articles in list for deletion --- cmd/frontend/articles.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index 2ad8a66..0b926c4 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -521,9 +521,16 @@ func ShowPublishedArticles(c *b.Config, db *b.DB, s *b.CookieStore) http.Handler return } + filteredArticles := make([]*b.Article, 0) + for _, article := range publishedArticles { + if article.Title != "Autogenerated cpolis Issue Article" { + filteredArticles = append(filteredArticles, article) + } + } + tmpl, err := template.ParseFiles(c.WebDir + "/templates/published-articles.html") tmpl = template.Must(tmpl, err) - tmpl.ExecuteTemplate(w, "page-content", publishedArticles) + tmpl.ExecuteTemplate(w, "page-content", filteredArticles) } }