feat: answer field now invisible if not editable
This commit is contained in:
@@ -32,20 +32,35 @@ function initializeTicketDetail(config) {
|
|||||||
if (!answerField) return;
|
if (!answerField) return;
|
||||||
|
|
||||||
if (statusSelect.value === 'resolved') {
|
if (statusSelect.value === 'resolved') {
|
||||||
|
// Antwort-Feld einblenden und aktivieren
|
||||||
|
answerField.closest('div').style.display = 'block';
|
||||||
answerField.disabled = false;
|
answerField.disabled = false;
|
||||||
|
answerField.readOnly = false;
|
||||||
|
answerField.style.pointerEvents = 'auto'; // Erlaube Klicks
|
||||||
answerField.classList.remove('bg-gray-100', 'cursor-not-allowed');
|
answerField.classList.remove('bg-gray-100', 'cursor-not-allowed');
|
||||||
answerField.classList.add('bg-white');
|
answerField.classList.add('bg-white');
|
||||||
answerField.required = true;
|
answerField.required = true;
|
||||||
|
|
||||||
if (answerLabel && !answerLabel.querySelector('.text-red-500')) {
|
if (answerLabel && !answerLabel.querySelector('.text-red-500')) {
|
||||||
answerLabel.innerHTML = answerLabel.textContent + ' <span class="text-red-500">*</span>';
|
answerLabel.innerHTML = answerLabel.textContent + ' <span class="text-red-500">*</span>';
|
||||||
}
|
}
|
||||||
} else {
|
} else if (statusSelect.value === 'closed') {
|
||||||
answerField.disabled = true;
|
// Antwort-Feld einblenden aber ausgegraut (readonly statt disabled)
|
||||||
|
answerField.closest('div').style.display = 'block';
|
||||||
|
answerField.disabled = false;
|
||||||
|
answerField.readOnly = true;
|
||||||
|
answerField.style.pointerEvents = 'none'; // Verhindert Klicks
|
||||||
answerField.classList.add('bg-gray-100', 'cursor-not-allowed');
|
answerField.classList.add('bg-gray-100', 'cursor-not-allowed');
|
||||||
answerField.classList.remove('bg-white');
|
answerField.classList.remove('bg-white');
|
||||||
answerField.required = false;
|
answerField.required = false;
|
||||||
|
|
||||||
|
if (answerLabel) {
|
||||||
|
answerLabel.innerHTML = answerLabel.textContent.replace(' *', '');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Antwort-Feld ausblenden
|
||||||
|
answerField.closest('div').style.display = 'none';
|
||||||
|
answerField.required = false;
|
||||||
|
|
||||||
if (answerLabel) {
|
if (answerLabel) {
|
||||||
answerLabel.innerHTML = answerLabel.textContent.replace(' *', '');
|
answerLabel.innerHTML = answerLabel.textContent.replace(' *', '');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,12 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="max-w-6xl mx-auto px-4 py-6">
|
<div class="max-w-6xl mx-auto px-4 py-6">
|
||||||
|
<div class="mb-6">
|
||||||
|
<a href="{% url 'ticket-list' %}"
|
||||||
|
class="inline-flex items-center text-blue-500 hover:text-blue-600 font-medium">
|
||||||
|
← Zurück zur Übersicht
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<!-- Ticket Bearbeitung -->
|
<!-- Ticket Bearbeitung -->
|
||||||
<div class="bg-white rounded-lg shadow p-6 mb-6">
|
<div class="bg-white rounded-lg shadow p-6 mb-6">
|
||||||
<h1 class="text-3xl font-bold mb-4">🎫 Ticket #{{ ticket.id }} – {{ ticket.title }}</h1>
|
<h1 class="text-3xl font-bold mb-4">🎫 Ticket #{{ ticket.id }} – {{ ticket.title }}</h1>
|
||||||
|
|||||||
Reference in New Issue
Block a user