156 Zeilen
5.4 KiB
HTML
156 Zeilen
5.4 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Batch-Lizenzen generiert{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container py-5">
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h2>✅ Batch-Lizenzen erfolgreich generiert</h2>
|
|
<div>
|
|
<a href="{{ url_for('batch.batch_create') }}" class="btn btn-primary">🔑 Weitere Batch erstellen</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="alert alert-success">
|
|
<h5 class="alert-heading">🎉 {{ licenses|length }} Lizenzen wurden erfolgreich generiert!</h5>
|
|
<p class="mb-0">Die Lizenzen wurden in der Datenbank gespeichert und dem Kunden zugeordnet.</p>
|
|
</div>
|
|
|
|
<!-- Kunden-Info -->
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">📋 Kundeninformationen</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<p><strong>Kunde:</strong> {{ customer }}</p>
|
|
<p><strong>E-Mail:</strong> {{ email or 'Nicht angegeben' }}</p>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<p><strong>Gültig von:</strong> {{ valid_from }}</p>
|
|
<p><strong>Gültig bis:</strong> {{ valid_until }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Export-Optionen -->
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">📥 Export-Optionen</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<p>Exportieren Sie die generierten Lizenzen für den Kunden:</p>
|
|
<div class="d-flex gap-2">
|
|
<a href="{{ url_for('batch.export_batch') }}" class="btn btn-success">
|
|
📄 Als CSV exportieren
|
|
</a>
|
|
<button class="btn btn-outline-primary" onclick="copyAllKeys()">
|
|
📋 Alle Keys kopieren
|
|
</button>
|
|
<button class="btn btn-outline-secondary" onclick="window.print()">
|
|
🖨️ Drucken
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Generierte Lizenzen -->
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">🔑 Generierte Lizenzen</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th width="50">#</th>
|
|
<th>Lizenzschlüssel</th>
|
|
<th width="120">Typ</th>
|
|
<th width="100">Aktionen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for license in licenses %}
|
|
<tr>
|
|
<td>{{ loop.index }}</td>
|
|
<td class="font-monospace">{{ license.key }}</td>
|
|
<td>
|
|
{% if license.type == 'full' %}
|
|
<span class="badge bg-success">Vollversion</span>
|
|
{% else %}
|
|
<span class="badge bg-info">Testversion</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-outline-secondary"
|
|
onclick="copyKey('{{ license.key }}')"
|
|
title="Kopieren">
|
|
📋
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Hinweis -->
|
|
<div class="alert alert-info mt-4">
|
|
<strong>💡 Tipp:</strong> Die generierten Lizenzen sind sofort aktiv und können verwendet werden.
|
|
Sie finden alle Lizenzen auch in der <a href="{{ url_for('licenses.licenses', search=customer) }}">Lizenzübersicht</a>.
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Textarea für Kopieren (unsichtbar) -->
|
|
<textarea id="copyArea" style="position: absolute; left: -9999px;"></textarea>
|
|
|
|
<style>
|
|
@media print {
|
|
.btn, .alert-info, .card-header h5 { display: none !important; }
|
|
.card { border: 1px solid #000 !important; }
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
// Einzelnen Key kopieren
|
|
function copyKey(key) {
|
|
navigator.clipboard.writeText(key).then(function() {
|
|
// Visuelles Feedback
|
|
event.target.textContent = '✓';
|
|
setTimeout(() => {
|
|
event.target.textContent = '📋';
|
|
}, 2000);
|
|
});
|
|
}
|
|
|
|
// Alle Keys kopieren
|
|
function copyAllKeys() {
|
|
const keys = [];
|
|
{% for license in licenses %}
|
|
keys.push('{{ license.key }}');
|
|
{% endfor %}
|
|
|
|
const text = keys.join('\n');
|
|
const textarea = document.getElementById('copyArea');
|
|
textarea.value = text;
|
|
textarea.select();
|
|
|
|
try {
|
|
document.execCommand('copy');
|
|
// Visuelles Feedback
|
|
event.target.textContent = '✓ Kopiert!';
|
|
setTimeout(() => {
|
|
event.target.textContent = '📋 Alle Keys kopieren';
|
|
}, 2000);
|
|
} catch (err) {
|
|
// Fallback für moderne Browser
|
|
navigator.clipboard.writeText(text);
|
|
}
|
|
}
|
|
</script>
|
|
{% endblock %} |