Streamlined selection of rejected and unpublished articles
This commit is contained in:
parent
0139f7ab9a
commit
7e7de28b14
24
cmd/main.go
24
cmd/main.go
@ -54,8 +54,14 @@ func main() {
|
|||||||
mux.HandleFunc("GET /edit-user/", view.EditUser(args, db, store))
|
mux.HandleFunc("GET /edit-user/", view.EditUser(args, db, store))
|
||||||
mux.HandleFunc("GET /hub/", view.ShowHub(args, db, store))
|
mux.HandleFunc("GET /hub/", view.ShowHub(args, db, store))
|
||||||
mux.HandleFunc("GET /logout/", view.Logout(args, store))
|
mux.HandleFunc("GET /logout/", view.Logout(args, store))
|
||||||
mux.HandleFunc("GET /publish-issue/", view.PublishLatestIssue(args, db, store))
|
mux.HandleFunc("GET /publish-issue/",
|
||||||
mux.HandleFunc("GET /rejected-articles/", view.ShowRejectedArticles(args, db, store))
|
view.PublishLatestIssue(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,
|
mux.HandleFunc("GET /rss/", view.ShowRSS(args,
|
||||||
db,
|
db,
|
||||||
"Freimaurer Distrikt Niedersachsen und Sachsen-Anhalt",
|
"Freimaurer Distrikt Niedersachsen und Sachsen-Anhalt",
|
||||||
@ -63,17 +69,19 @@ func main() {
|
|||||||
"Freiheit, Gleichheit, Brüderlichkeit, Toleranz und Humanität",
|
"Freiheit, Gleichheit, Brüderlichkeit, Toleranz und Humanität",
|
||||||
))
|
))
|
||||||
mux.HandleFunc("GET /this-issue/", view.ShowCurrentArticles(args, db))
|
mux.HandleFunc("GET /this-issue/", view.ShowCurrentArticles(args, db))
|
||||||
mux.HandleFunc("GET /unpublished-articles/", view.ShowUnpublishedArticles(args, db))
|
mux.HandleFunc("GET /unpublished-articles/",
|
||||||
|
view.ShowUnpublishedArticles(args, db))
|
||||||
mux.HandleFunc("GET /write-article/", view.WriteArticle(args, db))
|
mux.HandleFunc("GET /write-article/", view.WriteArticle(args, db))
|
||||||
|
|
||||||
mux.HandleFunc("POST /add-tag/", view.AddTag(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 /add-user/", view.AddUser(args, db, store))
|
||||||
mux.HandleFunc("POST /login/", view.Login(args, db, store))
|
mux.HandleFunc("POST /login/", view.Login(args, db, store))
|
||||||
mux.HandleFunc("POST /publish-article/{id}/", view.PublishArticle(args, db, store))
|
mux.HandleFunc("POST /publish-article/{id}/",
|
||||||
mux.HandleFunc("POST /reject-article/{id}/", view.RejectArticle(args, db, store))
|
view.PublishArticle(args, db, store))
|
||||||
mux.HandleFunc("POST /resubmit-article/{id}/", view.ResubmitArticle(args, db, store))
|
mux.HandleFunc("POST /reject-article/{id}/",
|
||||||
mux.HandleFunc("POST /review-rejected-article/", view.ReviewRejectedArticle(args, db, store))
|
view.RejectArticle(args, db, store))
|
||||||
mux.HandleFunc("POST /review-unpublished-article/", view.ReviewUnpublishedArticle(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 /submit-article/", view.SubmitArticle(args, db, store))
|
||||||
mux.HandleFunc("POST /update-user/", view.UpdateUser(args, db, store))
|
mux.HandleFunc("POST /update-user/", view.UpdateUser(args, db, store))
|
||||||
mux.HandleFunc("POST /upload-image/", view.UploadImage(args))
|
mux.HandleFunc("POST /upload-image/", view.UploadImage(args))
|
||||||
|
@ -202,7 +202,7 @@ func ReviewUnpublishedArticle(c *control.CliArgs, db *model.DB, s *control.Cooki
|
|||||||
}
|
}
|
||||||
data := new(htmlData)
|
data := new(htmlData)
|
||||||
|
|
||||||
id, err := strconv.ParseInt(r.PostFormValue("id"), 10, 64)
|
id, err := strconv.ParseInt(r.PathValue("id"), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
@ -238,7 +238,7 @@ func ReviewRejectedArticle(c *control.CliArgs, db *model.DB, s *control.CookieSt
|
|||||||
}
|
}
|
||||||
data := new(htmlData)
|
data := new(htmlData)
|
||||||
|
|
||||||
id, err := strconv.ParseInt(r.PostFormValue("id"), 10, 64)
|
id, err := strconv.ParseInt(r.PathValue("id"), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
@ -1,23 +1,14 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<form>
|
<div class="flex flex-col gap-4">
|
||||||
<div class="flex flex-col gap-4">
|
{{range .RejectedArticles}}
|
||||||
{{range .RejectedArticles}}
|
{{if index $.MyIDs .ID}}
|
||||||
<div class="border px-2 py-1 rounded-md flex gap-2">
|
<button class="btn" hx-get="/review-rejected-article/{{.ID}}/" hx-target="#page-content">
|
||||||
{{if index $.MyIDs .ID}}
|
<h1 class="font-bold text-2xl">{{.Title}}</h1>
|
||||||
<input required id="{{.ID}}" name="id" type="radio" value="{{.ID}}" />
|
<p>{{.Description}}</p>
|
||||||
<label class="w-full" for="{{.ID}}">
|
</button>
|
||||||
<h1 class="font-bold text-2xl">{{.Title}}</h1>
|
{{end}}
|
||||||
<p>{{.Description}}</p>
|
{{end}}
|
||||||
</label>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="btn-area">
|
<button class="action-btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
||||||
<input class="action-btn" type="submit" value="Auswählen" hx-post="/review-rejected-article/"
|
</div>
|
||||||
hx-target="#page-content" />
|
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -1,22 +1,11 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<form>
|
<div class="flex flex-col gap-4">
|
||||||
<div class="flex flex-col gap-4">
|
{{range .}}
|
||||||
{{range .}}
|
<button class="btn" hx-get="/review-unpublished-article/{{.ID}}/" hx-target="#page-content">
|
||||||
<div class="border px-2 py-1 rounded-md flex gap-2">
|
<h1 class="font-bold text-2xl">{{.Title}}</h1>
|
||||||
<input required id="{{.ID}}" name="id" type="radio" value="{{.ID}}" />
|
<p>{{.Description}}</p>
|
||||||
<label class="w-full" for="{{.ID}}">
|
</button>
|
||||||
<h1 class="font-bold text-2xl">{{.Title}}</h1>
|
{{end}}
|
||||||
<p>{{.Description}}</p>
|
<button class="btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
||||||
</label>
|
</div>
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="btn-area">
|
|
||||||
<input class="action-btn" type="submit" value="Auswählen" hx-post="/review-unpublished-article/"
|
|
||||||
hx-target="#page-content" />
|
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user