feat: added permissions and allowed transitions logic
This commit is contained in:
@@ -25,15 +25,15 @@
|
||||
<input type="text"
|
||||
name="title"
|
||||
value="{{ ticket.title }}"
|
||||
{% if not view.can_edit %}disabled{% endif %}
|
||||
class="w-full p-2 border border-gray-300 rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 {% if not view.can_edit %}bg-gray-100{% endif %}">
|
||||
{% if not view.can_edit or form.title.field.disabled %}disabled{% endif %}
|
||||
class="w-full p-2 border border-gray-300 rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 {% if not view.can_edit or form.title.field.disabled %}bg-gray-100{% endif %}">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Beschreibung:</label>
|
||||
<textarea name="description"
|
||||
rows="4"
|
||||
{% if not view.can_edit %}disabled{% endif %}
|
||||
class="w-full p-2 border border-gray-300 rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 {% if not view.can_edit %}bg-gray-100{% endif %}">{{ ticket.description }}</textarea>
|
||||
{% if not view.can_edit or form.description.field.disabled %}disabled{% endif %}
|
||||
class="w-full p-2 border border-gray-300 rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 {% if not view.can_edit or form.description.field.disabled %}bg-gray-100{% endif %}">{{ ticket.description }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Kurs:</label>
|
||||
@@ -74,7 +74,7 @@
|
||||
<!-- Zugewiesen an (Nur Anzeige) -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Zugewiesen an:</label>
|
||||
<div id="tutor_display" class="w-full p-2 border border-gray-300 bg-gray-300 rounded shadow-sm">
|
||||
<div id="tutor_display" class="w-full p-2 border border-gray-300 bg-gray-100 rounded shadow-sm">
|
||||
<span id="tutor_text">{% if ticket.assigned_to %}{{ ticket.assigned_to.username }}{% else %}Niemand zugewiesen{% endif %}</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 mt-1">Wird automatisch basierend auf dem ausgewählten Kurs zugewiesen</p>
|
||||
@@ -104,7 +104,7 @@
|
||||
rows="4"
|
||||
{% if not view.can_edit or ticket.status != 'resolved' %}disabled{% endif %}
|
||||
placeholder="Beschreibe die Lösung des Problems..."
|
||||
class="w-full p-2 border border-gray-300 rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 placeholder:text-black {% if not view.can_edit or ticket.status != 'resolved' %}bg-gray-300 cursor-not-allowed{% endif %}">{{ ticket.answer|default:'' }}</textarea>
|
||||
class="w-full p-2 border border-gray-300 rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 placeholder:text-black {% if not view.can_edit or ticket.status != 'resolved' %}bg-gray-100 cursor-not-allowed{% endif %}">{{ ticket.answer|default:'' }}</textarea>
|
||||
{% if form.answer.errors %}
|
||||
<div class="text-red-600 text-sm mt-1">{{ form.answer.errors }}</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<label class="block text-sm font-medium mb-1">Status:</label>
|
||||
<select name="status"
|
||||
disabled
|
||||
class="w-full p-2 border border-gray-300 bg-gray-300 rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
||||
class="w-full p-2 border border-gray-300 bg-gray-100 rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
||||
<option value="new"
|
||||
{% if form.status.value == 'new' or not form.status.value %}selected{% endif %}>
|
||||
Neu
|
||||
@@ -91,7 +91,7 @@
|
||||
<!-- Zugewiesen an -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Zugewiesen an:</label>
|
||||
<div id="tutor_display" class="w-full p-2 border border-gray-300 bg-gray-300 rounded shadow-sm">
|
||||
<div id="tutor_display" class="w-full p-2 border border-gray-300 bg-gray-100 rounded shadow-sm">
|
||||
<span id="tutor_text">Bitte Kurs auswählen</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 mt-1">Wird automatisch basierend auf dem ausgewählten Kurs zugewiesen</p>
|
||||
|
||||
Reference in New Issue
Block a user