show.php
- Pfad:
src/View/contracts/show.php - Namespace: -
- Zeilen: 138 | Größe: 4,192 Bytes
- Geändert: 2025-12-27 14:06:17 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 100
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Versionen 3
-
v3
2025-12-27 14:06 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v2
2025-12-27 12:50 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v1
2025-12-20 19:16 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
Code
<?php ob_start(); ?>
<nav class="breadcrumb">
<a href="/contracts">Contracts</a> » <?= htmlspecialchars($contract['name']) ?>
</nav>
<h1><?= htmlspecialchars($contract['name']) ?></h1>
<?php if (!empty($validationResult)): ?>
<?php $vr = $validationResult; ?>
<div class="alert alert--<?= $vr['result'] === 'passed' ? 'success' : 'error' ?>">
Validierung: <strong><?= $vr['result'] ?></strong>
(Critical: <?= $vr['critical'] ?>, Major: <?= $vr['major'] ?>, Minor: <?= $vr['minor'] ?>)
</div>
<?php endif; ?>
<table>
<tr>
<th>ID</th>
<td><?= $contract['id'] ?></td>
</tr>
<tr>
<th>UUID</th>
<td><code><?= $contract['uuid'] ?></code></td>
</tr>
<tr>
<th>Version</th>
<td><strong><?= htmlspecialchars($contract['version']) ?></strong></td>
</tr>
<tr>
<th>Status</th>
<td><span class="badge badge--<?= $contract['status'] ?>"><?= $contract['status'] ?></span></td>
</tr>
<tr>
<th>Scope</th>
<td><?= htmlspecialchars($contract['scope_description'] ?? '-') ?></td>
</tr>
<tr>
<th>Erstellt</th>
<td><?= $contract['created_at'] ?> von <?= htmlspecialchars($contract['created_by']) ?></td>
</tr>
<tr>
<th>Aktualisiert</th>
<td><?= $contract['updated_at'] ?></td>
</tr>
</table>
<h2>YAML-Inhalt</h2>
<pre><code><?= htmlspecialchars($contract['yaml_content']) ?></code></pre>
<h2>Aktionen</h2>
<div class="action-bar">
<a href="/contracts/<?= $contract['id'] ?>/edit" class="btn btn--primary">Bearbeiten</a>
<button type="button" class="btn"
hx-post="/contracts/<?= $contract['id'] ?>/validate"
hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
hx-target="#validation-result"
hx-swap="innerHTML"
hx-disabled-elt="this">
Validieren
</button>
<?php if ($contract['status'] !== 'deprecated'): ?>
<button type="button" class="btn btn--danger"
hx-post="/contracts/<?= $contract['id'] ?>/deprecate"
hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
hx-confirm="Contract wirklich als deprecated markieren?"
hx-disabled-elt="this">
Deprecate
</button>
<?php endif; ?>
</div>
<div id="validation-result"></div>
<?php if (!empty($history)): ?>
<h2>Versionshistorie</h2>
<table>
<thead>
<tr>
<th>Version</th>
<th>Geändert am</th>
<th>Von</th>
<th>Beschreibung</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><?= htmlspecialchars($contract['version']) ?></strong> (aktuell)</td>
<td><?= $contract['updated_at'] ?></td>
<td>-</td>
<td>-</td>
</tr>
<?php foreach ($history as $h): ?>
<tr>
<td><?= htmlspecialchars($h['previous_version']) ?></td>
<td><?= $h['changed_at'] ?></td>
<td><?= htmlspecialchars($h['changed_by']) ?></td>
<td><?= htmlspecialchars($h['change_description'] ?? '-') ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php if (!empty($validations)): ?>
<h2>Letzte Validierungen</h2>
<table>
<thead>
<tr>
<th>Datum</th>
<th>Ergebnis</th>
<th>Critical</th>
<th>Major</th>
<th>Minor</th>
<th>Dauer</th>
</tr>
</thead>
<tbody>
<?php foreach ($validations as $v): ?>
<tr>
<td><?= $v['validated_at'] ?></td>
<td><span class="badge badge--<?= $v['result'] === 'passed' ? 'success' : 'failed' ?>"><?= $v['result'] ?></span></td>
<td><?= $v['critical_count'] ?></td>
<td><?= $v['major_count'] ?></td>
<td><?= $v['minor_count'] ?></td>
<td><?= $v['duration_ms'] ?>ms</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<p style="margin-top: 2rem;">
<a href="/contracts">← Zurück zur Übersicht</a>
</p>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>