From a3c53b1b20bddd5ade52b66e7b737347ff63855c Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Wed, 3 Apr 2024 20:24:54 +0200 Subject: [PATCH] Changed URL patterns to be more specific --- cmd/main.go | 46 ++++++++++++------------- web/templates/add-tag.html | 4 +-- web/templates/add-user.html | 4 +-- web/templates/current-articles.html | 4 +-- web/templates/edit-user.html | 4 +-- web/templates/editor.html | 6 ++-- web/templates/first-user.html | 2 +- web/templates/hub.html | 18 +++++----- web/templates/login.html | 2 +- web/templates/rejected-articles.html | 4 +-- web/templates/rework-article.html | 6 ++-- web/templates/to-be-published.html | 6 ++-- web/templates/unpublished-articles.html | 4 +-- 13 files changed, 55 insertions(+), 55 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index e9242c8..e0a67bd 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -49,36 +49,36 @@ func main() { http.FileServer(http.Dir(args.WebDir+"/static/")))) mux.HandleFunc("/", view.HomePage(args, db, store)) - mux.HandleFunc("GET /create-tag/", view.CreateTag(args)) - mux.HandleFunc("GET /create-user/", view.CreateUser(args)) - mux.HandleFunc("GET /edit-user/", view.EditUser(args, db, store)) - mux.HandleFunc("GET /hub/", view.ShowHub(args, db, store)) - mux.HandleFunc("GET /logout/", view.Logout(args, store)) - mux.HandleFunc("GET /publish-article/{id}/", view.PublishArticle(args, db, store)) - mux.HandleFunc("GET /publish-issue/", view.PublishLatestIssue(args, db, store)) - mux.HandleFunc("GET /reject-article/{id}/", view.RejectArticle(args, db, store)) - mux.HandleFunc("GET /rejected-articles/", view.ShowRejectedArticles(args, db, store)) - mux.HandleFunc("GET /review-rejected-article/{id}/", view.ReviewRejectedArticle(args, db, store)) - mux.HandleFunc("GET /review-unpublished-article/{id}/", view.ReviewUnpublishedArticle(args, db, store)) - mux.HandleFunc("GET /rss/", view.ShowRSS( + mux.HandleFunc("GET /create-tag", view.CreateTag(args)) + mux.HandleFunc("GET /create-user", view.CreateUser(args)) + mux.HandleFunc("GET /edit-user", view.EditUser(args, db, store)) + mux.HandleFunc("GET /hub", view.ShowHub(args, db, store)) + mux.HandleFunc("GET /logout", view.Logout(args, store)) + mux.HandleFunc("GET /publish-article/{id}", view.PublishArticle(args, db, store)) + mux.HandleFunc("GET /publish-issue", view.PublishLatestIssue(args, db, store)) + mux.HandleFunc("GET /reject-article/{id}", view.RejectArticle(args, db, store)) + mux.HandleFunc("GET /rejected-articles", view.ShowRejectedArticles(args, db, store)) + mux.HandleFunc("GET /review-rejected-article/{id}", view.ReviewRejectedArticle(args, db, store)) + mux.HandleFunc("GET /review-unpublished-article/{id}", view.ReviewUnpublishedArticle(args, db, store)) + mux.HandleFunc("GET /rss", view.ShowRSS( args, db, "Freimaurer Distrikt Niedersachsen und Sachsen-Anhalt", "https://distrikt-ni-st.de", "Freiheit, Gleichheit, Brüderlichkeit, Toleranz und Humanität", )) - mux.HandleFunc("GET /this-issue/", view.ShowCurrentArticles(args, db)) - mux.HandleFunc("GET /unpublished-articles/", view.ShowUnpublishedArticles(args, db)) - mux.HandleFunc("GET /write-article/", view.WriteArticle(args, db)) + mux.HandleFunc("GET /this-issue", view.ShowCurrentArticles(args, db)) + mux.HandleFunc("GET /unpublished-articles", view.ShowUnpublishedArticles(args, db)) + mux.HandleFunc("GET /write-article", view.WriteArticle(args, db)) - mux.HandleFunc("POST /add-first-user/", view.AddFirstUser(args, db, store)) - mux.HandleFunc("POST /add-tag/", view.AddTag(args, db, store)) - mux.HandleFunc("POST /add-user/", view.AddUser(args, db, store)) - mux.HandleFunc("POST /login/", view.Login(args, db, store)) - mux.HandleFunc("POST /resubmit-article/{id}/", view.ResubmitArticle(args, db, store)) - mux.HandleFunc("POST /submit-article/", view.SubmitArticle(args, db, store)) - mux.HandleFunc("POST /update-user/", view.UpdateUser(args, db, store)) - mux.HandleFunc("POST /upload-image/", view.UploadImage(args)) + mux.HandleFunc("POST /add-first-user", view.AddFirstUser(args, db, store)) + mux.HandleFunc("POST /add-tag", view.AddTag(args, db, store)) + mux.HandleFunc("POST /add-user", view.AddUser(args, db, store)) + mux.HandleFunc("POST /login", view.Login(args, db, store)) + mux.HandleFunc("POST /resubmit-article/{id}", view.ResubmitArticle(args, db, store)) + mux.HandleFunc("POST /submit-article", view.SubmitArticle(args, db, store)) + mux.HandleFunc("POST /update-user", view.UpdateUser(args, db, store)) + mux.HandleFunc("POST /upload-image", view.UploadImage(args)) log.Fatalln(http.ListenAndServe(args.Port, mux)) } diff --git a/web/templates/add-tag.html b/web/templates/add-tag.html index 52e84fa..e79865a 100644 --- a/web/templates/add-tag.html +++ b/web/templates/add-tag.html @@ -4,8 +4,8 @@
- - + +
diff --git a/web/templates/add-user.html b/web/templates/add-user.html index 7f11f83..6866c99 100644 --- a/web/templates/add-user.html +++ b/web/templates/add-user.html @@ -44,8 +44,8 @@
- - + +
diff --git a/web/templates/current-articles.html b/web/templates/current-articles.html index dc67e3c..8769424 100644 --- a/web/templates/current-articles.html +++ b/web/templates/current-articles.html @@ -9,7 +9,7 @@
- - + +
{{end}} diff --git a/web/templates/edit-user.html b/web/templates/edit-user.html index a353dae..ee901f5 100644 --- a/web/templates/edit-user.html +++ b/web/templates/edit-user.html @@ -28,9 +28,9 @@
- - +
{{end}} diff --git a/web/templates/editor.html b/web/templates/editor.html index cf250cb..fd38a64 100644 --- a/web/templates/editor.html +++ b/web/templates/editor.html @@ -27,13 +27,13 @@
-
- - + +
diff --git a/web/templates/first-user.html b/web/templates/first-user.html index 8e43d44..dace772 100644 --- a/web/templates/first-user.html +++ b/web/templates/first-user.html @@ -26,7 +26,7 @@
- +
diff --git a/web/templates/hub.html b/web/templates/hub.html index 4a59a1e..0051cd0 100644 --- a/web/templates/hub.html +++ b/web/templates/hub.html @@ -1,14 +1,14 @@ {{define "page-content"}}
- +

Autor

- - - - + + + +
@@ -16,10 +16,10 @@

Redakteur

- - +
{{end}} @@ -28,7 +28,7 @@

Herausgeber

- +
{{end}} @@ -37,7 +37,7 @@

Administrator

- +
{{end}} diff --git a/web/templates/login.html b/web/templates/login.html index 04e2111..fefd1d5 100644 --- a/web/templates/login.html +++ b/web/templates/login.html @@ -6,6 +6,6 @@
- + {{end}} diff --git a/web/templates/rejected-articles.html b/web/templates/rejected-articles.html index ba4dc71..54b2c05 100644 --- a/web/templates/rejected-articles.html +++ b/web/templates/rejected-articles.html @@ -2,13 +2,13 @@
{{range .RejectedArticles}} {{if index $.MyIDs .ID}} - {{end}} {{end}} - +
{{end}} diff --git a/web/templates/rework-article.html b/web/templates/rework-article.html index cce0869..bbdbaab 100644 --- a/web/templates/rework-article.html +++ b/web/templates/rework-article.html @@ -28,14 +28,14 @@
-
- - +
diff --git a/web/templates/to-be-published.html b/web/templates/to-be-published.html index f28dffc..f54ce1a 100644 --- a/web/templates/to-be-published.html +++ b/web/templates/to-be-published.html @@ -26,10 +26,10 @@
- - - + +
{{end}} diff --git a/web/templates/unpublished-articles.html b/web/templates/unpublished-articles.html index 00d1d66..1682047 100644 --- a/web/templates/unpublished-articles.html +++ b/web/templates/unpublished-articles.html @@ -1,11 +1,11 @@ {{define "page-content"}}
{{range .}} - {{end}} - +
{{end}}