feat(i18n): use English source strings with German translation
Wrap all user-visible strings for translation, ship a complete German catalogue, align the NetBox version range (4.4.0-4.7.x) with the README and add a test that keeps them in sync. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
e6995630e9
commit
f557e7d49d
33 files changed
+1564
-314
No files matched your search
@@ -1,4 +1,5 @@
|
||||
{% extends 'generic/object.html' %}
|
||||
{% load i18n %}
|
||||
{% load helpers %}
|
||||
{% block head %}
|
||||
{{ block.super }}
|
||||
@@ -109,30 +110,30 @@
|
||||
{% endblock head %}
|
||||
{% block extra_controls %}
|
||||
<button type="button" id="documentation-fullscreen" class="btn btn-outline-secondary">
|
||||
<i class="mdi mdi-arrow-expand-all"></i> Großansicht
|
||||
<i class="mdi mdi-arrow-expand-all"></i> {% trans "Focus view" %}
|
||||
</button>
|
||||
<a href="{% url 'plugins:netbox_documentation:document_print' pk=object.pk %}" target="_blank" class="btn btn-outline-secondary">
|
||||
<i class="mdi mdi-printer"></i> Drucken / PDF
|
||||
<i class="mdi mdi-printer"></i> {% trans "Print / PDF" %}
|
||||
</a>
|
||||
{% endblock extra_controls %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col col-md-9" id="documentation-viewer">
|
||||
<h1 class="fullscreen-document-title">{{ object.title }}</h1>
|
||||
<button type="button" class="btn btn-secondary fullscreen-exit" id="documentation-fullscreen-exit"><i class="mdi mdi-arrow-collapse-all"></i> Großansicht beenden</button>
|
||||
<button type="button" class="btn btn-secondary fullscreen-exit" id="documentation-fullscreen-exit"><i class="mdi mdi-arrow-collapse-all"></i> {% trans "Exit focus view" %}</button>
|
||||
{% if object.summary %}<p class="lead">{{ object.summary }}</p>{% endif %}
|
||||
<div class="card"><div class="card-body rendered-markdown documentation-content">{{ object.rendered_body|safe }}</div></div>
|
||||
</div>
|
||||
<div class="col col-md-3">
|
||||
{% if object.tenant_group or object.tenant %}<div class="card mb-3"><h5 class="card-header">Mandantenzuordnung</h5><div class="list-group list-group-flush">
|
||||
{% if object.tenant_group or object.tenant %}<div class="card mb-3"><h5 class="card-header">{% trans "Tenancy" %}</h5><div class="list-group list-group-flush">
|
||||
{% if object.tenant_group %}<a class="list-group-item list-group-item-action" href="{{ object.tenant_group.get_absolute_url }}"><i class="mdi mdi-account-group"></i> {{ object.tenant_group }}</a>{% endif %}
|
||||
{% if object.tenant %}<a class="list-group-item list-group-item-action" href="{{ object.tenant.get_absolute_url }}"><i class="mdi mdi-domain"></i> {{ object.tenant }}</a>{% endif %}
|
||||
</div></div>{% endif %}
|
||||
{% if object.category %}<div class="card mb-3"><h5 class="card-header">Ordner</h5><a class="list-group-item list-group-item-action" href="{{ object.category.get_absolute_url }}"><i class="mdi mdi-folder"></i> {{ object.category }}</a></div>{% endif %}
|
||||
<div class="card"><h5 class="card-header">Zuordnungen</h5><div class="list-group list-group-flush">
|
||||
{% for assignment in object.assignments.all %}<a class="list-group-item" href="{{ assignment.assigned_object.get_absolute_url }}">{{ assignment.assigned_object_type }}: {{ assignment.assigned_object }}</a>{% empty %}<div class="list-group-item text-muted">Noch nicht zugeordnet</div>{% endfor %}
|
||||
{% if object.category %}<div class="card mb-3"><h5 class="card-header">{% trans "Folder" %}</h5><a class="list-group-item list-group-item-action" href="{{ object.category.get_absolute_url }}"><i class="mdi mdi-folder"></i> {{ object.category }}</a></div>{% endif %}
|
||||
<div class="card"><h5 class="card-header">{% trans "Assignments" %}</h5><div class="list-group list-group-flush">
|
||||
{% for assignment in object.assignments.all %}<a class="list-group-item" href="{{ assignment.assigned_object.get_absolute_url }}">{{ assignment.assigned_object_type }}: {{ assignment.assigned_object }}</a>{% empty %}<div class="list-group-item text-muted">{% trans "Not assigned yet" %}</div>{% endfor %}
|
||||
</div></div>
|
||||
{% if object.attachments.all %}<div class="card mt-3"><h5 class="card-header">Originaldateien</h5><div class="list-group list-group-flush">
|
||||
{% if object.attachments.all %}<div class="card mt-3"><h5 class="card-header">{% trans "Original files" %}</h5><div class="list-group list-group-flush">
|
||||
{% for attachment in object.attachments.all %}<a class="list-group-item" href="{{ attachment.file.url }}">{{ attachment.original_name }}</a>{% endfor %}
|
||||
</div></div>{% endif %}
|
||||
</div>
|
||||
@@ -159,7 +160,7 @@
|
||||
openButton.addEventListener('click', openViewer);
|
||||
closeButton.addEventListener('click', closeViewer);
|
||||
viewer.querySelectorAll('.documentation-content table').forEach(table => {
|
||||
table.title = 'Tabelle in Großansicht öffnen';
|
||||
table.title = '{{ _("Open table in focus view")|escapejs }}';
|
||||
table.addEventListener('click', event => {
|
||||
if (viewer.classList.contains('documentation-page-focus')) return;
|
||||
if (event.target.closest('a, button, input, select, textarea')) return;
|
||||
@@ -174,7 +175,7 @@
|
||||
const copyButton = document.createElement('button');
|
||||
copyButton.type = 'button';
|
||||
copyButton.className = 'doc-code-copy';
|
||||
copyButton.innerHTML = '<i class="mdi mdi-content-copy"></i> Kopieren';
|
||||
copyButton.innerHTML = '<i class="mdi mdi-content-copy"></i> {{ _("Copy")|escapejs }}';
|
||||
copyButton.addEventListener('click', async () => {
|
||||
const text = pre.innerText.trimEnd();
|
||||
try {
|
||||
@@ -190,8 +191,8 @@
|
||||
document.execCommand('copy');
|
||||
area.remove();
|
||||
}
|
||||
copyButton.innerHTML = '<i class="mdi mdi-check"></i> Kopiert';
|
||||
setTimeout(() => { copyButton.innerHTML = '<i class="mdi mdi-content-copy"></i> Kopieren'; }, 1500);
|
||||
copyButton.innerHTML = '<i class="mdi mdi-check"></i> {{ _("Copied")|escapejs }}';
|
||||
setTimeout(() => { copyButton.innerHTML = '<i class="mdi mdi-content-copy"></i> {{ _("Copy")|escapejs }}'; }, 1500);
|
||||
});
|
||||
wrapper.appendChild(copyButton);
|
||||
if (pre.dataset.lang) {
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load form_helpers %}
|
||||
|
||||
{% block title %}Dokumentationsarchiv{% endblock %}
|
||||
{% block title %}{% trans "Documentation archive" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row g-4">
|
||||
<div class="col-12 col-xl-6">
|
||||
<div class="card h-100">
|
||||
<h5 class="card-header"><i class="mdi mdi-folder-zip"></i> Dokumentationen exportieren</h5>
|
||||
<h5 class="card-header"><i class="mdi mdi-folder-zip"></i> {% trans "Export documents" %}</h5>
|
||||
<div class="card-body">
|
||||
<p>Mehrere Ordner suchen und hinzufügen. Alle enthaltenen Dokumentationen werden gemeinsam mit Objektzuordnungen und Anhängen heruntergeladen.</p>
|
||||
<p>{% trans "Search for and add several folders. All contained documents are downloaded together with their object assignments and attachments." %}</p>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="export">
|
||||
{% render_form export_form %}
|
||||
<button type="submit" class="btn btn-primary"><i class="mdi mdi-download"></i> ZIP herunterladen</button>
|
||||
<button type="submit" class="btn btn-primary"><i class="mdi mdi-download"></i> {% trans "Download ZIP" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-xl-6">
|
||||
<div class="card h-100">
|
||||
<h5 class="card-header"><i class="mdi mdi-folder-upload"></i> Dokumentationen importieren</h5>
|
||||
<h5 class="card-header"><i class="mdi mdi-folder-upload"></i> {% trans "Import documents" %}</h5>
|
||||
<div class="card-body">
|
||||
<p>Ein zuvor mit diesem Plugin erzeugtes ZIP-Archiv hochladen. Nicht vorhandene NetBox-Zielobjekte werden sicher übersprungen.</p>
|
||||
<p>{% trans "Upload a ZIP archive previously created with this plugin. Missing NetBox target objects are skipped safely." %}</p>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="import">
|
||||
{% render_form import_form %}
|
||||
<button type="submit" class="btn btn-primary"><i class="mdi mdi-upload"></i> ZIP importieren</button>
|
||||
<button type="submit" class="btn btn-primary"><i class="mdi mdi-upload"></i> {% trans "Import ZIP" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{% extends 'generic/object_edit.html' %}
|
||||
{% load i18n %}
|
||||
{% block javascript %}
|
||||
{{ block.super }}
|
||||
<style>
|
||||
@@ -19,7 +20,7 @@
|
||||
if (editor) {
|
||||
const warning = document.createElement('div');
|
||||
warning.className = 'alert alert-warning';
|
||||
warning.textContent = 'Der Rich-Text-Editor konnte nicht vom lokalen Plugin-Endpunkt geladen werden. Bitte Browser-Konsole und Netzwerkprotokoll prüfen.';
|
||||
warning.textContent = '{{ _("The rich text editor could not be loaded from the local plugin endpoint. Please check the browser console and network log.")|escapejs }}';
|
||||
editor.parentNode.insertBefore(warning, editor);
|
||||
}
|
||||
return;
|
||||
@@ -29,6 +30,9 @@
|
||||
base_url: editorAssetBase.replace(/\/$/, ''),
|
||||
suffix: '.min',
|
||||
license_key: 'gpl',
|
||||
{% get_current_language as LANGUAGE_CODE %}{% if LANGUAGE_CODE|slice:":2" == 'de' %}language: 'de',
|
||||
language_url: editorAssetBase.replace(/\/$/, '') + '/langs/de.js',
|
||||
{% endif %}
|
||||
height: 650,
|
||||
menubar: 'file edit view insert format tools table help',
|
||||
plugins: 'advlist anchor autolink charmap code codesample fullscreen image link lists media preview searchreplace table visualblocks wordcount',
|
||||
@@ -46,29 +50,29 @@
|
||||
table_default_attributes: {border: '1'},
|
||||
table_default_styles: {'border-collapse': 'collapse'},
|
||||
table_class_list: [
|
||||
{title: 'Standard mit Rahmen', value: 'doc-table-bordered'},
|
||||
{title: 'Kompakt', value: 'doc-table-compact'},
|
||||
{title: 'Gestreifte Zeilen', value: 'doc-table-striped'},
|
||||
{title: 'Blaue Kopfzeile', value: 'doc-table-header-blue'},
|
||||
{title: 'Grüne Kopfzeile', value: 'doc-table-header-green'},
|
||||
{title: 'Dunkle Kopfzeile', value: 'doc-table-header-dark'},
|
||||
{title: 'Ohne Rahmen', value: 'doc-table-borderless'},
|
||||
{title: 'Volle Breite', value: 'doc-table-full-width'}
|
||||
{title: '{{ _("Standard with borders")|escapejs }}', value: 'doc-table-bordered'},
|
||||
{title: '{{ _("Compact")|escapejs }}', value: 'doc-table-compact'},
|
||||
{title: '{{ _("Striped rows")|escapejs }}', value: 'doc-table-striped'},
|
||||
{title: '{{ _("Blue header")|escapejs }}', value: 'doc-table-header-blue'},
|
||||
{title: '{{ _("Green header")|escapejs }}', value: 'doc-table-header-green'},
|
||||
{title: '{{ _("Dark header")|escapejs }}', value: 'doc-table-header-dark'},
|
||||
{title: '{{ _("No borders")|escapejs }}', value: 'doc-table-borderless'},
|
||||
{title: '{{ _("Full width")|escapejs }}', value: 'doc-table-full-width'}
|
||||
],
|
||||
table_cell_class_list: [
|
||||
{title: 'Normal', value: ''},
|
||||
{title: 'Gelb hervorheben', value: 'doc-cell-yellow'},
|
||||
{title: 'Grün hervorheben', value: 'doc-cell-green'},
|
||||
{title: 'Rot hervorheben', value: 'doc-cell-red'},
|
||||
{title: 'Blau hervorheben', value: 'doc-cell-blue'},
|
||||
{title: 'Vertikal mittig', value: 'doc-cell-middle'}
|
||||
{title: '{{ _("Normal")|escapejs }}', value: ''},
|
||||
{title: '{{ _("Highlight yellow")|escapejs }}', value: 'doc-cell-yellow'},
|
||||
{title: '{{ _("Highlight green")|escapejs }}', value: 'doc-cell-green'},
|
||||
{title: '{{ _("Highlight red")|escapejs }}', value: 'doc-cell-red'},
|
||||
{title: '{{ _("Highlight blue")|escapejs }}', value: 'doc-cell-blue'},
|
||||
{title: '{{ _("Vertically centred")|escapejs }}', value: 'doc-cell-middle'}
|
||||
],
|
||||
style_formats_merge: true,
|
||||
style_formats: [
|
||||
{title: 'Tabellenzelle: Gelb', selector: 'td,th', classes: 'doc-cell-yellow'},
|
||||
{title: 'Tabellenzelle: Grün', selector: 'td,th', classes: 'doc-cell-green'},
|
||||
{title: 'Tabellenzelle: Rot', selector: 'td,th', classes: 'doc-cell-red'},
|
||||
{title: 'Tabellenzelle: Blau', selector: 'td,th', classes: 'doc-cell-blue'}
|
||||
{title: '{{ _("Table cell: yellow")|escapejs }}', selector: 'td,th', classes: 'doc-cell-yellow'},
|
||||
{title: '{{ _("Table cell: green")|escapejs }}', selector: 'td,th', classes: 'doc-cell-green'},
|
||||
{title: '{{ _("Table cell: red")|escapejs }}', selector: 'td,th', classes: 'doc-cell-red'},
|
||||
{title: '{{ _("Table cell: blue")|escapejs }}', selector: 'td,th', classes: 'doc-cell-blue'}
|
||||
],
|
||||
font_family_formats: 'Arial=arial,helvetica,sans-serif; Calibri=calibri,arial,sans-serif; Courier New=courier new,courier,monospace; Georgia=georgia,palatino,serif; Times New Roman=times new roman,times,serif; Verdana=verdana,geneva,sans-serif',
|
||||
font_size_formats: '8pt 9pt 10pt 11pt 12pt 14pt 16pt 18pt 20pt 24pt 28pt 32pt 36pt 48pt',
|
||||
@@ -95,14 +99,14 @@
|
||||
codesample_languages: [
|
||||
{text: 'Bash / Shell', value: 'bash'},
|
||||
{text: 'PowerShell', value: 'powershell'},
|
||||
{text: 'Cisco / Netzwerk-Konfiguration', value: 'none'},
|
||||
{text: '{{ _("Cisco / network configuration")|escapejs }}', value: 'none'},
|
||||
{text: 'Python', value: 'python'},
|
||||
{text: 'JSON', value: 'json'},
|
||||
{text: 'YAML', value: 'yaml'},
|
||||
{text: 'SQL', value: 'sql'},
|
||||
{text: 'HTML/XML', value: 'markup'},
|
||||
{text: 'JavaScript', value: 'javascript'},
|
||||
{text: 'Nur Text', value: 'plaintext'}
|
||||
{text: '{{ _("Plain text")|escapejs }}', value: 'plaintext'}
|
||||
],
|
||||
browser_spellcheck: true,
|
||||
contextmenu: 'link image table codesample',
|
||||
@@ -127,7 +131,7 @@
|
||||
if (!file) return;
|
||||
const allowedTypes = ['image/png', 'image/jpeg', 'image/gif', 'image/webp'];
|
||||
if (!allowedTypes.includes(file.type)) {
|
||||
window.alert('Unterstützt werden PNG, JPEG, GIF und WebP.');
|
||||
window.alert('{{ _("Supported formats are PNG, JPEG, GIF and WebP.")|escapejs }}');
|
||||
return;
|
||||
}
|
||||
const reader = new FileReader();
|
||||
@@ -135,7 +139,7 @@
|
||||
alt: file.name,
|
||||
title: file.name
|
||||
}));
|
||||
reader.addEventListener('error', () => window.alert('Das Bild konnte nicht gelesen werden.'));
|
||||
reader.addEventListener('error', () => window.alert('{{ _("The image could not be read.")|escapejs }}'));
|
||||
reader.readAsDataURL(file);
|
||||
}, {once: true});
|
||||
picker.click();
|
||||
@@ -170,13 +174,13 @@
|
||||
picker.click();
|
||||
};
|
||||
const palette = [
|
||||
['Gelb', '#fff3bf'], ['Grün', '#d3f9d8'], ['Blau', '#dbeafe'],
|
||||
['Rot', '#ffe3e3'], ['Orange', '#ffe8cc'], ['Grau', '#e9ecef'],
|
||||
['Dunkelgrün', '#a5bf60'], ['Dunkelblau', '#206bc4'], ['Dunkelgrau', '#343a40']
|
||||
['{{ _("Yellow")|escapejs }}', '#fff3bf'], ['{{ _("Green")|escapejs }}', '#d3f9d8'], ['{{ _("Blue")|escapejs }}', '#dbeafe'],
|
||||
['{{ _("Red")|escapejs }}', '#ffe3e3'], ['{{ _("Orange")|escapejs }}', '#ffe8cc'], ['{{ _("Grey")|escapejs }}', '#e9ecef'],
|
||||
['{{ _("Dark green")|escapejs }}', '#a5bf60'], ['{{ _("Dark blue")|escapejs }}', '#206bc4'], ['{{ _("Dark grey")|escapejs }}', '#343a40']
|
||||
];
|
||||
editor.ui.registry.addMenuButton('tablecellcolor', {
|
||||
icon: 'highlight-bg-color',
|
||||
tooltip: 'Farbeimer für Tabellenzellen',
|
||||
tooltip: '{{ _("Table cell colour")|escapejs }}',
|
||||
fetch: callback => callback([
|
||||
...palette.map(([name, color]) => ({
|
||||
type: 'menuitem',
|
||||
@@ -184,8 +188,8 @@
|
||||
onAction: () => applyCellColor(color)
|
||||
})),
|
||||
{type: 'separator'},
|
||||
{type: 'menuitem', text: 'Eigene Farbe …', onAction: chooseCellColor},
|
||||
{type: 'menuitem', text: 'Zellfarbe entfernen', onAction: () => applyCellColor('')}
|
||||
{type: 'menuitem', text: '{{ _("Custom colour …")|escapejs }}', onAction: chooseCellColor},
|
||||
{type: 'menuitem', text: '{{ _("Remove cell colour")|escapejs }}', onAction: () => applyCellColor('')}
|
||||
])
|
||||
});
|
||||
}
|
||||
@@ -202,7 +206,7 @@
|
||||
credentials: 'same-origin'
|
||||
}).then(async response => {
|
||||
const payload = await response.json();
|
||||
if (!response.ok) throw new Error(payload.error || 'Upload fehlgeschlagen');
|
||||
if (!response.ok) throw new Error(payload.error || '{{ _("Upload failed")|escapejs }}');
|
||||
resolve(payload.location);
|
||||
}).catch(error => reject(error.message));
|
||||
})
|
||||
@@ -214,6 +218,6 @@
|
||||
|
||||
{% block pre_form_fields %}
|
||||
{% if not object.pk %}
|
||||
<div class="alert alert-info">Eingefügte oder hineinkopierte Bilder werden beim ersten Speichern automatisch als Medien der neuen Dokumentation abgelegt. Nach dem ersten Speichern ist zusätzlich der direkte Bildupload verfügbar.</div>
|
||||
<div class="alert alert-info">{% trans "Pasted images are stored automatically as media of the new document when it is first saved. After the first save, direct image upload is also available." %}</div>
|
||||
{% endif %}
|
||||
{% endblock pre_form_fields %}
|
||||
@@ -1,15 +1,16 @@
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load form_helpers %}
|
||||
{% block title %}Dokument importieren{% endblock %}
|
||||
{% block title %}{% trans "Import document" %}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row justify-content-center"><div class="col col-md-8"><div class="card">
|
||||
<h5 class="card-header">Word, Excel oder PDF importieren</h5>
|
||||
<h5 class="card-header">{% trans "Import Word, Excel or PDF" %}</h5>
|
||||
<div class="card-body"><form method="post" enctype="multipart/form-data">{% csrf_token %}{% render_form form %}
|
||||
<div class="text-muted mb-3">
|
||||
Importhinweise
|
||||
<span class="mdi mdi-help-circle-outline" data-bs-toggle="tooltip" title="DOCX übernimmt Überschriften, Listen und Tabellen. Beim normalen XLSX-Import werden alle Blätter zusammengeführt. Der Mehrblattimport erzeugt je Blatt eine Dokumentation im Zielordner. PDF benötigt eine echte Textebene; Scan-OCR ist nicht enthalten." aria-label="Importhinweise"></span>
|
||||
{% trans "Import notes" %}
|
||||
<span class="mdi mdi-help-circle-outline" data-bs-toggle="tooltip" title="{% trans "DOCX keeps headings, lists and tables. A regular XLSX import merges all sheets. The multi-sheet import creates one document per sheet in the target folder. PDF requires a real text layer; OCR for scans is not included." %}" aria-label="{% trans "Import notes" %}"></span>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Importieren</button>
|
||||
<button type="submit" class="btn btn-primary">{% trans "Import" %}</button>
|
||||
</form></div>
|
||||
</div></div></div>
|
||||
{% endblock %}
|
||||
@@ -1,9 +1,10 @@
|
||||
{% load i18n %}
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
{% get_current_language as LANGUAGE_CODE %}<html lang="{{ LANGUAGE_CODE }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ object.title }} – Druckansicht</title>
|
||||
<title>{{ object.title }} – {% trans "Print view" %}</title>
|
||||
<style>
|
||||
:root { color-scheme: light; }
|
||||
* { box-sizing: border-box; }
|
||||
@@ -56,19 +57,19 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="toolbar">
|
||||
<button type="button" onclick="window.print()">Drucken / Als PDF speichern</button>
|
||||
<a href="?orientation=portrait"{% if request.GET.orientation != 'landscape' %} class="active"{% endif %}>Hochformat</a>
|
||||
<a href="?orientation=landscape"{% if request.GET.orientation == 'landscape' %} class="active"{% endif %}>Querformat</a>
|
||||
<a href="{{ object.get_absolute_url }}">Zurück zur Dokumentation</a>
|
||||
<button type="button" onclick="window.print()">{% trans "Print / save as PDF" %}</button>
|
||||
<a href="?orientation=portrait"{% if request.GET.orientation != 'landscape' %} class="active"{% endif %}>{% trans "Portrait" %}</a>
|
||||
<a href="?orientation=landscape"{% if request.GET.orientation == 'landscape' %} class="active"{% endif %}>{% trans "Landscape" %}</a>
|
||||
<a href="{{ object.get_absolute_url }}">{% trans "Back to document" %}</a>
|
||||
</div>
|
||||
<article{% if request.GET.orientation == 'landscape' %} class="landscape"{% endif %}>
|
||||
<header>
|
||||
<h1>{{ object.title }}</h1>
|
||||
{% if object.summary %}<p class="summary">{{ object.summary }}</p>{% endif %}
|
||||
<div class="meta">
|
||||
{% if object.category %}<span>Ordner: {{ object.category }}</span>{% endif %}
|
||||
<span>Stand: {{ object.last_updated|date:"d.m.Y H:i" }}</span>
|
||||
{% if object.assignments.all %}<span>Zugeordnet: {% for assignment in object.assignments.all %}{{ assignment.assigned_object }}{% if not forloop.last %}, {% endif %}{% endfor %}</span>{% endif %}
|
||||
{% if object.category %}<span>{% trans "Folder" %}: {{ object.category }}</span>{% endif %}
|
||||
<span>{% trans "Last updated" %}: {{ object.last_updated|date:"SHORT_DATETIME_FORMAT" }}</span>
|
||||
{% if object.assignments.all %}<span>{% trans "Assigned to" %}: {% for assignment in object.assignments.all %}{{ assignment.assigned_object }}{% if not forloop.last %}, {% endif %}{% endfor %}</span>{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
<main class="content">{{ object.rendered_body|safe }}</main>
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Dokumentationen{% endblock %}
|
||||
{% block title %}{% trans "Documents" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row mb-3">
|
||||
<div class="col d-flex justify-content-between align-items-center flex-wrap gap-2">
|
||||
<input type="search" id="doc-tree-search" class="form-control" style="max-width: 20rem;" placeholder="Dokumente & Ordner durchsuchen…">
|
||||
<input type="search" id="doc-tree-search" class="form-control" style="max-width: 20rem;" placeholder="{% trans "Search documents & folders…" %}">
|
||||
<div class="d-flex gap-2">
|
||||
{% if perms.netbox_documentation.add_document %}
|
||||
<a href="{% url 'plugins:netbox_documentation:document_add' %}" class="btn btn-success" id="doc-add-document" data-base="{% url 'plugins:netbox_documentation:document_add' %}"><i class="mdi mdi-plus-thick"></i> Hinzufügen</a>
|
||||
<a href="{% url 'plugins:netbox_documentation:document_add' %}" class="btn btn-success" id="doc-add-document" data-base="{% url 'plugins:netbox_documentation:document_add' %}"><i class="mdi mdi-plus-thick"></i> {% trans "Add" %}</a>
|
||||
{% endif %}
|
||||
{% if perms.netbox_documentation.add_documentcategory %}
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_add' %}" class="btn btn-outline-success" id="doc-add-folder" data-base="{% url 'plugins:netbox_documentation:documentcategory_add' %}"><i class="mdi mdi-folder-plus-outline"></i> Neuer Ordner</a>
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_add' %}" class="btn btn-outline-success" id="doc-add-folder" data-base="{% url 'plugins:netbox_documentation:documentcategory_add' %}"><i class="mdi mdi-folder-plus-outline"></i> {% trans "New folder" %}</a>
|
||||
{% endif %}
|
||||
<div class="btn-group" role="group" aria-label="Ansicht">
|
||||
<button type="button" class="btn btn-outline-secondary" data-view="explorer" title="Explorer-Ansicht"><i class="mdi mdi-view-grid-outline"></i> Explorer</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-view="tree" title="Baumansicht"><i class="mdi mdi-file-tree"></i> Baum</button>
|
||||
<a href="{% url 'plugins:netbox_documentation:document_list' %}" class="btn btn-outline-secondary" title="Listenansicht"><i class="mdi mdi-format-list-bulleted"></i> Liste</a>
|
||||
<div class="btn-group" role="group" aria-label="{% trans "View" %}">
|
||||
<button type="button" class="btn btn-outline-secondary" data-view="explorer" title="{% trans "Explorer view" %}"><i class="mdi mdi-view-grid-outline"></i> {% trans "Explorer" %}</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-view="tree" title="{% trans "Tree view" %}"><i class="mdi mdi-file-tree"></i> {% trans "Tree" %}</button>
|
||||
<a href="{% url 'plugins:netbox_documentation:document_list' %}" class="btn btn-outline-secondary" title="{% trans "List view" %}"><i class="mdi mdi-format-list-bulleted"></i> {% trans "List" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,14 +26,14 @@
|
||||
{% if tree or uncategorized %}
|
||||
<div class="card netbox-explorer" id="doc-explorer" hidden>
|
||||
<div class="card-header d-flex align-items-center gap-2 py-2">
|
||||
<button type="button" class="btn btn-sm btn-ghost-secondary" id="doc-explorer-back" title="Zurück"><i class="mdi mdi-arrow-left"></i></button>
|
||||
<button type="button" class="btn btn-sm btn-ghost-secondary" id="doc-explorer-up" title="Übergeordneter Ordner (Rücktaste)"><i class="mdi mdi-arrow-up"></i></button>
|
||||
<button type="button" class="btn btn-sm btn-ghost-secondary" id="doc-explorer-back" title="{% trans "Back" %}"><i class="mdi mdi-arrow-left"></i></button>
|
||||
<button type="button" class="btn btn-sm btn-ghost-secondary" id="doc-explorer-up" title="{% trans "Parent folder (Backspace)" %}"><i class="mdi mdi-arrow-up"></i></button>
|
||||
<nav class="netbox-explorer-address flex-grow-1" id="doc-explorer-address"></nav>
|
||||
<a href="#" class="btn btn-sm btn-ghost-secondary d-none" id="doc-explorer-props" title="Ordnerdetails"><i class="mdi mdi-information-outline"></i></a>
|
||||
<a href="#" class="btn btn-sm btn-ghost-secondary d-none" id="doc-explorer-props" title="{% trans "Folder details" %}"><i class="mdi mdi-information-outline"></i></a>
|
||||
</div>
|
||||
<div class="netbox-explorer-body">
|
||||
<aside class="netbox-explorer-nav">
|
||||
<div class="netbox-explorer-nav-row" data-folder="root"><span class="netbox-explorer-twisty"></span><i class="mdi mdi-folder-home text-warning"></i><span>Dokumentationen</span></div>
|
||||
<div class="netbox-explorer-nav-row" data-folder="root"><span class="netbox-explorer-twisty"></span><i class="mdi mdi-folder-home text-warning"></i><span>{% trans "Documents" %}</span></div>
|
||||
<ul class="list-unstyled mb-0">
|
||||
{% for node in tree %}
|
||||
{% include 'netbox_documentation/inc/explorer_nav_node.html' with node=node %}
|
||||
@@ -40,7 +41,7 @@
|
||||
</ul>
|
||||
</aside>
|
||||
<section class="netbox-explorer-content">
|
||||
<div class="netbox-explorer-pane" data-folder="root" data-parent="" data-title="Dokumentationen">
|
||||
<div class="netbox-explorer-pane" data-folder="root" data-parent="" data-title="{% trans "Documents" %}">
|
||||
{% for node in tree %}
|
||||
{% include 'netbox_documentation/inc/explorer_folder_tile.html' with node=node %}
|
||||
{% endfor %}
|
||||
@@ -52,7 +53,7 @@
|
||||
{% include 'netbox_documentation/inc/explorer_pane.html' with node=node parent='root' %}
|
||||
{% endfor %}
|
||||
<div class="netbox-explorer-pane d-none" id="doc-explorer-results"></div>
|
||||
<p class="text-muted d-none mb-0" id="doc-explorer-nomatch">Keine Treffer gefunden.</p>
|
||||
<p class="text-muted d-none mb-0" id="doc-explorer-nomatch">{% trans "No matches found." %}</p>
|
||||
</section>
|
||||
</div>
|
||||
<div class="card-footer py-1 small text-muted" id="doc-explorer-status"></div>
|
||||
@@ -79,7 +80,7 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p class="text-muted mb-0">Noch keine Dokumentationen vorhanden.</p>
|
||||
<p class="text-muted mb-0">{% trans "No documents yet." %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -129,6 +130,29 @@
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var T = {
|
||||
status: '{{ _("{folders} folders, {documents} documents")|escapejs }}',
|
||||
searchResults: '{{ _("Search results in all folders: ")|escapejs }}',
|
||||
newFolder: '{{ _("New folder")|escapejs }}',
|
||||
newDocument: '{{ _("New document")|escapejs }}',
|
||||
exportFolderZip: '{{ _("Export folder as ZIP")|escapejs }}',
|
||||
folderDetails: '{{ _("Folder details")|escapejs }}',
|
||||
refresh: '{{ _("Refresh")|escapejs }}',
|
||||
open: '{{ _("Open")|escapejs }}',
|
||||
newSubfolder: '{{ _("New subfolder")|escapejs }}',
|
||||
newDocumentHere: '{{ _("New document here")|escapejs }}',
|
||||
renameEdit: '{{ _("Rename / edit")|escapejs }}',
|
||||
exportZip: '{{ _("Export as ZIP")|escapejs }}',
|
||||
copyLink: '{{ _("Copy link")|escapejs }}',
|
||||
delete: '{{ _("Delete")|escapejs }}',
|
||||
openNewTab: '{{ _("Open in new tab")|escapejs }}',
|
||||
printPdf: '{{ _("Print / export as PDF")|escapejs }}',
|
||||
close: '{{ _("Close")|escapejs }}',
|
||||
emptyFolder: '{{ _("This folder is empty.")|escapejs }}',
|
||||
unexpectedResponse: '{{ _("Unexpected response from the server ({status}).")|escapejs }}',
|
||||
moved: '{{ _("“{document}” moved to “{folder}”.")|escapejs }}',
|
||||
moveFailed: '{{ _("Move failed – no connection to the server.")|escapejs }}'
|
||||
};
|
||||
var input = document.getElementById('doc-tree-search');
|
||||
var explorer = document.getElementById('doc-explorer');
|
||||
var treeView = document.getElementById('doc-tree-view');
|
||||
@@ -193,7 +217,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
applySearch();
|
||||
}
|
||||
|
||||
// Point "Hinzufügen" / "Neuer Ordner" at the open folder and return here afterwards.
|
||||
// Point "Add" / "New folder" at the open folder and return here afterwards.
|
||||
function updateAddLinks() {
|
||||
var folder = current === 'root' ? '' : current;
|
||||
var back = window.location.pathname + (folder ? '?folder=' + folder : '');
|
||||
@@ -223,7 +247,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
var tiles = container.querySelectorAll('.netbox-explorer-tile:not(.d-none)');
|
||||
var folders = 0, files = 0;
|
||||
tiles.forEach(function (t) { if (t.dataset.open) { folders++; } else { files++; } });
|
||||
document.getElementById('doc-explorer-status').textContent = (prefix || '') + folders + ' Ordner, ' + files + ' Dokument(e)';
|
||||
document.getElementById('doc-explorer-status').textContent = (prefix || '') + T.status.replace('{folders}', folders).replace('{documents}', files);
|
||||
document.getElementById('doc-explorer-nomatch').classList.toggle('d-none', tiles.length > 0 || !input.value.trim());
|
||||
}
|
||||
|
||||
@@ -254,7 +278,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
});
|
||||
});
|
||||
results.classList.remove('d-none');
|
||||
updateStatus(results, 'Suchergebnisse in allen Ordnern: ');
|
||||
updateStatus(results, T.searchResults);
|
||||
}
|
||||
|
||||
if (explorer) {
|
||||
@@ -314,41 +338,41 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
if (!tile) {
|
||||
var here = pane(current);
|
||||
return [
|
||||
addFolder && { icon: 'mdi-folder-plus-outline', label: 'Neuer Ordner', run: function () { go(addFolder.href); } },
|
||||
addDoc && { icon: 'mdi-file-document-plus-outline', label: 'Neues Dokument', run: function () { go(addDoc.href); } },
|
||||
addFolder && { icon: 'mdi-folder-plus-outline', label: T.newFolder, run: function () { go(addFolder.href); } },
|
||||
addDoc && { icon: 'mdi-file-document-plus-outline', label: T.newDocument, run: function () { go(addDoc.href); } },
|
||||
'-',
|
||||
here.dataset.parent && { icon: 'mdi-folder-zip-outline', label: 'Ordner als ZIP exportieren', run: function () { exportFolder(current); } },
|
||||
here.dataset.url && { icon: 'mdi-information-outline', label: 'Ordnerdetails', run: function () { go(here.dataset.url); } },
|
||||
here.dataset.parent && { icon: 'mdi-folder-zip-outline', label: T.exportFolderZip, run: function () { exportFolder(current); } },
|
||||
here.dataset.url && { icon: 'mdi-information-outline', label: T.folderDetails, run: function () { go(here.dataset.url); } },
|
||||
'-',
|
||||
{ icon: 'mdi-refresh', label: 'Aktualisieren', run: function () { window.location.reload(); } }
|
||||
{ icon: 'mdi-refresh', label: T.refresh, run: function () { window.location.reload(); } }
|
||||
];
|
||||
}
|
||||
var d = tile.dataset;
|
||||
if (d.kind === 'folder') {
|
||||
return [
|
||||
{ icon: 'mdi-folder-open-outline', label: 'Öffnen', bold: true, run: function () { if (input) input.value = ''; openFolder(d.pk); } },
|
||||
{ icon: 'mdi-information-outline', label: 'Ordnerdetails', run: function () { go(d.url); } },
|
||||
{ icon: 'mdi-folder-open-outline', label: T.open, bold: true, run: function () { if (input) input.value = ''; openFolder(d.pk); } },
|
||||
{ icon: 'mdi-information-outline', label: T.folderDetails, run: function () { go(d.url); } },
|
||||
'-',
|
||||
addFolder && { icon: 'mdi-folder-plus-outline', label: 'Neuer Unterordner', run: function () { go(withReturn(addFolder.dataset.base, { parent: d.pk })); } },
|
||||
addDoc && { icon: 'mdi-file-document-plus-outline', label: 'Neues Dokument hier', run: function () { go(withReturn(addDoc.dataset.base, { category: d.pk })); } },
|
||||
addFolder && { icon: 'mdi-folder-plus-outline', label: T.newSubfolder, run: function () { go(withReturn(addFolder.dataset.base, { parent: d.pk })); } },
|
||||
addDoc && { icon: 'mdi-file-document-plus-outline', label: T.newDocumentHere, run: function () { go(withReturn(addDoc.dataset.base, { category: d.pk })); } },
|
||||
'-',
|
||||
d.edit && { icon: 'mdi-rename-outline', label: 'Umbenennen / Bearbeiten', run: function () { go(withReturn(d.edit)); } },
|
||||
{ icon: 'mdi-folder-zip-outline', label: 'Als ZIP exportieren', run: function () { exportFolder(d.pk); } },
|
||||
{ icon: 'mdi-link-variant', label: 'Link kopieren', run: function () { copyText(window.location.origin + window.location.pathname + '?folder=' + d.pk); } },
|
||||
d.edit && { icon: 'mdi-rename-outline', label: T.renameEdit, run: function () { go(withReturn(d.edit)); } },
|
||||
{ icon: 'mdi-folder-zip-outline', label: T.exportZip, run: function () { exportFolder(d.pk); } },
|
||||
{ icon: 'mdi-link-variant', label: T.copyLink, run: function () { copyText(window.location.origin + window.location.pathname + '?folder=' + d.pk); } },
|
||||
'-',
|
||||
d.delete && { icon: 'mdi-trash-can-outline', label: 'Löschen', danger: true, run: function () { go(withReturn(d.delete)); } }
|
||||
d.delete && { icon: 'mdi-trash-can-outline', label: T.delete, danger: true, run: function () { go(withReturn(d.delete)); } }
|
||||
];
|
||||
}
|
||||
var href = tile.getAttribute('href');
|
||||
return [
|
||||
{ icon: 'mdi-file-document-outline', label: 'Öffnen', bold: true, run: function () { go(href); } },
|
||||
{ icon: 'mdi-open-in-new', label: 'In neuem Tab öffnen', run: function () { go(href, true); } },
|
||||
{ icon: 'mdi-file-document-outline', label: T.open, bold: true, run: function () { go(href); } },
|
||||
{ icon: 'mdi-open-in-new', label: T.openNewTab, run: function () { go(href, true); } },
|
||||
'-',
|
||||
d.edit && { icon: 'mdi-rename-outline', label: 'Umbenennen / Bearbeiten', run: function () { go(withReturn(d.edit)); } },
|
||||
{ icon: 'mdi-printer-outline', label: 'Drucken / als PDF exportieren', run: function () { go(d.print, true); } },
|
||||
{ icon: 'mdi-link-variant', label: 'Link kopieren', run: function () { copyText(new URL(href, window.location.href).href); } },
|
||||
d.edit && { icon: 'mdi-rename-outline', label: T.renameEdit, run: function () { go(withReturn(d.edit)); } },
|
||||
{ icon: 'mdi-printer-outline', label: T.printPdf, run: function () { go(d.print, true); } },
|
||||
{ icon: 'mdi-link-variant', label: T.copyLink, run: function () { copyText(new URL(href, window.location.href).href); } },
|
||||
'-',
|
||||
d.delete && { icon: 'mdi-trash-can-outline', label: 'Löschen', danger: true, run: function () { go(withReturn(d.delete)); } }
|
||||
d.delete && { icon: 'mdi-trash-can-outline', label: T.delete, danger: true, run: function () { go(withReturn(d.delete)); } }
|
||||
];
|
||||
}
|
||||
|
||||
@@ -422,7 +446,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
var el = document.createElement('div');
|
||||
el.className = 'toast show align-items-center border-0 text-bg-' + (ok ? 'success' : 'danger');
|
||||
el.setAttribute('role', 'alert');
|
||||
el.innerHTML = '<div class="d-flex"><div class="toast-body"></div><button type="button" class="btn-close btn-close-white me-2 m-auto" aria-label="Schließen"></button></div>';
|
||||
el.innerHTML = '<div class="d-flex"><div class="toast-body"></div><button type="button" class="btn-close btn-close-white me-2 m-auto" aria-label="' + T.close + '"></button></div>';
|
||||
el.querySelector('.toast-body').textContent = message;
|
||||
el.querySelector('.btn-close').addEventListener('click', function () { el.remove(); });
|
||||
box.appendChild(el);
|
||||
@@ -446,7 +470,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
if (!p) return;
|
||||
var count = p.querySelectorAll('.netbox-explorer-tile').length;
|
||||
var empty = p.querySelector('.netbox-explorer-empty');
|
||||
if (!count && !empty) p.insertAdjacentHTML('beforeend', '<p class="text-muted netbox-explorer-empty">Dieser Ordner ist leer.</p>');
|
||||
if (!count && !empty) p.insertAdjacentHTML('beforeend', '<p class="text-muted netbox-explorer-empty">' + T.emptyFolder + '</p>');
|
||||
if (count && empty) empty.remove();
|
||||
if (!f) return;
|
||||
f.querySelector('small').textContent = count + ' Element(e)';
|
||||
@@ -468,17 +492,17 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
body.append('category', folderId === 'root' ? '' : folderId);
|
||||
body.append('csrfmiddlewaretoken', document.querySelector('#doc-explorer-export [name=csrfmiddlewaretoken]').value);
|
||||
fetch(doc.dataset.move, { method: 'POST', body: body, credentials: 'same-origin', headers: { 'X-Requested-With': 'XMLHttpRequest' } })
|
||||
.then(function (r) { return r.json().catch(function () { return { error: 'Unerwartete Antwort vom Server (' + r.status + ').' }; }); })
|
||||
.then(function (r) { return r.json().catch(function () { return { error: T.unexpectedResponse.replace('{status}', r.status) }; }); })
|
||||
.then(function (data) {
|
||||
if (data.error) { toast(data.error, false); return; }
|
||||
pane(folderId).appendChild(doc);
|
||||
refreshFolderTile(source);
|
||||
refreshFolderTile(folderId);
|
||||
treeStale = true;
|
||||
toast('„' + doc.title + '“ verschoben nach „' + pane(folderId).dataset.title + '“.', true);
|
||||
toast(T.moved.replace('{document}', doc.title).replace('{folder}', pane(folderId).dataset.title), true);
|
||||
applySearch();
|
||||
})
|
||||
.catch(function () { toast('Verschieben fehlgeschlagen – keine Verbindung zum Server.', false); });
|
||||
.catch(function () { toast(T.moveFailed, false); });
|
||||
}
|
||||
|
||||
if (explorer) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{% extends 'generic/object.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<nav aria-label="breadcrumb" class="mb-3">
|
||||
<nav aria-label="{% trans "Breadcrumb" %}" class="mb-3">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="{% url 'plugins:netbox_documentation:documentcategory_tree' %}"><i class="mdi mdi-folder-home"></i> Ordner</a></li>
|
||||
<li class="breadcrumb-item"><a href="{% url 'plugins:netbox_documentation:documentcategory_tree' %}"><i class="mdi mdi-folder-home"></i> {% trans "Folders" %}</a></li>
|
||||
{% for ancestor in object.ancestors %}
|
||||
<li class="breadcrumb-item"><a href="{{ ancestor.get_absolute_url }}">{{ ancestor.name }}</a></li>
|
||||
{% endfor %}
|
||||
@@ -14,7 +15,7 @@
|
||||
<div class="col col-md-4">
|
||||
{% if object.tenant_group or object.tenant %}
|
||||
<div class="card mb-3">
|
||||
<h5 class="card-header">Mandantenzuordnung</h5>
|
||||
<h5 class="card-header">{% trans "Tenancy" %}</h5>
|
||||
<div class="list-group list-group-flush">
|
||||
{% if object.tenant_group %}<a class="list-group-item list-group-item-action" href="{{ object.tenant_group.get_absolute_url }}"><i class="mdi mdi-account-group"></i> {{ object.tenant_group }}</a>{% endif %}
|
||||
{% if object.tenant %}<a class="list-group-item list-group-item-action" href="{{ object.tenant.get_absolute_url }}"><i class="mdi mdi-domain"></i> {{ object.tenant }}</a>{% endif %}
|
||||
@@ -22,21 +23,21 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card">
|
||||
<h5 class="card-header">Unterordner</h5>
|
||||
<h5 class="card-header">{% trans "Subfolders" %}</h5>
|
||||
<div class="list-group list-group-flush">
|
||||
{% for child in object.children.all %}
|
||||
<a class="list-group-item list-group-item-action" href="{{ child.get_absolute_url }}"><i class="mdi mdi-folder"></i> {{ child.name }}</a>
|
||||
{% empty %}<div class="list-group-item text-muted">Keine Unterordner</div>{% endfor %}
|
||||
{% empty %}<div class="list-group-item text-muted">{% trans "No subfolders" %}</div>{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-8">
|
||||
<div class="card">
|
||||
<h5 class="card-header">Dokumentationen</h5>
|
||||
<h5 class="card-header">{% trans "Documents" %}</h5>
|
||||
<div class="list-group list-group-flush">
|
||||
{% for document in object.documents.all %}
|
||||
<a class="list-group-item list-group-item-action" href="{{ document.get_absolute_url }}"><strong>{{ document.title }}</strong>{% if document.summary %}<br><small>{{ document.summary }}</small>{% endif %}</a>
|
||||
{% empty %}<div class="list-group-item text-muted">Keine Dokumentationen in diesem Ordner</div>{% endfor %}
|
||||
{% empty %}<div class="list-group-item text-muted">{% trans "No documents in this folder" %}</div>{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Ordner & Kategorien{% endblock %}
|
||||
{% block title %}{% trans "Folders & categories" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row mb-3">
|
||||
<div class="col d-flex justify-content-between align-items-center flex-wrap gap-2">
|
||||
<input type="search" id="folder-tree-search" class="form-control" style="max-width: 20rem;" placeholder="Ordner durchsuchen…">
|
||||
<input type="search" id="folder-tree-search" class="form-control" style="max-width: 20rem;" placeholder="{% trans "Search folders…" %}">
|
||||
<div class="d-flex gap-2">
|
||||
{% if perms.netbox_documentation.add_documentcategory %}
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_add' %}" class="btn btn-success"><i class="mdi mdi-folder-plus"></i> Ordner erstellen</a>
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_add' %}" class="btn btn-success"><i class="mdi mdi-folder-plus"></i> {% trans "Create folder" %}</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_list' %}" class="btn btn-outline-secondary"><i class="mdi mdi-format-list-bulleted"></i> Listenansicht</a>
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_list' %}" class="btn btn-outline-secondary"><i class="mdi mdi-format-list-bulleted"></i> {% trans "List view" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,7 +24,7 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p class="text-muted mb-0">Noch keine Ordner vorhanden.</p>
|
||||
<p class="text-muted mb-0">{% trans "No folders yet." %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load form_helpers %}
|
||||
|
||||
{% block title %}Excel-Importvorschau{% endblock %}
|
||||
{% block title %}{% trans "Excel import preview" %}{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
{{ block.super }}
|
||||
@@ -17,9 +18,9 @@
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap gap-4">
|
||||
<div><strong>Datei:</strong> {{ batch.original_name }}</div>
|
||||
<div><strong>Zielordner:</strong> {{ batch.category|default:"Nicht mehr vorhanden" }}</div>
|
||||
<div><strong>Glätten:</strong> {% if batch.flatten %}Ja{% else %}Nein{% endif %}</div>
|
||||
<div><strong>{% trans "File" %}:</strong> {{ batch.original_name }}</div>
|
||||
<div><strong>{% trans "Target folder" %}:</strong> {% if batch.category %}{{ batch.category }}{% else %}{% trans "No longer exists" %}{% endif %}</div>
|
||||
<div><strong>{% trans "Flatten" %}:</strong> {% if batch.flatten %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,8 +30,8 @@
|
||||
{% if overwrite_conflicts %}
|
||||
<input type="hidden" name="confirm_overwrite" value="1">
|
||||
<div class="alert alert-warning mx-0" role="alert">
|
||||
<h3 class="alert-title">Bestehende Dokumentationen aktualisieren?</h3>
|
||||
<p>Die folgenden Dokumentationen existieren bereits im Zielordner. Ihr Inhalt wird überschrieben; bestehende NetBox-Zuordnungen bleiben erhalten:</p>
|
||||
<h3 class="alert-title">{% trans "Update existing documents?" %}</h3>
|
||||
<p>{% trans "The following documents already exist in the target folder. Their content will be overwritten; existing NetBox assignments are kept:" %}</p>
|
||||
<ul class="mb-0">
|
||||
{% for document in overwrite_conflicts %}<li>{{ document.title }}</li>{% endfor %}
|
||||
</ul>
|
||||
@@ -45,22 +46,22 @@
|
||||
<div class="row align-items-center w-100 g-3">
|
||||
<div class="col-auto">
|
||||
{{ item.form.include }}
|
||||
<label for="{{ item.form.include.id_for_label }}" class="ms-1">Importieren</label>
|
||||
<label for="{{ item.form.include.id_for_label }}" class="ms-1">{% trans "Import" %}</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ item.form.index }}
|
||||
<label for="{{ item.form.title.id_for_label }}" class="form-label mb-1">Dokumenttitel</label>
|
||||
<label for="{{ item.form.title.id_for_label }}" class="form-label mb-1">{% trans "Document title" %}</label>
|
||||
{{ item.form.title }}
|
||||
{% for error in item.form.title.errors %}<div class="invalid-feedback d-block">{{ error }}</div>{% endfor %}
|
||||
</div>
|
||||
<div class="col-auto text-muted">
|
||||
{{ item.sheet.images|length }} Bild{{ item.sheet.images|length|pluralize:"er" }}
|
||||
{% with count=item.sheet.images|length %}{% blocktrans count counter=count %}{{ counter }} image{% plural %}{{ counter }} images{% endblocktrans %}{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<details>
|
||||
<summary class="p-3 fw-bold" style="cursor:pointer">Vorschau der erzeugten Dokumentation anzeigen</summary>
|
||||
<summary class="p-3 fw-bold" style="cursor:pointer">{% trans "Show preview of the generated document" %}</summary>
|
||||
<div class="excel-preview-content border-top p-3 rendered-markdown">
|
||||
{{ item.preview_html|safe }}
|
||||
</div>
|
||||
@@ -71,10 +72,10 @@
|
||||
|
||||
<div class="sticky-actions sticky-actions-footer d-print-none" data-sticky-position="full" data-sticky-when="always">
|
||||
<div class="btn-list">
|
||||
<button type="submit" name="action" value="cancel" class="btn btn-outline-secondary">Abbrechen</button>
|
||||
<button type="submit" name="action" value="cancel" class="btn btn-outline-secondary">{% trans "Cancel" %}</button>
|
||||
<button type="submit" name="action" value="confirm" class="btn {% if overwrite_conflicts %}btn-warning{% else %}btn-primary{% endif %}">
|
||||
<i class="mdi mdi-file-import"></i>
|
||||
{% if overwrite_conflicts %}Überschreiben und importieren{% else %}Ausgewählte Arbeitsblätter importieren{% endif %}
|
||||
{% if overwrite_conflicts %}{% trans "Overwrite and import" %}{% else %}{% trans "Import selected worksheets" %}{% endif %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{% load i18n %}
|
||||
<li class="netbox-doc-tree-item" data-name="{{ node.object.name|lower }}">
|
||||
{% if node.children %}
|
||||
<details open>
|
||||
@@ -7,7 +8,7 @@
|
||||
<span class="badge text-bg-secondary">{{ node.object.document_total }}</span>
|
||||
{% if node.object.tenant %}<span class="badge text-bg-light"><i class="mdi mdi-domain"></i> {{ node.object.tenant }}</span>{% endif %}
|
||||
{% if perms.netbox_documentation.change_documentcategory %}
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_edit' node.object.pk %}" class="btn btn-sm btn-ghost-secondary" title="Bearbeiten"><i class="mdi mdi-pencil"></i></a>
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_edit' node.object.pk %}" class="btn btn-sm btn-ghost-secondary" title="{% trans "Edit" %}"><i class="mdi mdi-pencil"></i></a>
|
||||
{% endif %}
|
||||
</summary>
|
||||
<ul class="netbox-doc-tree list-unstyled">
|
||||
@@ -23,7 +24,7 @@
|
||||
<span class="badge text-bg-secondary">{{ node.object.document_total }}</span>
|
||||
{% if node.object.tenant %}<span class="badge text-bg-light"><i class="mdi mdi-domain"></i> {{ node.object.tenant }}</span>{% endif %}
|
||||
{% if perms.netbox_documentation.change_documentcategory %}
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_edit' node.object.pk %}" class="btn btn-sm btn-ghost-secondary" title="Bearbeiten"><i class="mdi mdi-pencil"></i></a>
|
||||
<a href="{% url 'plugins:netbox_documentation:documentcategory_edit' node.object.pk %}" class="btn btn-sm btn-ghost-secondary" title="{% trans "Edit" %}"><i class="mdi mdi-pencil"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{% load i18n %}
|
||||
<li class="netbox-doc-tree-item netbox-doc-tree-file" data-name="{{ document.title|lower }}">
|
||||
<div class="netbox-doc-tree-summary netbox-doc-tree-leaf">
|
||||
<i class="mdi mdi-file-document-outline text-secondary"></i>
|
||||
<a href="{{ document.get_absolute_url }}">{{ document.title }}</a>
|
||||
{% if not document.is_published %}<span class="badge text-bg-warning">Entwurf</span>{% endif %}
|
||||
{% if not document.is_published %}<span class="badge text-bg-warning">{% trans "Draft" %}</span>{% endif %}
|
||||
{% if document.tenant %}<span class="badge text-bg-light"><i class="mdi mdi-domain"></i> {{ document.tenant }}</span>{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
@@ -1,3 +1,4 @@
|
||||
{% load i18n %}
|
||||
<li class="netbox-doc-tree-item" data-name="{{ node.object.name|lower }}">
|
||||
<details open>
|
||||
<summary class="netbox-doc-tree-summary">
|
||||
@@ -13,7 +14,7 @@
|
||||
{% include 'netbox_documentation/inc/document_tree_file.html' with document=document %}
|
||||
{% endfor %}
|
||||
{% if not node.children and not node.documents %}
|
||||
<li class="netbox-doc-tree-empty text-muted">Leer</li>
|
||||
<li class="netbox-doc-tree-empty text-muted">{% trans "Empty" %}</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{% load i18n %}
|
||||
<a class="netbox-explorer-tile" href="{{ document.get_absolute_url }}" data-name="{{ document.title|lower }}" title="{{ document.title }}"
|
||||
data-kind="document" data-pk="{{ document.pk }}" data-print="{% url 'plugins:netbox_documentation:document_print' pk=document.pk %}"
|
||||
{% if perms.netbox_documentation.change_document %}data-edit="{% url 'plugins:netbox_documentation:document_edit' pk=document.pk %}" data-move="{% url 'plugins:netbox_documentation:document_move' pk=document.pk %}" draggable="true"{% endif %}
|
||||
{% if perms.netbox_documentation.delete_document %}data-delete="{% url 'plugins:netbox_documentation:document_delete' pk=document.pk %}"{% endif %}>
|
||||
<i class="mdi mdi-file-document-outline netbox-explorer-icon text-primary"></i>
|
||||
<span class="netbox-explorer-label">{{ document.title }}</span>
|
||||
{% if not document.is_published %}<span class="badge text-bg-warning">Entwurf</span>{% endif %}
|
||||
{% if not document.is_published %}<span class="badge text-bg-warning">{% trans "Draft" %}</span>{% endif %}
|
||||
{% if document.tenant %}<small class="text-muted text-truncate mw-100"><i class="mdi mdi-domain"></i> {{ document.tenant }}</small>{% endif %}
|
||||
</a>
|
||||
@@ -1,8 +1,9 @@
|
||||
{% load i18n %}
|
||||
<div class="netbox-explorer-tile" data-open="{{ node.object.pk }}" data-name="{{ node.object.name|lower }}" title="{{ node.object.name }}" tabindex="0"
|
||||
data-kind="folder" data-pk="{{ node.object.pk }}" data-url="{{ node.object.get_absolute_url }}"
|
||||
{% if perms.netbox_documentation.change_documentcategory %}data-edit="{% url 'plugins:netbox_documentation:documentcategory_edit' pk=node.object.pk %}"{% endif %}
|
||||
{% if perms.netbox_documentation.delete_documentcategory %}data-delete="{% url 'plugins:netbox_documentation:documentcategory_delete' pk=node.object.pk %}"{% endif %}>
|
||||
<i class="mdi {% if node.children or node.documents %}mdi-folder{% else %}mdi-folder-outline{% endif %} netbox-explorer-icon text-warning"></i>
|
||||
<span class="netbox-explorer-label">{{ node.object.name }}</span>
|
||||
<small class="text-muted">{% with c=node.children|length d=node.documents|length %}{{ c|add:d }}{% endwith %} Element(e)</small>
|
||||
<small class="text-muted">{% with c=node.children|length d=node.documents|length %}{% with total=c|add:d %}{% blocktrans count counter=total %}{{ counter }} item{% plural %}{{ counter }} items{% endblocktrans %}{% endwith %}{% endwith %}</small>
|
||||
</div>
|
||||
@@ -1,3 +1,4 @@
|
||||
{% load i18n %}
|
||||
<div class="netbox-explorer-pane d-none" data-folder="{{ node.object.pk }}" data-parent="{{ parent|default:'root' }}" data-title="{{ node.object.name }}" data-url="{{ node.object.get_absolute_url }}">
|
||||
{% for child in node.children %}
|
||||
{% include 'netbox_documentation/inc/explorer_folder_tile.html' with node=child %}
|
||||
@@ -5,7 +6,7 @@
|
||||
{% for document in node.documents %}
|
||||
{% include 'netbox_documentation/inc/explorer_file_tile.html' with document=document %}
|
||||
{% endfor %}
|
||||
{% if not node.children and not node.documents %}<p class="text-muted netbox-explorer-empty">Dieser Ordner ist leer.</p>{% endif %}
|
||||
{% if not node.children and not node.documents %}<p class="text-muted netbox-explorer-empty">{% trans "This folder is empty." %}</p>{% endif %}
|
||||
</div>
|
||||
{% for child in node.children %}
|
||||
{% include 'netbox_documentation/inc/explorer_pane.html' with node=child parent=node.object.pk %}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{% load i18n %}
|
||||
<div class="card">
|
||||
<h5 class="card-header"><i class="mdi mdi-book-open-page-variant"></i> Dokumentation</h5>
|
||||
<h5 class="card-header"><i class="mdi mdi-book-open-page-variant"></i> {% trans "Documentation" %}</h5>
|
||||
<div class="list-group list-group-flush">
|
||||
{% for assignment in documentation_assignments %}
|
||||
<a class="list-group-item list-group-item-action" href="{{ assignment.document.get_absolute_url }}">
|
||||
<strong>{{ assignment.document.title }}</strong>{% if assignment.note %}<br><small>{{ assignment.note }}</small>{% endif %}
|
||||
</a>
|
||||
{% empty %}<div class="list-group-item text-muted">Keine Dokumentation zugeordnet.</div>{% endfor %}
|
||||
{% empty %}<div class="list-group-item text-muted">{% trans "No documents assigned." %}</div>{% endfor %}
|
||||
</div>
|
||||
{% if perms.netbox_documentation.add_documentassignment %}<div class="card-footer"><a href="{% url 'plugins:netbox_documentation:documentassignment_add' %}?assigned_object_type={{ content_type.pk }}&assigned_object={{ object.pk }}" class="btn btn-sm btn-primary"><i class="mdi mdi-link-plus"></i> Zuordnen</a></div>{% endif %}
|
||||
{% if perms.netbox_documentation.add_documentassignment %}<div class="card-footer"><a href="{% url 'plugins:netbox_documentation:documentassignment_add' %}?assigned_object_type={{ content_type.pk }}&assigned_object={{ object.pk }}" class="btn btn-sm btn-primary"><i class="mdi mdi-link-plus"></i> {% trans "Assign" %}</a></div>{% endif %}
|
||||
</div>
|
||||
Reference in new issue
Block a user