Backup #1792

ID1792
Dateipfad/var/www/dev.campus.systemische-tools.de/src/View/semantic-explorer/stopwords/index.php
Version2
Typ modified
Größe4.5 KB
Hashc8648a14b07d6f2c87215baa3b48b5305c77e6a39992133d6d4cc0e88ff6f7fa
Datum2025-12-27 14:08:52
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Edit-Operation
Datei existiert Ja

Dateiinhalt

<?php ob_start(); ?>

<nav class="breadcrumb">
    <a href="/">Home</a> &raquo; <a href="/semantic-explorer">Semantic Explorer</a> &raquo; 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($_SESSION['_csrf_token'] ?? '') ?>">
                    <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'; ?>

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
1792 2 modified 4.5 KB 2025-12-27 14:08
1630 1 modified 4.5 KB 2025-12-27 09:45

← Zurück zur Übersicht