OpenNIT

Quelltext des aktuellen Standes

Fassung 1.1.1

knowledge.php

3 KB
<?php $this->layout('layouts/portal', [
    'page_title' => 'Hilfe & Anleitungen',
    'ssp_active' => 'knowledge',
]);
$du = ($portal_address ?? 'du') !== 'sie';
?>
<div class="ssp-hello">
    <h1><?= $this->te('Hilfe &amp; Anleitungen') ?></h1>
    <p><?= $du
        ? $this->te('Vielleicht findest du hier schon die Lösung – ohne auf ein Ticket warten zu müssen.')
        : $this->te('Vielleicht finden Sie hier schon die Lösung – ohne auf ein Ticket warten zu müssen.') ?></p>
</div>

<div class="ssp-card ssp-kb-search">
    <form method="GET" action="/portal/hilfe">
        <div class="ssp-kb-searchrow">
            <label class="ssp-sr-only" for="ssp-kb-q"><?= $du ? $this->te('Wonach suchst du?') : $this->te('Wonach suchen Sie?') ?></label>
            <input type="search" id="ssp-kb-q" name="q" class="form-control" value="<?= $this->e($query ?? '') ?>"
                   placeholder="<?= $du ? $this->te('Wonach suchst du? (z. B. Drucker, VPN, Passwort)') : $this->te('Wonach suchen Sie? (z. B. Drucker, VPN, Passwort)') ?>">
            <button type="submit" class="btn btn-primary"><i class="fas fa-search" aria-hidden="true"></i> <?= $this->te('Suchen') ?></button>
        </div>
    </form>
</div>

<?php if (($query ?? '') !== ''): ?>
    <?php if (empty($results)): ?>
    <div class="ssp-empty">
        <i class="fas fa-book" aria-hidden="true"></i>
        <p>Zu „<?= $this->e($query) ?>" wurde nichts gefunden.</p>
        <a href="/portal/tickets/new" class="btn btn-primary"><i class="fas fa-plus" aria-hidden="true"></i> <?= $this->te('Ticket erstellen') ?></a>
    </div>
    <?php else: ?>
    <div class="ssp-list">
        <?php foreach ($results as $a): ?>
        <a class="ssp-ticket" href="/portal/hilfe/<?= (int)$a['id'] ?>">
            <span class="ssp-ticket-icon"><i class="fas fa-book" aria-hidden="true"></i></span>
            <span class="ssp-ticket-main">
                <span class="ssp-ticket-subject"><?= $this->e($a['title']) ?></span>
                <span class="ssp-ticket-meta"><?= $this->e($a['topic']) ?></span>
            </span>
        </a>
        <?php endforeach; ?>
    </div>
    <p class="ssp-hint" style="margin-top:1rem;">
        <?= $this->t('Nicht das Richtige dabei? <a href="/portal/tickets/new">Ticket erstellen</a>') ?>
    </p>
    <?php endif; ?>
<?php elseif (empty($groups)): ?>
<div class="ssp-empty">
    <i class="fas fa-book" aria-hidden="true"></i>
    <p><?= $this->te('Es sind noch keine Anleitungen veröffentlicht.') ?></p>
</div>
<?php else: ?>
    <?php foreach ($groups as $g): ?>
    <div class="ssp-card ssp-kb-group">
        <h2><span class="ssp-card-icon"><i class="fas fa-folder" aria-hidden="true"></i></span> <?= $this->e($g['topic']) ?></h2>
        <ul class="ssp-kb-list">
            <?php foreach ($g['articles'] as $a): ?>
            <li><a href="/portal/hilfe/<?= (int)$a['id'] ?>"><i class="fas fa-file-alt" aria-hidden="true"></i> <?= $this->e($a['title']) ?></a></li>
            <?php endforeach; ?>
        </ul>
    </div>
    <?php endforeach; ?>
<?php endif; ?>