Server-Bibliothek
2026-07-23 548bab93e55f6e514557571d3c9da9b1c1d59c35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{% extends "base.html" %}
{% block title %}{{ "Tools hinzufügen" if bestehendes_protokoll else "Neues Protokoll" }} – Server-Bibliothek{% endblock %}
{% block content %}
 
<div class="page-head">
  <div>
    <p class="eyebrow">Protokoll</p>
    <h1>{{ "Weitere Tools für " + bestehendes_protokoll.mitarbeiter if bestehendes_protokoll else "Neues Protokoll anlegen" }}</h1>
  </div>
</div>
 
{% if not software_liste %}
  <div class="empty-state">
    {% if bestehendes_protokoll %}
      Diesem Protokoll sind bereits alle vorhandenen Tools zugewiesen.
      <a href="{{ url_for('protokoll_detail', protokoll_id=bestehendes_protokoll.id) }}">Zurück zum Protokoll</a>.
    {% else %}
      Es ist noch keine Software im Katalog. <a href="{{ url_for('software_neu') }}">Erst ein Tool anlegen</a>.
    {% endif %}
  </div>
{% else %}
<form method="post" class="form-grid">
  {% if bestehendes_protokoll %}
    <input type="hidden" name="protokoll_id" value="{{ bestehendes_protokoll.id }}">
    <div class="panel" style="padding:14px 18px;">
      <div class="kv-row"><span class="kv-label">Mitarbeiter</span><span class="kv-value">{{ bestehendes_protokoll.mitarbeiter }}</span></div>
      <div class="kv-row"><span class="kv-label">Rechnername</span><span class="kv-value">{{ bestehendes_protokoll.rechnername or "–" }}</span></div>
    </div>
  {% else %}
    <div class="field">
      <label for="mitarbeiter">Mitarbeiter *</label>
      <input type="text" id="mitarbeiter" name="mitarbeiter" required placeholder="z. B. Max Mustermann">
    </div>
 
    <div class="field">
      <label for="rechnername">Rechnername</label>
      <input type="text" id="rechnername" name="rechnername" placeholder="z. B. PC-047 oder Notebook-Vertrieb-3">
    </div>
  {% endif %}
 
  <div class="field">
    <label>Software (mehrere möglich) *</label>
    <label class="checklist-kopf">
      <input type="checkbox" id="alle_auswaehlen" onchange="alleUmschalten(this)"> Alle auswählen
    </label>
    <div class="checklist">
      {% for kategorie, gruppe in software_liste | groupby("kategorie") %}
      <div class="checklist-gruppe">
        <div class="checklist-gruppen-titel">{{ kategorie }}</div>
        {% for sw in gruppe %}
        <label class="check-item">
          <input type="checkbox" name="software_ids" value="{{ sw.id }}" class="sw-checkbox" {{ "checked" if sw.id == vorausgewaehlt }}>
          {{ sw.name }}{% if sw.version %} <span class="v">v{{ sw.version }}</span>{% endif %}
        </label>
        {% endfor %}
      </div>
      {% endfor %}
    </div>
  </div>
 
  <div class="field">
    <label for="installiert_am">Datum</label>
    <input type="date" id="installiert_am" name="installiert_am" value="{{ heute }}">
  </div>
 
  <div class="field">
    <label for="installiert_von">Eingerichtet von</label>
    <input type="text" id="installiert_von" name="installiert_von" placeholder="Dein Name">
  </div>
 
  <div class="field">
    <label for="notiz">Notiz</label>
    <textarea id="notiz" name="notiz" rows="3" placeholder="Optional: gilt fuer alle angehakten Tools in dieser Zuweisung"></textarea>
  </div>
 
  <div class="form-actions">
    <button type="submit" class="btn">{{ "Hinzufügen" if bestehendes_protokoll else "Protokoll anlegen" }}</button>
    <a href="{{ url_for('protokoll_detail', protokoll_id=bestehendes_protokoll.id) if bestehendes_protokoll else url_for('protokolle') }}" class="btn btn-secondary">Abbrechen</a>
  </div>
</form>
 
<script>
  function alleUmschalten(quelle) {
    document.querySelectorAll(".sw-checkbox").forEach(function (cb) {
      cb.checked = quelle.checked;
    });
  }
</script>
{% endif %}
 
{% endblock %}