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

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Poker Planning</title>
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body class="bg-gray-50 min-h-screen flex flex-col">
<main class="container mx-auto px-4 py-8 max-w-2xl flex-grow">
@yield('content')
</main>
<footer class="text-center text-gray-500 text-sm py-4 border-t mt-auto">
Poker Planning © {{ date('Y') }}
</footer>
</body>
</html>

View File

@@ -0,0 +1,14 @@
@extends('layouts.app')
@section('content')
<div class="text-center">
<div class="bg-green-100 text-green-800 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
</svg>
</div>
<h1 class="text-2xl font-bold text-gray-800 mb-2">Спасибо за оценку!</h1>
<p class="text-gray-600 mb-6">Ваш голос учтён.</p>
<a href="/" class="text-blue-600 hover:underline">&larr; Вернуться на главную</a>
</div>
@endsection

View File

@@ -0,0 +1,39 @@
@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-2">Оцените задачу</h1>
<p class="text-gray-600 mb-6">Выберите оценку от 1 до {{ $round->max_score }}</p>
@if ($errors->any())
<div class="mb-4 p-3 bg-red-50 text-red-700 rounded-lg text-sm">
{{ $errors->first() }}
</div>
@endif
<form method="POST" class="space-y-4">
@csrf
<div>
<label class="block text-gray-700 mb-1">Ваше имя</label>
<input type="text" name="name" 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="Иван Петров">
</div>
<div>
<label class="block text-gray-700 mb-1">Оценка</label>
<select name="score" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent">
@for ($i = 1; $i <= $round->max_score; $i++)
<option value="{{ $i }}">{{ $i }}</option>
@endfor
</select>
</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>
@endsection