Added ability to reject and rework article

This commit is contained in:
2024-03-10 15:03:46 +01:00
parent a1a6b6c29f
commit f10220f936
13 changed files with 237 additions and 88 deletions

View File

@ -1,17 +1,13 @@
{{define "page-content"}}
<h2>Editor</h2>
<form>
<input name="editor-title" placeholder="Titel" type="text" />
<textarea name="editor-desc" placeholder="Beschreibung"></textarea>
<textarea name="editor-text" placeholder="Artikel"></textarea>
<input name="article-title" placeholder="Titel" type="text" />
<textarea name="article-description" placeholder="Beschreibung"></textarea>
<textarea name="article-content" placeholder="Artikel"></textarea>
{{range .}}
<input id="{{.Name}}" name="tags" type="checkbox" value="{{.ID}}" />
<label for="{{.Name}}">{{.Name}}</label>
{{end}}
<input type="submit" value="Senden" hx-post="/finish-article/" hx-target="#page-content" />
<input type="submit" value="Senden" hx-post="/submit-article/" hx-target="#page-content" />
</form>
{{end}}
{{define "html-result"}}
{{.}}
{{end}}

View File

@ -1,6 +1,7 @@
{{define "page-content"}}
<h2>Hub</h2>
<button hx-get="/write-article/" hx-target="#page-content">Artikel schreiben</button>
<button hx-get="/rejected-articles/" hx-target="#page-content">Abgelehnte Artikel</button>
<button hx-get="/rss/" hx-target="#page-content">RSS Feed</button>
{{if lt . 2}}
<button hx-get="/unpublished-articles/" hx-target="#page-content">Unveröffentlichte Artikel</button>

View File

@ -0,0 +1,10 @@
{{define "page-content"}}
<form>
{{range .}}
<input required id="{{.ID}}" name="id" type="radio" value="{{.ID}}" />
<label for="{{.ID}}">{{.Title}}</label>
{{end}}
<input type="submit" value="Auswählen" hx-post="/review-rejected-article/" hx-target="#page-content" />
</form>
<button hx-get="/hub/" hx-target="#page-content">Zurück</button>
{{end}}

View File

@ -0,0 +1,10 @@
{{define "page-content"}}
<h2>Editor</h2>
<form>
<input name="article-title" placeholder="Titel" type="text" value="{{.Title}}" />
<textarea name="article-description" placeholder="Beschreibung">{{.Description}}</textarea>
<textarea name="article-content" placeholder="Artikel">{{.Content}}</textarea>
<input name="article-id" type="hidden" value="{{.ID}}" />
<input type="submit" value="Senden" hx-post="/resubmit-article/" hx-target="#page-content" />
</form>
{{end}}

View File

@ -1,8 +1,8 @@
{{define "page-content"}}
<form>
<h2>{{.Title}}</h2>
<p>{{.Desc}}</p>
<span>{{.Content}}</span>
<p>{{.Description}}</p>
{{.Content}}
<input name="id" type="hidden" value="{{.ID}}" />
<input type="submit" value="Veröffentlichen" hx-post="/publish-article/" hx-target="#page-content" />
<input type="submit" value="Ablehnen" hx-post="/reject-article/" hx-target="#page-content" />

View File

@ -4,7 +4,7 @@
<input required id="{{.ID}}" name="id" type="radio" value="{{.ID}}" />
<label for="{{.ID}}">{{.Title}}</label>
{{end}}
<input type="submit" value="Auswählen" hx-post="/review-article/" hx-target="#page-content" />
<input type="submit" value="Auswählen" hx-post="/review-unpublished-article/" hx-target="#page-content" />
</form>
<button hx-get="/hub/" hx-target="#page-content">Zurück</button>
{{end}}