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

37 lines
2.9 KiB
PHP
Raw Normal View History

2026-08-10 12:39:16 +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">
<a href="{{ route('workouts.index') }}" class="text-sm text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white">&larr; My Workouts</a>
<h1 class="mt-2 text-2xl sm:text-3xl font-extrabold tracking-tight text-gray-900 dark:text-white">Community Workouts</h1>
<p class="mt-2 text-gray-600 dark:text-gray-300">Workouts other members have made public. Copy one to your own library to use it.</p>
</div>
</section>
<section class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-6">
<form action="{{ route('workouts.community') }}" method="GET" class="mb-6 flex items-end gap-3 bg-white dark:bg-gray-800 rounded-2xl p-4 ring-1 ring-gray-200 dark:ring-gray-700">
<div class="w-full sm:w-80">
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300">Search</label>
<input type="text" name="q" value="{{ $filters['q'] ?? '' }}" placeholder="Search by title" 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 placeholder-gray-400 focus:border-indigo-500 focus:ring-indigo-500 px-3 py-2">
</div>
<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">Search</button>
</form>
@if($workouts->count() === 0)
<div class="rounded-2xl border border-dashed border-gray-300 dark:border-gray-700 p-8 text-center text-gray-600 dark:text-gray-300">No public workouts yet. Make one of yours public from its page to be the first.</div>
@else
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
@foreach($workouts as $workout)
<a href="{{ route('workouts.show', $workout) }}" class="rounded-2xl ring-1 ring-gray-200 dark:ring-gray-700 bg-white dark:bg-gray-800 p-5 hover:shadow-lg transition flex flex-col">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">{{ $workout->title }}</h3>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-300">by {{ $workout->user->name }} &middot; {{ $workout->items->count() }} exercises @if($workout->estimated_minutes) &middot; ~{{ $workout->estimated_minutes }} min @endif</p>
@if($workout->notes)
<p class="mt-2 text-sm text-gray-600 dark:text-gray-300 line-clamp-3">{{ $workout->notes }}</p>
@endif
</a>
@endforeach
</div>
<div class="mt-6">{{ $workouts->links() }}</div>
@endif
</section>
</x-app-layout>