new.php

Code Hygiene Score: 100

Keine Issues gefunden.

Versionen 1

Code

<?php

declare(strict_types=1);

// @responsibility: View für neues Stopword mit HTMX-Formular

ob_start();
?>

<nav class="breadcrumb">
    <a href="/">Campus KI</a> &raquo;
    <a href="/semantic-explorer">Semantic Explorer</a> &raquo;
    <a href="/semantic-explorer/stopwords">Stopwords</a> &raquo; Neu
</nav>

<h1>Neues Stopword</h1>

<form id="stopword-form" class="form" style="max-width: 600px;"
      hx-post="/semantic-explorer/stopwords"
      hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
      hx-disabled-elt="button[type=submit]">
    <div class="form-group">
        <label for="word">Wort *</label>
        <input type="text" id="word" name="word" class="form-input" required placeholder="z.B. Menschen, Prozess, System">
        <small class="form-help">Das Wort, das von der Entity-Extraction ausgeschlossen werden soll.</small>
    </div>

    <div class="form-group">
        <label for="category">Kategorie</label>
        <select id="category" name="category" class="form-select">
            <option value="generic">Generisch - Immer ausschliessen</option>
            <option value="domain_specific">Domain-spezifisch - Nur in bestimmten Domaenen</option>
            <option value="context_dependent">Kontextabhaengig - Nur ohne spezifischen Kontext</option>
        </select>
    </div>

    <div class="form-group">
        <label for="reason">Begruendung</label>
        <input type="text" id="reason" name="reason" class="form-input" placeholder="z.B. Zu generisch, Over-Extraction">
        <small class="form-help">Warum dieses Wort ausgeschlossen wird.</small>
    </div>

    <div class="form-group">
        <label class="checkbox-inline">
            <input type="checkbox" name="is_active" value="1" checked>
            Aktiv (wird bei Extraction beruecksichtigt)
        </label>
    </div>

    <div class="form-actions">
        <button type="submit" class="btn btn--primary">Stopword erstellen</button>
        <a href="/semantic-explorer/stopwords" class="btn">Abbrechen</a>
    </div>
</form>

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