new.php

Code Hygiene Score: 100

Keine Issues gefunden.

Versionen 3

Code

<?php ob_start(); ?>

<nav class="breadcrumb">
    <a href="/contracts">Contracts</a> &raquo; Neu
</nav>

<h1>Neuer Contract</h1>


<form class="form" style="max-width: 800px;"
      hx-post="/contracts"
      hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
      hx-disabled-elt="button[type=submit]">
    <div class="form-group">
        <label for="name">Name *</label>
        <input type="text" id="name" name="name" class="form-input" required
               placeholder="z.B. view-structure-contract">
    </div>

    <div class="form-group">
        <label for="version">Version</label>
        <input type="text" id="version" name="version" class="form-input" value="1.0"
               placeholder="z.B. 1.0">
    </div>

    <div class="form-group">
        <label for="status">Status</label>
        <select id="status" name="status" class="form-select">
            <option value="active">Aktiv</option>
            <option value="draft">Entwurf</option>
        </select>
    </div>

    <div class="form-group">
        <label for="scope_description">Scope-Beschreibung</label>
        <input type="text" id="scope_description" name="scope_description" class="form-input"
               placeholder="Kurze Beschreibung des Geltungsbereichs">
    </div>

    <div class="form-group">
        <label for="yaml_content">YAML-Inhalt *</label>
        <textarea id="yaml_content" name="yaml_content" class="form-textarea" rows="25" required
                  style="font-family: monospace; font-size: 13px;"
                  placeholder="contract:
  name: my-contract
  version: '1.0'
  status: active
  scope:
    description: Beschreibung
  validation:
    rules: []"></textarea>
    </div>

    <div class="form-actions">
        <button type="submit" class="btn btn--primary">Contract erstellen</button>
        <a href="/contracts" class="btn">Abbrechen</a>
    </div>
</form>

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