Streamlined selection of rejected and unpublished articles

This commit is contained in:
2024-04-01 15:42:51 +02:00
parent 0139f7ab9a
commit 7e7de28b14
4 changed files with 38 additions and 50 deletions

View File

@ -1,23 +1,14 @@
{{define "page-content"}}
<form>
<div class="flex flex-col gap-4">
{{range .RejectedArticles}}
<div class="border px-2 py-1 rounded-md flex gap-2">
{{if index $.MyIDs .ID}}
<input required id="{{.ID}}" name="id" type="radio" value="{{.ID}}" />
<label class="w-full" for="{{.ID}}">
<h1 class="font-bold text-2xl">{{.Title}}</h1>
<p>{{.Description}}</p>
</label>
{{end}}
</div>
{{end}}
</div>
<div class="flex flex-col gap-4">
{{range .RejectedArticles}}
{{if index $.MyIDs .ID}}
<button class="btn" hx-get="/review-rejected-article/{{.ID}}/" hx-target="#page-content">
<h1 class="font-bold text-2xl">{{.Title}}</h1>
<p>{{.Description}}</p>
</button>
{{end}}
{{end}}
<div class="btn-area">
<input class="action-btn" type="submit" value="Auswählen" hx-post="/review-rejected-article/"
hx-target="#page-content" />
<button class="btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
</div>
</form>
<button class="action-btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
</div>
{{end}}

View File

@ -1,22 +1,11 @@
{{define "page-content"}}
<form>
<div class="flex flex-col gap-4">
{{range .}}
<div class="border px-2 py-1 rounded-md flex gap-2">
<input required id="{{.ID}}" name="id" type="radio" value="{{.ID}}" />
<label class="w-full" for="{{.ID}}">
<h1 class="font-bold text-2xl">{{.Title}}</h1>
<p>{{.Description}}</p>
</label>
</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>
<div class="flex flex-col gap-4">
{{range .}}
<button class="btn" hx-get="/review-unpublished-article/{{.ID}}/" hx-target="#page-content">
<h1 class="font-bold text-2xl">{{.Title}}</h1>
<p>{{.Description}}</p>
</button>
{{end}}
<button class="btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
</div>
{{end}}