Files
lernapp/resources/views/admin/dashboard.blade.php
T

52 lines
2.6 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','Dashboard')
@section('content')
<div class="grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8">
<div class="bg-white rounded-xl p-5 shadow-sm border border-slate-200">
<div class="text-2xl font-bold text-slate-800">{{ $children }}</div>
<div class="text-sm text-slate-500 mt-1">👦 Kinder</div>
</div>
<div class="bg-white rounded-xl p-5 shadow-sm border border-slate-200">
<div class="text-2xl font-bold text-slate-800">{{ $questions }}</div>
<div class="text-sm text-slate-500 mt-1"> Fragen</div>
</div>
<div class="bg-white rounded-xl p-5 shadow-sm border border-slate-200">
<div class="text-2xl font-bold text-slate-800">{{ $attempts_today }}</div>
<div class="text-sm text-slate-500 mt-1">📝 Antworten heute</div>
</div>
<div class="bg-white rounded-xl p-5 shadow-sm border border-slate-200 {{ $pending > 0 ? 'border-red-300 bg-red-50' : '' }}">
<div class="text-2xl font-bold {{ $pending > 0 ? 'text-red-600' : 'text-slate-800' }}">{{ $pending }}</div>
<div class="text-sm text-slate-500 mt-1">🎁 Offene Einlösungen</div>
</div>
</div>
<div class="grid lg:grid-cols-2 gap-6">
<div class="bg-white rounded-xl shadow-sm border border-slate-200 p-5">
<h2 class="font-semibold text-slate-800 mb-4">🏆 Bestenliste</h2>
@forelse($topKids as $i => $kid)
<div class="flex items-center justify-between py-2 {{ !$loop->last ? 'border-b border-slate-100' : '' }}">
<div class="flex items-center gap-3">
<span class="text-lg">{{ ['🥇','🥈','🥉','4.','5.'][$i] }}</span>
<span class="font-medium text-slate-700">{{ $kid->name }}</span>
</div>
<span class="text-amber-600 font-bold">🪙 {{ $kid->points }}</span>
</div>
@empty<p class="text-slate-400 text-sm">Noch keine Kinder angelegt.</p>@endforelse
</div>
<div class="bg-white rounded-xl shadow-sm border border-slate-200 p-5">
<h2 class="font-semibold text-slate-800 mb-4">📝 Letzte Aktivität</h2>
<div class="space-y-2">
@forelse($recentAttempts as $a)
<div class="flex items-center justify-between text-sm">
<div class="flex items-center gap-2">
<span>{{ $a->is_correct ? '✅' : '❌' }}</span>
<span class="text-slate-600">{{ $a->user->name }}</span>
<span class="text-slate-400"> {{ $a->question->subject->name }}</span>
</div>
<span class="text-xs text-slate-400">{{ $a->created_at->diffForHumans() }}</span>
</div>
@empty<p class="text-slate-400 text-sm">Noch keine Aktivität.</p>@endforelse
</div>
</div>
</div>
@endsection