add poker planing for students

This commit is contained in:
2025-11-15 11:11:04 +03:00
parent a78b63ea2d
commit cf635f81dd
14 changed files with 2799 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
@extends('layouts.app')
@section('content')
<div class="bg-white p-6 rounded-xl shadow-md">
<h1 class="text-2xl font-bold text-gray-800 mb-4">Создать новую сессию</h1>
@if (session('success'))
<div class="mb-4 p-3 bg-green-50 text-green-700 rounded-lg text-sm">
{{ session('success') }}
</div>
@endif
<form method="POST" action="{{ route('admin.sessions.store') }}" class="space-y-4">
@csrf
<div>
<label class="block text-gray-700 mb-1">Максимальная оценка</label>
<input type="number" name="max_score" min="2" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="Например: 10">
<p class="text-sm text-gray-500 mt-1">Участники будут выбирать от 1 до этого числа</p>
</div>
<div>
<label class="block text-gray-700 mb-1">Максимум участников</label>
<input type="number" name="max_voters" min="1" max="100" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="Например: 10">
</div>
<button type="submit"
class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2.5 px-4 rounded-lg transition">
Создать сессию
</button>
</form>
<div class="mt-6 pt-6 border-t">
<a href="{{ route('admin.sessions') }}" class="text-blue-600 hover:underline">&larr; Назад к списку</a>
</div>
</div>
@endsection

View File

@@ -0,0 +1,35 @@
@extends('layouts.app')
@section('content')
<div class="bg-white p-6 rounded-xl shadow-md">
<div class="mb-4">
<a href="{{ route('admin.sessions') }}" class="text-blue-600 hover:underline text-sm">&larr; Назад</a>
</div>
<h1 class="text-2xl font-bold text-gray-800 mb-2">Сессия #{{ $round->id }}</h1>
<p class="text-gray-600 mb-4">
Диапазон: 1{{ $round->max_score }} |
Участников: {{ $round->votes->count() }} / {{ $round->max_voters }}
</p>
<div class="bg-blue-50 p-4 rounded-lg mb-6">
<p class="text-lg font-semibold text-blue-800">
Средняя оценка: <span class="text-2xl">{{ number_format($round->average_score, 2) }}</span>
</p>
</div>
@if($round->votes->isEmpty())
<p class="text-gray-500">Пока никто не проголосовал.</p>
@else
<h2 class="text-lg font-medium text-gray-800 mb-3">Участники:</h2>
<div class="space-y-2">
@foreach($round->votes as $vote)
<div class="flex justify-between items-center bg-gray-50 px-4 py-2 rounded">
<span class="font-medium">{{ $vote->name }}</span>
<span class="bg-white px-3 py-1 rounded-full font-bold text-blue-700">{{ $vote->score }}</span>
</div>
@endforeach
</div>
@endif
</div>
@endsection

View File

@@ -0,0 +1,38 @@
@extends('layouts.app')
@section('content')
<div class="space-y-6">
<div class="flex justify-between items-center">
<h1 class="text-2xl font-bold text-gray-800">Сессии оценки</h1>
<a href="{{ route('admin.session.create') }}"
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm font-medium">
+ Новая сессия
</a>
</div>
@if ($sessions->isEmpty())
<div class="text-center py-10 text-gray-500">Нет созданных сессий</div>
@else
<div class="space-y-4">
@foreach($sessions as $s)
<div class="bg-white p-5 rounded-xl shadow-sm border border-gray-100">
<div class="flex justify-between items-start">
<div>
<h3 class="font-medium text-gray-800">Сессия #{{ $s->id }}</h3>
<p class="text-sm text-gray-600">
Оценки: 1{{ $s->max_score }} | Участников: {{ $s->votes_count }} / {{ $s->max_voters }}
</p>
</div>
<a href="/admin/sessions/{{ $s->id }}"
class="text-blue-600 hover:underline text-sm font-medium">Просмотр</a>
</div>
<div class="mt-3 p-3 bg-gray-50 rounded text-sm font-mono break-all">
<strong>Ссылка:</strong> <a href="/s/{{ $s->token }}" target="_blank"
class="text-blue-600 hover:underline">{{ url('/s/' . $s->token) }}</a>
</div>
</div>
@endforeach
</div>
@endif
</div>
@endsection