suche.html

39 Zeilen · 2,8 KB · HTML
Rohdatei
{% extends 'base.html' %}
{% from 'macros.html' import icon with context %}
{% block title %}Suche{% if q %}: {{ q }}{% endif %}{% endblock %}
{% block content %}
<div class="page-head"><h1>Suche</h1></div>
<form class="search-big" method="get" action="/suche" role="search">
  <input type="search" name="q" value="{{ q }}" placeholder="z. B. Hygieneplan, Autoklav, Handschuhe, Chargennummer …" autofocus>
  <button type="button" class="btn scan-btn" data-scan-go title="Code scannen" aria-label="Code scannen">{{ icon('camera') }}</button>
  <button class="primary">Suchen</button>
</form>

{% if q and not groups %}
{% if scanned and is_leitung and q|length >= 8 and q|length <= 14 and q.isdigit() %}
<div class="callout">Der gescannte Barcode <b>{{ q }}</b> gehört zu keinem Lagerartikel. <a class="btn small primary" href="/lager/neu?barcode={{ q|urlencode }}">Als neuen Artikel anlegen</a></div>
{% endif %}
<div class="panel"><div class="empty">Nichts gefunden für „{{ q }}“. Tipp: kürzere Begriffe oder Wortteile probieren, z. B. „desinf“ statt „Flächendesinfektionsmittel“.</div></div>
{% elif groups %}
<p class="muted">{{ total }} Treffer für „{{ q }}“{% if groups|length > 1 %} – {% for label, ic, items in groups %}<a href="#g{{ loop.index }}">{{ label }} ({{ items|length }}{{ '+' if items|length >= limit }})</a>{{ ' · ' if not loop.last }}{% endfor %}{% endif %}</p>
{% for label, ic, items in groups %}
<div class="panel result-group" id="g{{ loop.index }}">
  <h2>{{ icon(ic) }} {{ label }} <small class="muted">({{ items|length }}{{ '+' if items|length >= limit }})</small></h2>
  <ul class="results">
    {% for r in items %}
    <li>
      <div class="r-title"><a href="{{ r.url }}">{{ r.title }}</a>{% if r.badge %} <span class="badge {{ {'freigegeben': 'ok', 'gesperrt': 'bad', 'offen': 'warn', 'nachbestellen': 'warn', 'Volltext': 'brand'}.get(r.badge, '') }}">{{ r.badge }}</span>{% endif %}</div>
      {% if r.subtitle %}<div class="r-sub">{{ r.subtitle }}</div>{% endif %}
      {% if r.snippet %}<div class="r-snip">{{ r.snippet }}</div>{% endif %}
    </li>
    {% endfor %}
  </ul>
</div>
{% endfor %}
{% else %}
<div class="panel">
  <p>Durchsucht werden <b>QM-Dokumente</b> einschließlich des Textes in PDF- und Word-Dateien sowie <b>Geräte</b> (Name, Seriennummer, Inventarnummer, Standort), <b>Prüfungen</b>, <b>Lagerartikel</b> (auch Barcode und Charge) und <b>Steri-Chargen</b> nach Nummer{% if is_leitung %} und <b>Mitarbeiter</b>{% endif %}.</p>
  <p class="muted" style="margin-bottom:0">Mehrere Wörter = alle müssen vorkommen. Groß-/Kleinschreibung egal, „ae“ findet auch „ä“. Ein eingescannter QR-Code oder Barcode öffnet direkt das Objekt. Tastenkürzel: <kbd>Strg</kbd>+<kbd>K</kbd> oder <kbd>/</kbd>.</p>
</div>
{% endif %}
{% endblock %}