fead: added kurs column and filter
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<!-- Filter und Suche -->
|
||||
<div class="bg-white rounded-lg shadow p-4 mb-6">
|
||||
<div class="grid grid-cols-1 lg:grid-cols-4 gap-4">
|
||||
<div class="grid grid-cols-1 lg:grid-cols-5 gap-4">
|
||||
<!-- Status Filter -->
|
||||
<div>
|
||||
<form method="get">
|
||||
@@ -46,6 +46,7 @@
|
||||
name="assigned_to"
|
||||
value="{{ request.GET.assigned_to }}">
|
||||
{% endif %}
|
||||
{% if request.GET.course %}<input type="hidden" name="course" value="{{ request.GET.course }}">{% endif %}
|
||||
{% if search_query %}<input type="hidden" name="q" value="{{ search_query }}">{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
@@ -54,18 +55,44 @@
|
||||
<label class="block text-sm font-medium mb-1">Zuweisung:</label>
|
||||
{% if request.GET.assigned_to == user.id|stringformat:'s' %}
|
||||
<!-- Wenn aktiv: Button zum Deaktivieren -->
|
||||
<a href="?{% if selected_status %}status={{ selected_status }}{% endif %}{% if search_query %}&q={{ search_query }}{% endif %}"
|
||||
<a href="?{% if selected_status %}status={{ selected_status }}{% endif %}{% if selected_course %}&course={{ selected_course }}{% endif %}{% if search_query %}&q={{ search_query }}{% endif %}"
|
||||
class="block w-full h-10 px-3 border border-purple-300 rounded shadow-sm text-center bg-purple-200 hover:bg-purple-300 transition-colors flex items-center justify-center">
|
||||
👤 Meine Tickets ✓
|
||||
</a>
|
||||
{% else %}
|
||||
<!-- Wenn nicht aktiv: Button zum Aktivieren -->
|
||||
<a href="?assigned_to={{ user.id }}{% if selected_status %}&status={{ selected_status }}{% endif %}{% if search_query %}&q={{ search_query }}{% endif %}"
|
||||
<a href="?assigned_to={{ user.id }}{% if selected_status %}&status={{ selected_status }}{% endif %}{% if selected_course %}&course={{ selected_course }}{% endif %}{% if search_query %}&q={{ search_query }}{% endif %}"
|
||||
class="block w-full h-10 px-3 border border-purple-300 rounded shadow-sm text-center bg-purple-50 hover:bg-purple-100 transition-colors flex items-center justify-center">
|
||||
👤 Meine Tickets
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- Kurs Filter -->
|
||||
<div>
|
||||
<form method="get">
|
||||
<label class="block text-sm font-medium mb-1">Kurs:</label>
|
||||
<select name="course"
|
||||
onchange="this.form.submit()"
|
||||
class="w-full h-10 px-3 border border-gray-300 rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
||||
<option value="">Alle Kurse</option>
|
||||
{% for course in courses %}
|
||||
<option value="{{ course.id }}"
|
||||
{% if selected_course == course.id|stringformat:'s' %}selected{% endif %}>
|
||||
{{ course.code }} - {{ course.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<!-- Andere Filter beibehalten -->
|
||||
{% if selected_status %}<input type="hidden" name="status" value="{{ selected_status }}">{% endif %}
|
||||
{% if selected_course %}<input type="hidden" name="course" value="{{ selected_course }}">{% endif %}
|
||||
{% if request.GET.assigned_to %}
|
||||
<input type="hidden"
|
||||
name="assigned_to"
|
||||
value="{{ request.GET.assigned_to }}">
|
||||
{% endif %}
|
||||
{% if search_query %}<input type="hidden" name="q" value="{{ search_query }}">{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
<!-- Suche -->
|
||||
<div class="lg:col-span-2">
|
||||
<form method="get">
|
||||
@@ -77,6 +104,7 @@
|
||||
placeholder="Titel oder Beschreibung durchsuchen..."
|
||||
class="flex-1 h-10 px-3 border border-gray-300 rounded-l shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
||||
{% if selected_status %}<input type="hidden" name="status" value="{{ selected_status }}">{% endif %}
|
||||
{% if selected_course %}<input type="hidden" name="course" value="{{ selected_course }}">{% endif %}
|
||||
{% if request.GET.assigned_to %}
|
||||
<input type="hidden"
|
||||
name="assigned_to"
|
||||
@@ -117,6 +145,16 @@
|
||||
class="ml-1 text-green-600 hover:text-green-800">×</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if selected_course %}
|
||||
<span class="px-2 py-1 bg-green-100 text-green-800 text-sm rounded">
|
||||
Kurs:
|
||||
{% for course in courses %}
|
||||
{% if course.id|stringformat:'s' == selected_course %}{{ course.code }}{% endif %}
|
||||
{% endfor %}
|
||||
<a href="?{% if selected_status %}status={{ selected_status }}{% endif %}{% if search_query %}&q={{ search_query }}{% endif %}{% if request.GET.assigned_to %}&assigned_to={{ request.GET.assigned_to }}{% endif %}"
|
||||
class="ml-1 text-green-600 hover:text-green-800">×</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
<a href="{% url 'ticket-list' %}"
|
||||
class="text-sm text-gray-600 hover:text-gray-800 font-medium">Alle Filter entfernen</a>
|
||||
</div>
|
||||
@@ -131,6 +169,7 @@
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-center text-sm font-bold">#</th>
|
||||
<th class="px-4 py-3 text-left text-sm font-bold">Titel</th>
|
||||
<th class="px-4 py-3 text-center text-sm font-bold">Kurs</th>
|
||||
<th class="px-4 py-3 text-center text-sm font-bold">Status</th>
|
||||
<th class="px-4 py-3 text-center text-sm font-bold">Fehlerart</th>
|
||||
<th class="px-4 py-3 text-left text-sm font-bold">Zugewiesen an</th>
|
||||
@@ -147,6 +186,11 @@
|
||||
{{ ticket.title }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center text-sm">
|
||||
<span class="px-2 py-1 bg-white border border-gray-900 rounded-full text-xs font-bold text-gray-900">
|
||||
{{ ticket.course.code }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
{% if ticket.status == 'new' %}
|
||||
<span class="px-2 py-1 rounded-full text-xs font-bold bg-blue-500 text-white">{{ ticket.get_status_display }}</span>
|
||||
@@ -188,11 +232,11 @@
|
||||
<div class="text-sm text-gray-600">Seite {{ page_obj.number }} von {{ page_obj.paginator.num_pages }}</div>
|
||||
<div class="flex gap-2">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page={{ page_obj.previous_page_number }}{% if selected_status %}&status={{ selected_status }}{% endif %}{% if search_query %}&q={{ search_query }}{% endif %}"
|
||||
<a href="?page={{ page_obj.previous_page_number }}{% if selected_status %}&status={{ selected_status }}{% endif %}{% if search_query %}&q={{ search_query }}{% endif %}{% if selected_course %}&course={{ selected_course }}{% endif %}"
|
||||
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-50">Zurück</a>
|
||||
{% endif %}
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}{% if selected_status %}&status={{ selected_status }}{% endif %}{% if search_query %}&q={{ search_query }}{% endif %}"
|
||||
<a href="?page={{ page_obj.next_page_number }}{% if selected_status %}&status={{ selected_status }}{% endif %}{% if search_query %}&q={{ search_query }}{% endif %}{% if selected_course %}&course={{ selected_course }}{% endif %}"
|
||||
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-50">Weiter</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user