Files
fitness/resources/views/workouts/create.blade.php
T

40 lines
2.8 KiB
PHP
Raw Normal View History

2025-10-02 22:52:13 +03:00
<x-app-layout>
<section class="bg-white dark:bg-gray-900 border-b border-gray-100 dark:border-gray-800">
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-8">
<h1 class="text-2xl sm:text-3xl font-extrabold tracking-tight text-gray-900 dark:text-white">Create Workout</h1>
<p class="mt-2 text-gray-600 dark:text-gray-300">Give your workout a name and optional details.</p>
</div>
</section>
<section class="mx-auto max-w-2xl px-4 sm:px-6 lg:px-8 py-8">
@if ($errors->any())
<div class="mb-4 rounded-xl bg-red-50 text-red-700 px-4 py-3">
<ul class="list-disc ms-5 text-sm">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<form action="{{ route('workouts.store') }}" method="POST" class="space-y-5 bg-white dark:bg-gray-800 rounded-2xl p-6 ring-1 ring-gray-200 dark:ring-gray-700">
@csrf
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300">Title</label>
<input type="text" name="title" value="{{ old('title') }}" required class="mt-1 w-full rounded-xl border-gray-300 dark:border-gray-700 bg-white/80 dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-indigo-500 focus:ring-indigo-500 px-3 py-2">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300">Estimated Minutes</label>
<input type="number" name="estimated_minutes" value="{{ old('estimated_minutes') }}" min="1" class="mt-1 w-full rounded-xl border-gray-300 dark:border-gray-700 bg-white/80 dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-indigo-500 focus:ring-indigo-500 px-3 py-2">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300">Notes</label>
<textarea name="notes" rows="4" class="mt-1 w-full rounded-xl border-gray-300 dark:border-gray-700 bg-white/80 dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-indigo-500 focus:ring-indigo-500 px-3 py-2">{{ old('notes') }}</textarea>
</div>
<div class="flex items-center gap-3">
<a href="{{ route('workouts.index') }}" class="text-sm text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white">Cancel</a>
<button type="submit" class="inline-flex items-center rounded-xl bg-gradient-to-r from-fuchsia-600 to-indigo-600 px-4 py-2 text-sm font-semibold text-white shadow hover:from-fuchsia-500 hover:to-indigo-500">Create Workout</button>
</div>
</form>
</section>
</x-app-layout>