Organisations-Admins bekommen erstmals Zugriff auf die Workspace-
Komposition (bisher exklusiv /admin/technik/workspaces vorbehalten,
ADR-0028 hatte das als "zunaechst admin-only" offen gelassen).
- routers/workspace.py (Neubau, ersetzt den Phase-1-Platzhalter):
/workspace (eigene Workspaces + bereitgestellte globale Standards,
ueber den bestehenden ADR-0028-Endpunkt), /workspace (POST, anlegen -
organization_id kommt nie aus dem Formular), /workspace/{id} (Detail:
eigener Workspace -> volle Kategorie-Checkbox-Komposition, Wiederver-
wendung von admin_technik.gruppiere_merkmale_nach_kategorie(); globaler
Standard -> reine Leseansicht, kein Formular).
- Webapps-Verwaltung zieht von der bisherigen eigenen Seite (/webapps)
hierher um (workspace_detail.html, nur fuer eigene Workspaces sichtbar)
- alte Route bleibt nur noch als 301-Redirect auf /workspace bestehen.
- Neue Besitz-/Sichtbarkeitspruefung fetch_sichtbaren_workspace() (eigene
Organisation ODER global sichtbar, sonst 404) analog zum bestehenden
find_oe_in_organization()-Muster.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLk93dhDMrkPXefVdknMV9
123 lines
4.7 KiB
HTML
123 lines
4.7 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}{{ workspace.name if workspace else workspace_id }} — Tuxflotte{% endblock %}
|
|
{% block content %}
|
|
<p><a href="/workspace">← Workspace</a></p>
|
|
<h2>{{ workspace.name }}</h2>
|
|
<p>
|
|
{% if bearbeitbar %}Eigener Workspace{% else %}Bereitgestellter Standard <small>(schreibgeschützt)</small>{% endif %}
|
|
{% if workspace.description %} — {{ workspace.description }}{% endif %}
|
|
</p>
|
|
|
|
<section>
|
|
<h3>Zusammensetzung</h3>
|
|
{% if bearbeitbar %}
|
|
<p><small>
|
|
Angehakte Merkmale gehören zum Grundbestand dieses Workspace - gilt
|
|
additiv für alle Geräte, die ihm zugewiesen sind (per
|
|
Installationsmedium, oder nachträglich per Gerätegruppe mit
|
|
eigenem Workspace).
|
|
</small></p>
|
|
{% if not kategorien %}
|
|
<p>Keine katalogfähigen Merkmale vorhanden.</p>
|
|
{% else %}
|
|
<form method="post" action="/workspace/{{ workspace_id }}/merkmale">
|
|
{% for kategorie_name, eintraege in kategorien.items() %}
|
|
<fieldset>
|
|
<legend><strong>{{ kategorie_name }}</strong></legend>
|
|
{% for m in eintraege %}
|
|
<label>
|
|
<input type="checkbox" name="merkmal_ids" value="{{ m.id }}" {% if m.zugeordnet %}checked{% endif %}>
|
|
{{ m.name }}
|
|
{% if m.description %}<br><small>{{ m.description }}</small>{% endif %}
|
|
</label>
|
|
{% endfor %}
|
|
</fieldset>
|
|
{% endfor %}
|
|
<button type="submit">Zusammensetzung speichern</button>
|
|
</form>
|
|
{% endif %}
|
|
{% else %}
|
|
{% for kategorie_name, eintraege in kategorien.items() %}
|
|
{% set zugeordnete = eintraege | selectattr("zugeordnet") | list %}
|
|
{% if zugeordnete %}
|
|
<p><strong>{{ kategorie_name }}</strong></p>
|
|
<ul>
|
|
{% for m in zugeordnete %}
|
|
<li>{{ m.name }}{% if m.description %} — <small>{{ m.description }}</small>{% endif %}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
</section>
|
|
|
|
{% if bearbeitbar %}
|
|
<section>
|
|
<h3>Webapps</h3>
|
|
<p><small>URLs, die auf den Geräten dieses Workspace als Menü-/Desktop-Verknüpfung mit dem Favicon der Seite erscheinen.</small></p>
|
|
|
|
{% if webapps %}
|
|
<figure>
|
|
<table>
|
|
<tbody>
|
|
{% for webapp in webapps %}
|
|
<tr>
|
|
<td style="width:2rem">
|
|
{% if webapp.icon_path %}
|
|
<img src="/webapp-icons/{{ webapp.icon_path.split('/')[-1] }}" alt="" width="24" height="24"
|
|
title="Bild verlinkt zum Betreiber ({{ webapp.url }})">
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ webapp.name }}<br><small><a href="{{ webapp.url }}" target="_blank" rel="noopener">{{ webapp.url }}</a></small></td>
|
|
<td>
|
|
<form method="post" action="/workspace/{{ workspace_id }}/webapps/{{ webapp.id }}/entfernen">
|
|
<button type="submit" class="secondary outline">Entfernen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</figure>
|
|
{% else %}
|
|
<p><small>Noch keine Webapps für diesen Workspace.</small></p>
|
|
{% endif %}
|
|
|
|
{% if verfuegbare_vorlagen %}
|
|
<details>
|
|
<summary role="button" class="outline">Vorlage aktivieren</summary>
|
|
<table>
|
|
<tbody>
|
|
{% for vorlage in verfuegbare_vorlagen %}
|
|
<tr>
|
|
<td style="width:2rem">
|
|
{% if vorlage.icon_path %}
|
|
<img src="/webapp-icons/{{ vorlage.icon_path.split('/')[-1] }}" alt="" width="24" height="24"
|
|
title="Bild verlinkt zum Betreiber ({{ vorlage.url }})">
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ vorlage.name }}{% if vorlage.description %}<br><small>{{ vorlage.description }}</small>{% endif %}</td>
|
|
<td>
|
|
<form method="post" action="/workspace/{{ workspace_id }}/vorlagen/{{ vorlage.id }}/aktivieren">
|
|
<button type="submit" class="secondary outline">Aktivieren</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</details>
|
|
{% endif %}
|
|
|
|
<details>
|
|
<summary role="button" class="secondary outline">Eigene Webapp hinzufügen</summary>
|
|
<form method="post" action="/workspace/{{ workspace_id }}/webapps">
|
|
<label>Name<input type="text" name="name" required placeholder="z.B. Schulportal"></label>
|
|
<label>URL<input type="url" name="url" required placeholder="https://..."></label>
|
|
<button type="submit">Hinzufügen</button>
|
|
</form>
|
|
</details>
|
|
</section>
|
|
{% endif %}
|
|
{% endblock %}
|