new.php

Code Hygiene Score: 100

Keine Issues gefunden.

Versionen 1

Code

<?php

declare(strict_types=1);

// @responsibility: View für neuen Task mit HTMX-Formular

ob_start();
?>

<nav class="breadcrumb">
    <a href="/tasks">Tasks</a> &raquo; Neuer Task
</nav>

<h1>Neuer Task</h1>

<form id="task-form" class="form" style="max-width: 600px;"
      hx-post="/api/v1/tasks"
      hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
      hx-disabled-elt="button[type=submit]">
    <div class="form-group">
        <label for="title">Titel *</label>
        <input type="text" id="title" name="title" class="form-input" required>
    </div>
    <div class="form-group">
        <label for="description">Beschreibung</label>
        <textarea id="description" name="description" class="form-textarea" rows="4"></textarea>
    </div>
    <div class="form-group">
        <label for="type">Typ</label>
        <select id="type" name="type" class="form-select">
            <option value="human_task">Mensch</option>
            <option value="ai_task">KI</option>
            <option value="mixed">Gemischt</option>
        </select>
    </div>
    <div class="form-actions">
        <button type="submit" class="btn btn--primary">Task erstellen</button>
        <a href="/tasks" class="btn">Abbrechen</a>
    </div>
</form>

<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>
← Übersicht