forked from jason/cpolis
Styled with tailwind css
This commit is contained in:
@ -1,14 +1,21 @@
|
||||
{{define "page-content"}}
|
||||
<h2>Editor</h2>
|
||||
<form>
|
||||
<div>
|
||||
<input name="article-title" placeholder="Titel" type="text" value="{{.Article.Title}}" />
|
||||
<textarea name="article-description" placeholder="Beschreibung">{{.Article.Description}}</textarea>
|
||||
<textarea name="article-content" placeholder="Artikel">{{.Article.Content}}</textarea>
|
||||
<input name="article-id" type="hidden" value="{{.Article.ID}}" />
|
||||
<div class="flex flex-col gap-y-1">
|
||||
<label for="article-title">Titel</label>
|
||||
<input name="article-title" type="text" value="{{.Article.Title}}" />
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label for="article-description">Beschreibung</label>
|
||||
<textarea name="article-description">{{.Article.Description}}</textarea>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label for="article-content">Artikel</label>
|
||||
<textarea name="article-content" placeholder="Artikel">{{.Article.Content}}</textarea>
|
||||
</div>
|
||||
<input name="article-id" type="hidden" value="{{.Article.ID}}" />
|
||||
|
||||
<div>
|
||||
<div class="flex gap-4">
|
||||
{{range .Tags}}
|
||||
<div>
|
||||
<input id="tag-{{.Name}}" name="tags" type="checkbox" value="{{.ID}}" {{if index $.Selected
|
||||
@ -19,15 +26,16 @@
|
||||
</div>
|
||||
|
||||
<div id="editor-images">
|
||||
<input name="article-image" type="file" hx-encoding="multipart/form-data" hx-post="/upload-image/"
|
||||
<input class="mb-2" name="article-image" type="file" hx-encoding="multipart/form-data" hx-post="/upload-image/"
|
||||
hx-swap="beforeend" hx-target="#editor-images" />
|
||||
</div>
|
||||
|
||||
<input type="submit" value="Senden" hx-post="/resubmit-article/" hx-target="#page-content" />
|
||||
<div class="btn-area">
|
||||
<input class="action-btn" type="submit" value="Senden" hx-post="/resubmit-article/" hx-target="#page-content" />
|
||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<button hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
||||
|
||||
<script>
|
||||
function copyToClipboard(text) {
|
||||
event.preventDefault(); // Get-Request verhindern
|
||||
@ -51,9 +59,10 @@
|
||||
|
||||
{{define "editor-images"}}
|
||||
{{if gt (len .) 0}}
|
||||
<div>
|
||||
{{.}}
|
||||
<button onclick="copyToClipboard('{{.}}')">Kopieren</button>
|
||||
<div class="border px-2 py-1 rounded-md flex gap-4 justify-between">
|
||||
<div class="self-center">{{.}}</div>
|
||||
<button class="bg-slate-50 border my-2 px-3 py-2 rounded-md w-32 hover:bg-slate-100"
|
||||
onclick="copyToClipboard('{{.}}')">Kopieren</button>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
Reference in New Issue
Block a user