Files
lernapp/resources/views/admin/users/index.blade.php
T
root 44f281514b Add grade/Klasse system: assign class levels to users, questions, and quizzes
- users.grade: set per child in admin (Klasse 1–10)
- quizzes.grade, questions.grade: optional target class (null = all)
- Children only see content matching their grade or without grade set
- Admin views show grade badge in user list, quiz list, questions list
- Quiz create/edit and user create/edit have Klasse dropdown
2026-05-06 07:19:17 +00:00

49 lines
2.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@extends('layouts.admin')
@section('title','Kinder')
@section('content')
<div class="flex justify-between items-center mb-6">
<h2 class="text-lg font-semibold text-slate-700">Alle Kinder-Konten</h2>
<a href="{{ route('admin.users.create') }}" class="bg-violet-600 hover:bg-violet-700 text-white px-4 py-2 rounded-lg text-sm font-medium">+ Neues Kind</a>
</div>
<div class="bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<table class="w-full text-sm">
<thead class="bg-slate-50 border-b border-slate-200">
<tr>
<th class="text-left px-4 py-3 font-medium text-slate-600">Name</th>
<th class="text-left px-4 py-3 font-medium text-slate-600">E-Mail</th>
<th class="text-center px-4 py-3 font-medium text-slate-600">Klasse</th>
<th class="text-right px-4 py-3 font-medium text-slate-600">🪙 Münzen</th>
<th class="text-right px-4 py-3 font-medium text-slate-600">Antworten</th>
<th class="px-4 py-3"></th>
</tr>
</thead>
<tbody class="divide-y divide-slate-100">
@forelse($users as $u)
<tr class="hover:bg-slate-50">
<td class="px-4 py-3 font-medium text-slate-800">{{ $u->name }}</td>
<td class="px-4 py-3 text-slate-500">{{ $u->email }}</td>
<td class="px-4 py-3 text-center text-sm text-slate-500">{{ $u->grade ? "Klasse ".$u->grade : "" }}</td>
<td class="px-4 py-3 text-right font-bold text-amber-600">{{ $u->points }}</td>
<td class="px-4 py-3 text-right text-slate-500">{{ $u->attempts_count }}</td>
<td class="px-4 py-3 text-right whitespace-nowrap">
<a href="{{ route('admin.users.edit',$u) }}" class="text-violet-600 hover:underline mr-3">Bearbeiten</a>
<form method="POST" action="{{ route('admin.users.reset',$u) }}" class="inline"
onsubmit="return confirm('Punktestand und Verlauf von {{ $u->name }} wirklich zurücksetzen?')">
@csrf
<button class="text-orange-500 hover:underline mr-3">Zurücksetzen</button>
</form>
<form method="POST" action="{{ route('admin.users.destroy',$u) }}" class="inline"
onsubmit="return confirm('Konto von {{ $u->name }} wirklich löschen?')">
@csrf @method('DELETE')
<button class="text-red-500 hover:underline">Löschen</button>
</form>
</td>
</tr>
@empty
<tr><td colspan="5" class="px-4 py-8 text-center text-slate-400">Noch keine Kinder angelegt.</td></tr>
@endforelse
</tbody>
</table>
</div>
@endsection