feat: Lernapp mit Mathe/Deutsch/Englisch, Münzsystem und Belohnungen

This commit is contained in:
root
2026-05-05 14:41:09 +00:00
parent 21e40cd2da
commit bd1640994c
45 changed files with 1522 additions and 58 deletions
@@ -0,0 +1,29 @@
@extends('layouts.admin')
@section('title','Neues Kind')
@section('content')
<div class="max-w-lg">
<a href="{{ route('admin.users.index') }}" class="text-sm text-slate-500 hover:text-slate-700 mb-4 inline-block"> Zurück</a>
<div class="bg-white rounded-xl shadow-sm border border-slate-200 p-6">
<h2 class="font-semibold text-slate-800 mb-5">Neues Kind-Konto</h2>
<form method="POST" action="{{ route('admin.users.store') }}" class="space-y-4">
@csrf
<div>
<label class="block text-sm font-medium text-slate-700 mb-1">Name</label>
<input name="name" value="{{ old('name') }}" required class="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none">
@error('name')<p class="text-red-500 text-xs mt-1">{{ $message }}</p>@enderror
</div>
<div>
<label class="block text-sm font-medium text-slate-700 mb-1">E-Mail</label>
<input name="email" type="email" value="{{ old('email') }}" required class="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none">
@error('email')<p class="text-red-500 text-xs mt-1">{{ $message }}</p>@enderror
</div>
<div>
<label class="block text-sm font-medium text-slate-700 mb-1">Passwort</label>
<input name="password" type="password" required class="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none">
@error('password')<p class="text-red-500 text-xs mt-1">{{ $message }}</p>@enderror
</div>
<button type="submit" class="w-full bg-violet-600 hover:bg-violet-700 text-white py-2 rounded-lg font-medium text-sm">Konto erstellen</button>
</form>
</div>
</div>
@endsection
@@ -0,0 +1,30 @@
@extends('layouts.admin')
@section('title','Kind bearbeiten')
@section('content')
<div class="max-w-lg">
<a href="{{ route('admin.users.index') }}" class="text-sm text-slate-500 hover:text-slate-700 mb-4 inline-block"> Zurück</a>
<div class="bg-white rounded-xl shadow-sm border border-slate-200 p-6">
<h2 class="font-semibold text-slate-800 mb-5">{{ $user->name }} bearbeiten</h2>
<form method="POST" action="{{ route('admin.users.update',$user) }}" class="space-y-4">
@csrf @method('PUT')
<div>
<label class="block text-sm font-medium text-slate-700 mb-1">Name</label>
<input name="name" value="{{ old('name',$user->name) }}" required class="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-violet-500 outline-none">
</div>
<div>
<label class="block text-sm font-medium text-slate-700 mb-1">E-Mail</label>
<input name="email" type="email" value="{{ old('email',$user->email) }}" required class="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-violet-500 outline-none">
</div>
<div>
<label class="block text-sm font-medium text-slate-700 mb-1">Neues Passwort <span class="text-slate-400">(leer = unverändert)</span></label>
<input name="password" type="password" class="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-violet-500 outline-none">
</div>
<div>
<label class="block text-sm font-medium text-slate-700 mb-1">🪙 Münzen</label>
<input name="points" type="number" min="0" value="{{ old('points',$user->points) }}" required class="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-violet-500 outline-none">
</div>
<button type="submit" class="w-full bg-violet-600 hover:bg-violet-700 text-white py-2 rounded-lg font-medium text-sm">Speichern</button>
</form>
</div>
</div>
@endsection
@@ -0,0 +1,40 @@
@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-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-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">
<a href="{{ route('admin.users.edit',$u) }}" class="text-violet-600 hover:underline mr-3">Bearbeiten</a>
<form method="POST" action="{{ route('admin.users.destroy',$u) }}" class="inline" onsubmit="return confirm('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