{{define "page-content"}}
<div class="flex flex-col gap-4">
    <button class="btn" hx-get="/logout" hx-target="#page-content">Abmelden</button>

    {{if lt . 4}}
    <div class="mb-3">
        <h2>Autor</h2>
        <div class="grid grid-cols-2 gap-x-4 gap-y-2">
            <button class="btn" hx-get="/article/write" hx-target="#page-content">Artikel schreiben</button>
            <button class="btn" hx-get="/article/all-rejected" hx-target="#page-content">Abgelehnte Artikel</button>
            <button class="btn" hx-get="/user/edit/self" hx-target="#page-content">Profil bearbeiten</button>
        </div>
    </div>
    {{end}}

    {{if lt . 3}}
    <div class="mb-3">
        <h2>Redakteur</h2>
        <div class="grid grid-cols-2 gap-x-4 gap-y-2">
            <button class="btn" hx-get="/article/all-unpublished" hx-target="#page-content">
                Unveröffentlichte Artikel
            </button>
            <button class="btn" hx-get="/tag/create" hx-target="#page-content">Neuer Tag</button>
        </div>
    </div>
    {{end}}

    {{if lt . 2}}
    <div class="mb-3">
        <h2>Herausgeber</h2>
        <div class="grid grid-cols-2 gap-x-4 gap-y-2">
            <button class="btn" hx-get="/issue/this" hx-target="#page-content">Diese Ausgabe</button>
            <button class="btn" hx-get="/article/all-published" hx-target="#page-content">Artikel löschen</button>
            <form class="flex" hx-encoding="multipart/form-data">
                <label class="btn text-center" for="pdf-upload">PDF hochladen</label>
                <input accept=".pdf" class="hidden" id="pdf-upload" name="pdf-upload" type="file"
                    hx-post="/pdf/upload" />
            </form>
        </div>
    </div>
    {{end}}

    {{if eq . 0}}
    <div class="mb-3">
        <h2>Administrator</h2>
        <div class="grid grid-cols-2 gap-x-4 gap-y-2">
            <button class="btn" hx-get="/user/create" hx-target="#page-content">Benutzer hinzufügen</button>
            <button class="btn" hx-get="/user/show-all/edit" hx-target="#page-content">Benutzer bearbeiten</button>
            <button class="btn" hx-get="/user/show-all/delete" hx-target="#page-content">Benutzer löschen</button>
        </div>
    </div>
    {{end}}
</div>
{{end}}