index.php
- Pfad:
src/View/semantic-explorer/stopwords/index.php - Namespace: -
- Zeilen: 112 | Größe: 4,562 Bytes
- Geändert: 2025-12-27 14:08:52 | 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 2
-
v2
2025-12-27 14:08 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v1
2025-12-27 09:45 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
Code
<?php ob_start(); ?>
<nav class="breadcrumb">
<a href="/">Home</a> » <a href="/semantic-explorer">Semantic Explorer</a> » Stopwords
</nav>
<h1>Stopwords</h1>
<p>Filter fuer Entity-Extraction - generische Begriffe ausschliessen.</p>
<div class="stats-grid">
<div class="stat-card stat-card--primary">
<span class="stat-card__value"><?= $stats['total'] ?? 0 ?></span>
<span class="stat-card__label">Gesamt</span>
</div>
<div class="stat-card stat-card--success">
<span class="stat-card__value"><?= $stats['active'] ?? 0 ?></span>
<span class="stat-card__label">Aktiv</span>
</div>
<?php foreach (($stats['by_category'] ?? []) as $cat => $data): ?>
<div class="stat-card">
<span class="stat-card__value"><?= $data['active'] ?>/<?= $data['count'] ?></span>
<span class="stat-card__label"><?= htmlspecialchars(ucfirst(str_replace('_', ' ', $cat))) ?></span>
</div>
<?php endforeach; ?>
</div>
<div class="filters">
<a href="/semantic-explorer/stopwords/new" class="btn btn--primary">+ Neues Stopword</a>
<select id="filter-category" class="form-select--inline" onchange="location.href='/semantic-explorer/stopwords?category='+this.value">
<option value="">Alle Kategorien</option>
<option value="generic" <?= ($currentCategory ?? '') === 'generic' ? 'selected' : '' ?>>Generisch</option>
<option value="domain_specific" <?= ($currentCategory ?? '') === 'domain_specific' ? 'selected' : '' ?>>Domain-spezifisch</option>
<option value="context_dependent" <?= ($currentCategory ?? '') === 'context_dependent' ? 'selected' : '' ?>>Kontextabhaengig</option>
</select>
<label class="checkbox-inline">
<input type="checkbox" onchange="location.href='/semantic-explorer/stopwords?<?= $currentCategory ? 'category='.$currentCategory.'&' : '' ?>all='+(this.checked?'1':'0')" <?= $showAll ? 'checked' : '' ?>>
Inaktive zeigen
</label>
</div>
<?php if (!empty($stopwords)): ?>
<table id="stopwords-table" data-sortable>
<thead>
<tr>
<th data-sort="word">Wort</th>
<th data-sort="canonical_form">Canonical</th>
<th data-sort="category">Kategorie</th>
<th data-sort="reason">Begruendung</th>
<th>Status</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
<?php foreach ($stopwords as $sw): ?>
<tr class="<?= $sw['is_active'] ? '' : 'row--inactive' ?>">
<td><a href="/semantic-explorer/stopwords/<?= $sw['id'] ?>"><?= htmlspecialchars($sw['word']) ?></a></td>
<td><code><?= htmlspecialchars($sw['canonical_form']) ?></code></td>
<td><span class="badge"><?= htmlspecialchars($sw['category']) ?></span></td>
<td><?= htmlspecialchars($sw['reason'] ?? '-') ?></td>
<td>
<?php if ($sw['is_active']): ?>
<span class="badge badge--success">Aktiv</span>
<?php else: ?>
<span class="badge badge--muted">Inaktiv</span>
<?php endif; ?>
</td>
<td>
<form method="post" action="/semantic-explorer/stopwords/<?= $sw['id'] ?>/toggle" style="display:inline;">
<input type="hidden" name="_csrf_token" value="<?= htmlspecialchars($csrfToken ?? '') ?>">
<button type="submit" class="btn btn--small btn--outline">
<?= $sw['is_active'] ? 'Deaktivieren' : 'Aktivieren' ?>
</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p class="empty-state">Keine Stopwords gefunden.</p>
<?php endif; ?>
<p class="links-bar">
<a href="/semantic-explorer">Zurueck zum Explorer</a> |
<a href="/semantic-explorer/entitaeten">Entitäten</a>
</p>
<script type="module">
import { init } from '/js/components/data-table.js';
const dataTable = init({
clock: { now_epoch_ms_utc: () => Date.now() },
logger: console,
ui: {
showMessage: (msg) => { console.log(msg.type + ': ' + msg.text); },
disableFeature: (key) => { console.warn('Feature disabled: ' + key); },
offerRetry: () => Promise.resolve(false)
},
runId: crypto.randomUUID()
});
dataTable.create('stopwords-table', {
pageSize: 50,
filters: {
'filter-category': 2
}
});
</script>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>