some progress
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-md mx-auto">
|
||||
<div class="bg-white rounded-xl shadow-md border border-gray-100">
|
||||
<div class="px-6 py-4 border-b border-gray-100">
|
||||
<h2 class="text-lg font-semibold">{{ __('Login') }}</h2>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<form method="POST" action="{{ route('login') }}" class="space-y-5">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<label for="email" class="block text-sm font-medium text-gray-700">{{ __('Email Address') }}</label>
|
||||
<input id="email" type="email" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus
|
||||
class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 shadow-sm @error('email') border-red-500 focus:border-red-500 focus:ring-red-500 @enderror">
|
||||
@error('email')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password" class="block text-sm font-medium text-gray-700">{{ __('Password') }}</label>
|
||||
<input id="password" type="password" name="password" required autocomplete="current-password"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 shadow-sm @error('password') border-red-500 focus:border-red-500 focus:ring-red-500 @enderror">
|
||||
@error('password')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<label class="inline-flex items-center">
|
||||
<input type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}
|
||||
class="rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
<span class="ml-2 text-sm text-gray-700">{{ __('Remember Me') }}</span>
|
||||
</label>
|
||||
|
||||
@if (Route::has('password.request'))
|
||||
<a class="text-sm text-indigo-600 hover:text-indigo-700" href="{{ route('password.request') }}">
|
||||
{{ __('Forgot Your Password?') }}
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit" class="w-full inline-flex justify-center items-center px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white font-medium rounded-md shadow-sm transition-colors">
|
||||
{{ __('Login') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,49 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Confirm Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ __('Please confirm your password before continuing.') }}
|
||||
|
||||
<form method="POST" action="{{ route('password.confirm') }}">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-8 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Confirm Password') }}
|
||||
</button>
|
||||
|
||||
@if (Route::has('password.request'))
|
||||
<a class="btn btn-link" href="{{ route('password.request') }}">
|
||||
{{ __('Forgot Your Password?') }}
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('password.email') }}">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Send Password Reset Link') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('password.update') }}">
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password-confirm" class="col-md-4 col-form-label text-md-end">{{ __('Confirm Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Reset Password') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,55 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-md mx-auto">
|
||||
<div class="bg-white rounded-xl shadow-md border border-gray-100">
|
||||
<div class="px-6 py-4 border-b border-gray-100">
|
||||
<h2 class="text-lg font-semibold">{{ __('Register') }}</h2>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<form method="POST" action="{{ route('register') }}" class="space-y-5">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<label for="name" class="block text-sm font-medium text-gray-700">{{ __('Name') }}</label>
|
||||
<input id="name" type="text" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus
|
||||
class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 shadow-sm @error('name') border-red-500 focus:border-red-500 focus:ring-red-500 @enderror">
|
||||
@error('name')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="email" class="block text-sm font-medium text-gray-700">{{ __('Email Address') }}</label>
|
||||
<input id="email" type="email" name="email" value="{{ old('email') }}" required autocomplete="email"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 shadow-sm @error('email') border-red-500 focus:border-red-500 focus:ring-red-500 @enderror">
|
||||
@error('email')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password" class="block text-sm font-medium text-gray-700">{{ __('Password') }}</label>
|
||||
<input id="password" type="password" name="password" required autocomplete="new-password"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 shadow-sm @error('password') border-red-500 focus:border-red-500 focus:ring-red-500 @enderror">
|
||||
@error('password')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password-confirm" class="block text-sm font-medium text-gray-700">{{ __('Confirm Password') }}</label>
|
||||
<input id="password-confirm" type="password" name="password_confirmation" required autocomplete="new-password"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 shadow-sm">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit" class="w-full inline-flex justify-center items-center px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white font-medium rounded-md shadow-sm transition-colors">
|
||||
{{ __('Register') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,28 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Verify Your Email Address') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('resent'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('A fresh verification link has been sent to your email address.') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ __('Before proceeding, please check your email for a verification link.') }}
|
||||
{{ __('If you did not receive the email') }},
|
||||
<form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link p-0 m-0 align-baseline">{{ __('click here to request another') }}</button>.
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,97 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<h1 class="text-3xl font-bold text-indigo-700 mb-6">All Books</h1>
|
||||
|
||||
<form method="GET" action="{{ route('books.index') }}" class="bg-white rounded-lg shadow p-4 mb-6">
|
||||
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700">Search</label>
|
||||
<input type="text" name="q" value="{{ $filters['q'] ?? '' }}" placeholder="Title or description..." class="mt-1 w-full border-gray-300 rounded-md" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700">Category</label>
|
||||
<select name="category" class="mt-1 w-full border-gray-300 rounded-md">
|
||||
<option value="">All</option>
|
||||
@foreach($categories as $cat)
|
||||
<option value="{{ $cat->slug }}" {{ ($filters['category'] ?? '') == $cat->slug || ($filters['category'] ?? '') == (string)$cat->id ? 'selected' : '' }}>{{ $cat->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700">Author</label>
|
||||
<select name="author" class="mt-1 w-full border-gray-300 rounded-md">
|
||||
<option value="">All</option>
|
||||
@foreach($authors as $auth)
|
||||
<option value="{{ $auth->slug }}" {{ ($filters['author'] ?? '') == $auth->slug || ($filters['author'] ?? '') == (string)$auth->id ? 'selected' : '' }}>{{ $auth->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700">From</label>
|
||||
<input type="date" name="date_from" value="{{ $filters['date_from'] ?? '' }}" class="mt-1 w-full border-gray-300 rounded-md" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700">To</label>
|
||||
<input type="date" name="date_to" value="{{ $filters['date_to'] ?? '' }}" class="mt-1 w-full border-gray-300 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 flex items-center gap-3">
|
||||
<button type="submit" class="px-4 py-2 bg-indigo-600 text-white rounded-md">Filter</button>
|
||||
<a href="{{ route('books.index') }}" class="px-4 py-2 bg-gray-100 text-gray-800 rounded-md">Reset</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@if($books->count() === 0)
|
||||
<div class="bg-white rounded-lg shadow p-6 text-center text-gray-600">No books found.</div>
|
||||
@else
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
@foreach($books as $book)
|
||||
<div class="bg-white rounded-lg shadow overflow-hidden">
|
||||
@if($book->cover_image)
|
||||
<img src="{{ $book->cover_image }}" alt="{{ $book->title }} cover" class="w-full h-48 object-cover" />
|
||||
@else
|
||||
<div class="w-full h-48 bg-gray-200 flex items-center justify-center text-gray-500">No Cover</div>
|
||||
@endif
|
||||
<div class="p-4">
|
||||
<h2 class="text-lg font-semibold"><a href="{{ route('books.show', $book) }}" class="hover:underline">{{ $book->title }}</a></h2>
|
||||
<p class="text-sm text-gray-600">
|
||||
@if($book->authors && $book->authors->count())
|
||||
{{ $book->authors->pluck('name')->join(', ') }}
|
||||
@elseif($book->author)
|
||||
{{ $book->author }}
|
||||
@endif
|
||||
</p>
|
||||
@if($book->category)
|
||||
<p class="text-xs text-gray-500 mt-1">Category: {{ $book->category->name }}</p>
|
||||
@endif
|
||||
|
||||
@auth
|
||||
<div class="mt-3">
|
||||
@php($inReadlist = auth()->user()->readlistBooks()->where('book_id', $book->id)->exists())
|
||||
@if(!$inReadlist)
|
||||
<form action="{{ route('readlist.store', $book) }}" method="POST">
|
||||
@csrf
|
||||
<button type="submit" class="px-3 py-2 text-sm bg-indigo-600 hover:bg-indigo-700 text-white rounded-md">Add to Readlist</button>
|
||||
</form>
|
||||
@else
|
||||
<form action="{{ route('readlist.destroy', $book) }}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="px-3 py-2 text-sm bg-red-50 text-red-700 hover:bg-red-100 rounded-md">Remove</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
{{ $books->links() }}
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@@ -0,0 +1,184 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<article class="bg-white rounded-lg shadow overflow-hidden">
|
||||
<div class="md:flex">
|
||||
@if($book->cover_image)
|
||||
<img src="{{ $book->cover_image }}" alt="{{ $book->title }} cover" class="w-full md:w-1/3 h-64 md:h-auto object-cover">
|
||||
@endif
|
||||
<div class="p-6 md:w-2/3">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">{{ $book->title }}</h1>
|
||||
<p class="mt-1 text-gray-700">
|
||||
@if($book->authors && $book->authors->count())
|
||||
{{ $book->authors->pluck('name')->join(', ') }}
|
||||
@elseif($book->author)
|
||||
{{ $book->author }}
|
||||
@endif
|
||||
</p>
|
||||
@if($book->category)
|
||||
<p class="text-sm text-gray-500 mt-1">Category: {{ $book->category->name }}</p>
|
||||
@endif
|
||||
@if($book->publication_date)
|
||||
<p class="text-sm text-gray-500">Published: {{ $book->publication_date }}</p>
|
||||
@endif
|
||||
@if($book->description)
|
||||
<div class="mt-4 prose max-w-none">{!! nl2br(e($book->description)) !!}</div>
|
||||
@endif
|
||||
|
||||
@auth
|
||||
<div class="mt-4">
|
||||
@php($inReadlist = auth()->user()->readlistBooks()->where('book_id', $book->id)->exists())
|
||||
@if(!$inReadlist)
|
||||
<form action="{{ route('readlist.store', $book) }}" method="POST">
|
||||
@csrf
|
||||
<button type="submit" class="inline-flex items-center px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-md">Add to Readlist</button>
|
||||
</form>
|
||||
@else
|
||||
<form action="{{ route('readlist.destroy', $book) }}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="inline-flex items-center px-4 py-2 bg-red-50 text-red-700 hover:bg-red-100 rounded-md">Remove from Readlist</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-6 border-t">
|
||||
<div class="mb-4">
|
||||
@if (session('success'))
|
||||
<div class="bg-green-50 text-green-800 border border-green-200 rounded-md px-4 py-2 mb-4">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if ($errors->any())
|
||||
<div class="bg-red-50 text-red-800 border border-red-200 rounded-md px-4 py-2 mb-4">
|
||||
<ul class="list-disc list-inside">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<h2 class="text-2xl font-semibold mb-3">Summary</h2>
|
||||
@if($book->summary)
|
||||
<div class="prose max-w-none">
|
||||
{!! nl2br(e($book->summary->content)) !!}
|
||||
</div>
|
||||
@if($book->summary->key_insights)
|
||||
<h3 class="text-xl font-semibold mt-6">Key insights</h3>
|
||||
<p class="mt-2">{!! nl2br(e($book->summary->key_insights)) !!}</p>
|
||||
@endif
|
||||
@else
|
||||
<p class="text-gray-600">No summary available for this book yet.</p>
|
||||
@auth
|
||||
<div class="mt-3">
|
||||
<a href="{{ route('requests.create') }}" class="inline-flex items-center px-3 py-2 text-sm bg-indigo-600 hover:bg-indigo-700 text-white rounded-md">Request a summary</a>
|
||||
</div>
|
||||
@else
|
||||
<p class="text-sm text-gray-600 mt-2">Want one? <a href="{{ route('login') }}" class="text-indigo-600 hover:underline">Log in</a> to request a summary.</p>
|
||||
@endauth
|
||||
@endif
|
||||
|
||||
<div class="mt-8 pt-6 border-t">
|
||||
<h3 class="text-lg font-semibold mb-2">Is this summary inaccurate?</h3>
|
||||
@auth
|
||||
<form action="{{ route('summary-reports.store', $book) }}" method="POST" class="space-y-3">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="reason" class="block text-sm font-medium text-gray-700">Reason</label>
|
||||
<select id="reason" name="reason" class="mt-1 block w-full border-gray-300 rounded-md">
|
||||
<option value="inaccurate">Inaccurate information</option>
|
||||
<option value="incomplete">Incomplete or missing key points</option>
|
||||
<option value="offensive">Offensive or inappropriate</option>
|
||||
<option value="other">Other</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="details" class="block text-sm font-medium text-gray-700">Details (optional)</label>
|
||||
<textarea id="details" name="details" rows="3" placeholder="Please describe what's wrong..." class="mt-1 block w-full border-gray-300 rounded-md">{{ old('details') }}</textarea>
|
||||
</div>
|
||||
<button type="submit" class="inline-flex items-center px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-md">Report issue</button>
|
||||
</form>
|
||||
@else
|
||||
<p class="text-sm text-gray-600">Please <a href="{{ route('login') }}" class="text-indigo-600 hover:underline">log in</a> to report issues with this summary.</p>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Reviews Section -->
|
||||
<div class="p-6 border-t">
|
||||
<h2 class="text-2xl font-semibold mb-4">Reviews</h2>
|
||||
|
||||
<div class="mb-6 flex items-center gap-3">
|
||||
<div class="flex items-center">
|
||||
@for($i=1;$i<=5;$i++)
|
||||
<svg class="w-5 h-5 {{ $i <= round($avgRating) ? 'text-yellow-400' : 'text-gray-300' }}" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.803 2.036a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.803-2.036a1 1 0 00-1.176 0l-2.803 2.036c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81H7.03a1 1 0 00.95-.69l1.07-3.292z"/>
|
||||
</svg>
|
||||
@endfor
|
||||
</div>
|
||||
<div class="text-gray-600 text-sm">{{ $avgRating > 0 ? number_format($avgRating, 1) : 'No ratings yet' }} @if($reviewsCount) • {{ $reviewsCount }} {{ Str::plural('review', $reviewsCount) }} @endif</div>
|
||||
</div>
|
||||
|
||||
@auth
|
||||
<div class="mb-6 bg-gray-50 border border-gray-200 rounded-lg p-4">
|
||||
<h3 class="text-lg font-semibold mb-2">{{ $userReview ? 'Update your review' : 'Leave a review' }}</h3>
|
||||
<form action="{{ route('reviews.store', $book) }}" method="POST" class="space-y-3">
|
||||
@csrf
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700">Rating</label>
|
||||
<select name="rating" class="mt-1 block w-32 border-gray-300 rounded-md">
|
||||
@for($i=5;$i>=1;$i--)
|
||||
<option value="{{ $i }}" {{ old('rating', optional($userReview)->rating) == $i ? 'selected' : '' }}>{{ $i }} star{{ $i>1?'s':'' }}</option>
|
||||
@endfor
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700">Comment (optional)</label>
|
||||
<textarea name="comment" rows="3" class="mt-1 block w-full border-gray-300 rounded-md" placeholder="Share your thoughts...">{{ old('comment', optional($userReview)->comment) }}</textarea>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<button type="submit" class="inline-flex items-center px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-md">{{ $userReview ? 'Update Review' : 'Submit Review' }}</button>
|
||||
</div>
|
||||
</form>
|
||||
@if($userReview)
|
||||
<form action="{{ route('reviews.destroy', $userReview) }}" method="POST" class="mt-3" onsubmit="return confirm('Delete your review?')">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="px-3 py-2 text-sm bg-red-50 text-red-700 hover:bg-red-100 rounded-md">Delete your review</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<p class="text-sm text-gray-600 mb-6">Please <a href="{{ route('login') }}" class="text-indigo-600 hover:underline">log in</a> to leave a review.</p>
|
||||
@endauth
|
||||
|
||||
@if($book->reviews->count())
|
||||
<ul class="space-y-4">
|
||||
@foreach($book->reviews->sortByDesc('created_at') as $review)
|
||||
<li class="border border-gray-100 rounded-lg p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-sm font-semibold">{{ $review->user->name }}</span>
|
||||
<span class="text-xs text-gray-500">• {{ $review->created_at->diffForHumans() }}</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
@for($i=1;$i<=5;$i++)
|
||||
<svg class="w-4 h-4 {{ $i <= $review->rating ? 'text-yellow-400' : 'text-gray-300' }}" fill="currentColor" viewBox="0 0 20 20"><path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.803 2.036a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.803-2.036a1 1 0 00-1.176 0l-2.803 2.036c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81H7.03a1 1 0 00.95-.69l1.07-3.292z"/></svg>
|
||||
@endfor
|
||||
</div>
|
||||
</div>
|
||||
@if($review->comment)
|
||||
<p class="mt-2 text-gray-700">{{ $review->comment }}</p>
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
<p class="text-gray-600">No reviews yet. Be the first to review this summary.</p>
|
||||
@endif
|
||||
</div>
|
||||
</article>
|
||||
@endsection
|
||||
@@ -1,49 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Create Category - Open Text Summaries</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">Create New Category</h1>
|
||||
</div>
|
||||
@extends('layouts.app')
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<form action="{{ route('categories.store') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="name" class="block text-gray-700 text-sm font-bold mb-2">Name:</label>
|
||||
<input type="text" name="name" id="name" value="{{ old('name') }}"
|
||||
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline @error('name') border-red-500 @enderror">
|
||||
@error('name')
|
||||
<p class="text-red-500 text-xs italic mt-1">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label for="description" class="block text-gray-700 text-sm font-bold mb-2">Description:</label>
|
||||
<textarea name="description" id="description" rows="4"
|
||||
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline @error('description') border-red-500 @enderror">{{ old('description') }}</textarea>
|
||||
@error('description')
|
||||
<p class="text-red-500 text-xs italic mt-1">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">
|
||||
Create Category
|
||||
</button>
|
||||
<a href="{{ route('categories.index') }}" class="text-indigo-600 hover:text-indigo-800">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@section('content')
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">Create New Category</h1>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<form action="{{ route('categories.store') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="name" class="block text-gray-700 text-sm font-bold mb-2">Name:</label>
|
||||
<input type="text" name="name" id="name" value="{{ old('name') }}"
|
||||
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline @error('name') border-red-500 @enderror">
|
||||
@error('name')
|
||||
<p class="text-red-500 text-xs italic mt-1">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label for="description" class="block text-gray-700 text-sm font-bold mb-2">Description:</label>
|
||||
<textarea name="description" id="description" rows="4"
|
||||
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline @error('description') border-red-500 @enderror">{{ old('description') }}</textarea>
|
||||
@error('description')
|
||||
<p class="text-red-500 text-xs italic mt-1">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">
|
||||
Create Category
|
||||
</button>
|
||||
<a href="{{ route('categories.index') }}" class="text-indigo-600 hover:text-indigo-800">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -1,50 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Edit Category - Open Text Summaries</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">Edit Category</h1>
|
||||
</div>
|
||||
@extends('layouts.app')
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<form action="{{ route('categories.update', $category) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="name" class="block text-gray-700 text-sm font-bold mb-2">Name:</label>
|
||||
<input type="text" name="name" id="name" value="{{ old('name', $category->name) }}"
|
||||
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline @error('name') border-red-500 @enderror">
|
||||
@error('name')
|
||||
<p class="text-red-500 text-xs italic mt-1">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label for="description" class="block text-gray-700 text-sm font-bold mb-2">Description:</label>
|
||||
<textarea name="description" id="description" rows="4"
|
||||
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline @error('description') border-red-500 @enderror">{{ old('description', $category->description) }}</textarea>
|
||||
@error('description')
|
||||
<p class="text-red-500 text-xs italic mt-1">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">
|
||||
Update Category
|
||||
</button>
|
||||
<a href="{{ route('categories.index') }}" class="text-indigo-600 hover:text-indigo-800">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@section('content')
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">Edit Category</h1>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<form action="{{ route('categories.update', $category) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="name" class="block text-gray-700 text-sm font-bold mb-2">Name:</label>
|
||||
<input type="text" name="name" id="name" value="{{ old('name', $category->name) }}"
|
||||
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline @error('name') border-red-500 @enderror">
|
||||
@error('name')
|
||||
<p class="text-red-500 text-xs italic mt-1">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label for="description" class="block text-gray-700 text-sm font-bold mb-2">Description:</label>
|
||||
<textarea name="description" id="description" rows="4"
|
||||
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline @error('description') border-red-500 @enderror">{{ old('description', $category->description) }}</textarea>
|
||||
@error('description')
|
||||
<p class="text-red-500 text-xs italic mt-1">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">
|
||||
Update Category
|
||||
</button>
|
||||
<a href="{{ route('categories.index') }}" class="text-indigo-600 hover:text-indigo-800">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -1,74 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Categories - Open Text Summaries</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">Categories</h1>
|
||||
<a href="{{ route('categories.create') }}" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded">
|
||||
Add New Category
|
||||
</a>
|
||||
</div>
|
||||
@extends('layouts.app')
|
||||
|
||||
@if (session('success'))
|
||||
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative mb-4" role="alert">
|
||||
<span class="block sm:inline">{{ session('success') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg overflow-hidden">
|
||||
<table class="min-w-full bg-white">
|
||||
<thead class="bg-gray-100 text-gray-600 uppercase text-sm leading-normal">
|
||||
<tr>
|
||||
<th class="py-3 px-6 text-left">Name</th>
|
||||
<th class="py-3 px-6 text-left">Description</th>
|
||||
<th class="py-3 px-6 text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-gray-600 text-sm">
|
||||
@forelse ($categories as $category)
|
||||
<tr class="border-b border-gray-200 hover:bg-gray-50">
|
||||
<td class="py-3 px-6 text-left">
|
||||
<div class="font-medium">{{ $category->name }}</div>
|
||||
</td>
|
||||
<td class="py-3 px-6 text-left">
|
||||
<div>{{ Str::limit($category->description, 100) }}</div>
|
||||
</td>
|
||||
<td class="py-3 px-6 text-center">
|
||||
<div class="flex justify-center">
|
||||
<a href="{{ route('categories.show', $category) }}" class="text-blue-500 hover:text-blue-700 mx-1">
|
||||
View
|
||||
</a>
|
||||
<a href="{{ route('categories.edit', $category) }}" class="text-yellow-500 hover:text-yellow-700 mx-1">
|
||||
Edit
|
||||
</a>
|
||||
<form action="{{ route('categories.destroy', $category) }}" method="POST" class="inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="text-red-500 hover:text-red-700 mx-1" onclick="return confirm('Are you sure you want to delete this category?')">
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="3" class="py-3 px-6 text-center">No categories found</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="/" class="text-indigo-600 hover:text-indigo-800">Back to Home</a>
|
||||
</div>
|
||||
@section('content')
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">Categories</h1>
|
||||
<a href="{{ route('categories.create') }}" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded">
|
||||
Add New Category
|
||||
</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@if (session('success'))
|
||||
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative mb-4" role="alert">
|
||||
<span class="block sm:inline">{{ session('success') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg overflow-hidden">
|
||||
<table class="min-w-full bg-white">
|
||||
<thead class="bg-gray-100 text-gray-600 uppercase text-sm leading-normal">
|
||||
<tr>
|
||||
<th class="py-3 px-6 text-left">Name</th>
|
||||
<th class="py-3 px-6 text-left">Description</th>
|
||||
<th class="py-3 px-6 text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-gray-600 text-sm">
|
||||
@forelse ($categories as $category)
|
||||
<tr class="border-b border-gray-200 hover:bg-gray-50">
|
||||
<td class="py-3 px-6 text-left">
|
||||
<div class="font-medium">{{ $category->name }}</div>
|
||||
</td>
|
||||
<td class="py-3 px-6 text-left">
|
||||
<div>{{ Str::limit($category->description, 100) }}</div>
|
||||
</td>
|
||||
<td class="py-3 px-6 text-center">
|
||||
<div class="flex justify-center">
|
||||
<a href="{{ route('categories.show', $category) }}" class="text-blue-500 hover:text-blue-700 mx-1">
|
||||
View
|
||||
</a>
|
||||
<a href="{{ route('categories.edit', $category) }}" class="text-yellow-500 hover:text-yellow-700 mx-1">
|
||||
Edit
|
||||
</a>
|
||||
<form action="{{ route('categories.destroy', $category) }}" method="POST" class="inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="text-red-500 hover:text-red-700 mx-1" onclick="return confirm('Are you sure you want to delete this category?')">
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="3" class="py-3 px-6 text-center">No categories found</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="/" class="text-indigo-600 hover:text-indigo-800">Back to Home</a>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -1,65 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ $category->name }} - Open Text Summaries</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">{{ $category->name }}</h1>
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">{{ $category->name }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Category Details</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<p class="text-gray-700"><span class="font-semibold">Name:</span> {{ $category->name }}</p>
|
||||
</div>
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Category Details</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<p class="text-gray-700"><span class="font-semibold">Name:</span> {{ $category->name }}</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<p class="text-gray-700"><span class="font-semibold">Description:</span></p>
|
||||
<p class="text-gray-700 mt-2">{{ $category->description }}</p>
|
||||
</div>
|
||||
|
||||
<div class="flex mt-6">
|
||||
<a href="{{ route('categories.edit', $category) }}" class="bg-yellow-500 hover:bg-yellow-600 text-white font-bold py-2 px-4 rounded mr-2">
|
||||
Edit
|
||||
</a>
|
||||
<form action="{{ route('categories.destroy', $category) }}" method="POST" class="inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded" onclick="return confirm('Are you sure you want to delete this category?')">
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<p class="text-gray-700"><span class="font-semibold">Description:</span></p>
|
||||
<p class="text-gray-700 mt-2">{{ $category->description }}</p>
|
||||
</div>
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Books in this Category</h2>
|
||||
|
||||
@if($category->books->count() > 0)
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
@foreach($category->books as $book)
|
||||
<div class="border rounded-lg p-4 hover:shadow-md transition-shadow">
|
||||
<h3 class="font-bold text-lg mb-1">{{ $book->title }}</h3>
|
||||
<p class="text-gray-600 text-sm mb-2">By {{ $book->author }}</p>
|
||||
<p class="text-gray-700 mb-3">{{ Str::limit($book->description, 100) }}</p>
|
||||
<a href="{{ route('books.show', $book) }}" class="text-indigo-600 hover:text-indigo-800">View Details →</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<p class="text-gray-700">No books found in this category.</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="{{ route('categories.index') }}" class="text-indigo-600 hover:text-indigo-800">Back to Categories</a>
|
||||
<div class="flex mt-6">
|
||||
<a href="{{ route('categories.edit', $category) }}" class="bg-yellow-500 hover:bg-yellow-600 text-white font-bold py-2 px-4 rounded mr-2">
|
||||
Edit
|
||||
</a>
|
||||
<form action="{{ route('categories.destroy', $category) }}" method="POST" class="inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded" onclick="return confirm('Are you sure you want to delete this category?')">
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Books in this Category</h2>
|
||||
|
||||
@if($category->books->count() > 0)
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
@foreach($category->books as $book)
|
||||
<div class="border rounded-lg p-4 hover:shadow-md transition-shadow">
|
||||
<h3 class="font-bold text-lg mb-1">{{ $book->title }}</h3>
|
||||
<p class="text-gray-600 text-sm mb-2">By {{ $book->author }}</p>
|
||||
<p class="text-gray-700 mb-3">{{ Str::limit($book->description, 100) }}</p>
|
||||
<a href="{{ route('books.show', $book) }}" class="text-indigo-600 hover:text-indigo-800">View Details →</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<p class="text-gray-700">No books found in this category.</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="{{ route('categories.index') }}" class="text-indigo-600 hover:text-indigo-800">Back to Categories</a>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div>
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">Dashboard</h1>
|
||||
<p class="text-gray-600 mt-1">Welcome back, {{ auth()->user()->name }}. Here are your reading stats.</p>
|
||||
</div>
|
||||
|
||||
@if (session('status'))
|
||||
<div class="bg-green-50 text-green-800 border border-green-200 rounded-md px-4 py-2 mb-4">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Stat cards -->
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4 mb-8">
|
||||
<div class="bg-white rounded-xl border border-gray-100 shadow p-5">
|
||||
<div class="text-sm text-gray-500">Readlist items</div>
|
||||
<div class="mt-2 text-3xl font-bold text-gray-800">{{ $readlistCount ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 shadow p-5">
|
||||
<div class="text-sm text-gray-500">Summaries in Readlist</div>
|
||||
<div class="mt-2 text-3xl font-bold text-gray-800">{{ $readlistWithSummaryCount ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 shadow p-5">
|
||||
<div class="text-sm text-gray-500">Reviews written</div>
|
||||
<div class="mt-2 text-3xl font-bold text-gray-800">{{ $reviewsCount ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 shadow p-5">
|
||||
<div class="text-sm text-gray-500">Reports submitted</div>
|
||||
<div class="mt-2 text-3xl font-bold text-gray-800">{{ $reportsCount ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 shadow p-5">
|
||||
<div class="text-sm text-gray-500">Summary requests</div>
|
||||
<div class="mt-2 text-3xl font-bold text-gray-800">{{ $requestsCount ?? 0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||
<!-- Recent Readlist -->
|
||||
<div class="bg-white rounded-xl border border-gray-100 shadow overflow-hidden">
|
||||
<div class="px-5 py-4 border-b border-gray-100 flex items-center justify-between">
|
||||
<h2 class="text-lg font-semibold">Recently added to Readlist</h2>
|
||||
<a class="text-sm text-indigo-600 hover:underline" href="{{ route('readlist.index') }}">View all</a>
|
||||
</div>
|
||||
<div class="divide-y divide-gray-100">
|
||||
@forelse(($latestReadlist ?? []) as $book)
|
||||
<a href="{{ route('books.show', $book) }}" class="flex items-center gap-4 px-5 py-3 hover:bg-gray-50">
|
||||
@if($book->cover_image)
|
||||
<img src="{{ $book->cover_image }}" alt="{{ $book->title }} cover" class="w-10 h-14 object-cover rounded">
|
||||
@else
|
||||
<div class="w-10 h-14 bg-gray-200 rounded"></div>
|
||||
@endif
|
||||
<div class="min-w-0">
|
||||
<div class="font-medium text-gray-800 truncate">{{ $book->title }}</div>
|
||||
<div class="text-xs text-gray-500 truncate">
|
||||
@if($book->authors && $book->authors->count())
|
||||
{{ $book->authors->pluck('name')->join(', ') }}
|
||||
@elseif($book->author)
|
||||
{{ $book->author }}
|
||||
@endif
|
||||
@if($book->summary)
|
||||
<span class="ml-2 inline-block px-2 py-0.5 text-[10px] bg-green-50 text-green-700 rounded">Has summary</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
@empty
|
||||
<div class="px-5 py-6 text-gray-600">No items yet. <a href="{{ route('books.index') }}" class="text-indigo-600 hover:underline">Browse books</a>.</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Your Reviews -->
|
||||
<div class="bg-white rounded-xl border border-gray-100 shadow overflow-hidden">
|
||||
<div class="px-5 py-4 border-b border-gray-100 flex items-center justify-between">
|
||||
<h2 class="text-lg font-semibold">Your latest reviews</h2>
|
||||
</div>
|
||||
<div class="divide-y divide-gray-100">
|
||||
@forelse(($latestReviews ?? []) as $review)
|
||||
<a href="{{ route('books.show', $review->book) }}" class="block px-5 py-3 hover:bg-gray-50">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="font-medium text-gray-800">{{ $review->book->title }}</div>
|
||||
<div class="flex items-center">
|
||||
@for($i=1;$i<=5;$i++)
|
||||
<svg class="w-4 h-4 {{ $i <= $review->rating ? 'text-yellow-400' : 'text-gray-300' }}" fill="currentColor" viewBox="0 0 20 20"><path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.803 2.036a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.803-2.036a1 1 0 00-1.176 0l-2.803 2.036c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81H7.03a1 1 0 00.95-.69l1.07-3.292z"/></svg>
|
||||
@endfor
|
||||
</div>
|
||||
</div>
|
||||
@if($review->comment)
|
||||
<div class="mt-1 text-sm text-gray-600 line-clamp-2">{{ $review->comment }}</div>
|
||||
@endif
|
||||
<div class="mt-1 text-xs text-gray-500">{{ $review->created_at->diffForHumans() }}</div>
|
||||
</a>
|
||||
@empty
|
||||
<div class="px-5 py-6 text-gray-600">You haven't left any reviews yet.</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Summary Requests -->
|
||||
<div class="bg-white rounded-xl border border-gray-100 shadow overflow-hidden">
|
||||
<div class="px-5 py-4 border-b border-gray-100 flex items-center justify-between">
|
||||
<h2 class="text-lg font-semibold">Your summary requests</h2>
|
||||
<a class="text-sm text-indigo-600 hover:underline" href="{{ route('requests.index') }}">All requests</a>
|
||||
</div>
|
||||
<div class="divide-y divide-gray-100">
|
||||
@forelse(($latestRequests ?? []) as $r)
|
||||
<div class="px-5 py-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<div class="font-medium text-gray-800">Gutenberg #{{ $r->gutenberg_id }}</div>
|
||||
<div class="text-sm text-gray-600">{{ $r->title ?? '—' }}</div>
|
||||
</div>
|
||||
<span class="inline-flex items-center px-2 py-1 rounded text-xs {{ $r->status === 'pending' ? 'bg-yellow-50 text-yellow-800' : ($r->status === 'completed' ? 'bg-green-50 text-green-800' : 'bg-gray-100 text-gray-700') }}">{{ ucfirst($r->status) }}</span>
|
||||
</div>
|
||||
<div class="mt-1 text-xs text-gray-500">{{ $r->created_at->diffForHumans() }}</div>
|
||||
</div>
|
||||
@empty
|
||||
<div class="px-5 py-6 text-gray-600">No requests yet. <a href="{{ route('requests.create') }}" class="text-indigo-600 hover:underline">Request a summary</a>.</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,127 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-D5Z2BTSK43"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-D5Z2BTSK43');
|
||||
</script>
|
||||
|
||||
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>{{ config('app.name', 'OpenTextSummaries') }}</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=instrument-sans:400,500,600|playfair-display:700" rel="stylesheet" />
|
||||
|
||||
<!-- Tailwind CSS (CDN) to ensure modern styling regardless of Vite build) -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
<!-- Vite (JS and any additional assets) -->
|
||||
@if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot')))
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
@endif
|
||||
</head>
|
||||
<body class="bg-gray-50 text-gray-900 min-h-screen">
|
||||
<div id="app" class="flex flex-col min-h-screen">
|
||||
<!-- Header -->
|
||||
<header class="bg-white/80 backdrop-blur border-b border-gray-100">
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="flex items-center justify-between py-4">
|
||||
<a href="{{ url('/') }}" class="flex items-center gap-2">
|
||||
<svg class="w-8 h-8 text-indigo-600" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 6.25278V19.2528M12 6.25278C10.8321 5.47686 9.24649 5 7.5 5C5.75351 5 4.16789 5.47686 3 6.25278V19.2528C4.16789 18.4769 5.75351 18 7.5 18C9.24649 18 10.8321 18.4769 12 19.2528M12 6.25278C13.1679 5.47686 14.7535 5 16.5 5C18.2465 5 19.8321 5.47686 21 6.25278V19.2528C19.8321 18.4769 18.2465 18 16.5 18C14.7535 18 13.1679 18.4769 12 19.2528" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
<span class="text-xl font-bold text-indigo-700">{{ config('app.name', 'OpenTextSummaries') }}</span>
|
||||
</a>
|
||||
<nav class="flex items-center gap-6">
|
||||
<a href="{{ route('books.index') }}" class="text-sm font-medium text-gray-700 hover:text-indigo-600">All Books</a>
|
||||
@auth
|
||||
<a href="{{ route('readlist.index') }}" class="text-sm font-medium text-gray-700 hover:text-indigo-600">Readlist</a>
|
||||
<a href="{{ route('requests.create') }}" class="text-sm font-medium text-gray-700 hover:text-indigo-600">Request Summary</a>
|
||||
@endauth
|
||||
@guest
|
||||
@if (Route::has('login'))
|
||||
<a href="{{ route('login') }}" class="text-sm font-medium text-gray-700 hover:text-indigo-600">Login</a>
|
||||
@endif
|
||||
@if (Route::has('register'))
|
||||
<a href="{{ route('register') }}" class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-sm font-semibold shadow-sm transition-colors">Register</a>
|
||||
@endif
|
||||
@else
|
||||
<div class="relative" x-data="{ open:false }">
|
||||
<button @click="open=!open" class="flex items-center gap-2 text-sm font-medium text-gray-700 hover:text-indigo-600">
|
||||
<span>{{ Auth::user()->name }}</span>
|
||||
<svg class="w-4 h-4" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z" clip-rule="evenodd" /></svg>
|
||||
</button>
|
||||
<div x-show="open" @click.outside="open=false" class="absolute right-0 mt-2 w-40 bg-white border border-gray-100 rounded-lg shadow-lg py-1 z-10">
|
||||
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="hidden">
|
||||
@csrf
|
||||
</form>
|
||||
@endguest
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Main content -->
|
||||
<main class="flex-1 py-8">
|
||||
<div class="container mx-auto px-4">
|
||||
@yield('content')
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="bg-white border-t border-gray-100 py-8">
|
||||
<div class="container mx-auto px-4 flex flex-col md:flex-row items-center justify-between gap-4">
|
||||
<div class="flex items-center gap-2 text-gray-700">
|
||||
<svg class="w-6 h-6 text-indigo-600" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 6.25278V19.2528M12 6.25278C10.8321 5.47686 9.24649 5 7.5 5C5.75351 5 4.16789 5.47686 3 6.25278V19.2528C4.16789 18.4769 5.75351 18 7.5 18C9.24649 18 10.8321 18.4769 12 19.2528M12 6.25278C13.1679 5.47686 14.7535 5 16.5 5C18.2465 5 19.8321 5.47686 21 6.25278V19.2528C19.8321 18.4769 18.2465 18 16.5 18C14.7535 18 13.1679 18.4769 12 19.2528" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
<span class="font-semibold">{{ config('app.name', 'OpenTextSummaries') }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-6 text-sm">
|
||||
<a href="{{ route('about') }}" class="text-gray-600 hover:text-indigo-600">About</a>
|
||||
<a href="{{ route('contact.show') }}" class="text-gray-600 hover:text-indigo-600">Contact</a>
|
||||
<a href="{{ route('privacy') }}" class="text-gray-600 hover:text-indigo-600">Privacy</a>
|
||||
<a href="{{ route('terms') }}" class="text-gray-600 hover:text-indigo-600">Terms</a>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500">© {{ date('Y') }} {{ config('app.name', 'OpenTextSummaries') }}. All rights reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<!-- Small Alpine-like dropdown (uses minimal inline Alpine substitute) -->
|
||||
<script>
|
||||
// Minimal dropdown handler for the user menu without adding full Alpine dependency.
|
||||
document.addEventListener('click', (e) => {
|
||||
document.querySelectorAll('[x-data] [x-show]')?.forEach(menu => {
|
||||
if (!menu.parentElement.contains(e.target)) {
|
||||
menu.style.display = 'none';
|
||||
}
|
||||
});
|
||||
});
|
||||
document.querySelectorAll('[x-data] button')?.forEach(btn => {
|
||||
btn.addEventListener('click', (e) => {
|
||||
const menu = btn.parentElement.querySelector('[x-show]');
|
||||
if (menu) {
|
||||
e.stopPropagation();
|
||||
menu.style.display = (menu.style.display === 'block') ? 'none' : 'block';
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">My Readlist</h1>
|
||||
</div>
|
||||
|
||||
@if (session('success'))
|
||||
<div class="bg-green-50 text-green-800 border border-green-200 rounded-md px-4 py-2 mb-4">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($books->count() === 0)
|
||||
<div class="bg-white rounded-lg shadow p-6 text-center text-gray-600">
|
||||
Your readlist is empty. Browse <a class="text-indigo-600 hover:underline" href="{{ route('books.index') }}">all books</a> to add some.
|
||||
</div>
|
||||
@else
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
@foreach($books as $book)
|
||||
<div class="bg-white rounded-lg shadow overflow-hidden">
|
||||
@if($book->cover_image)
|
||||
<img src="{{ $book->cover_image }}" alt="{{ $book->title }} cover" class="w-full h-48 object-cover" />
|
||||
@else
|
||||
<div class="w-full h-48 bg-gray-200 flex items-center justify-center text-gray-500">No Cover</div>
|
||||
@endif
|
||||
<div class="p-4">
|
||||
<h2 class="text-lg font-semibold"><a href="{{ route('books.show', $book) }}" class="hover:underline">{{ $book->title }}</a></h2>
|
||||
<p class="text-sm text-gray-600">
|
||||
@if($book->authors && $book->authors->count())
|
||||
{{ $book->authors->pluck('name')->join(', ') }}
|
||||
@elseif($book->author)
|
||||
{{ $book->author }}
|
||||
@endif
|
||||
</p>
|
||||
<form action="{{ route('readlist.destroy', $book) }}" method="POST" class="mt-4">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="px-3 py-2 text-sm bg-red-50 text-red-700 hover:bg-red-100 rounded-md">Remove</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
{{ $books->links() }}
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@@ -0,0 +1,51 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<h1 class="text-3xl font-bold text-indigo-700 mb-4">Request a Book Summary</h1>
|
||||
|
||||
<div class="bg-white rounded-xl shadow p-6">
|
||||
@if ($errors->any())
|
||||
<div class="mb-4 rounded-md bg-red-50 border border-red-200 text-red-800 p-3">
|
||||
<ul class="list-disc list-inside text-sm">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{ route('requests.store') }}" method="POST" class="space-y-4">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700" for="gutenberg">Project Gutenberg URL or ID</label>
|
||||
<input id="gutenberg" name="gutenberg" type="text" value="{{ old('gutenberg', $gutenberg ?? '') }}" required class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 @error('gutenberg') border-red-500 focus:border-red-500 focus:ring-red-500 @enderror" placeholder="e.g. https://www.gutenberg.org/ebooks/1342 or 1342">
|
||||
<p class="mt-1 text-xs text-gray-500">Paste the Project Gutenberg URL for the book you want summarized, or just its numeric ID.</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700" for="title">Book title (optional)</label>
|
||||
<input id="title" name="title" type="text" value="{{ old('title', $title ?? '') }}" class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700" for="notes">Notes (optional)</label>
|
||||
<textarea id="notes" name="notes" rows="4" class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500">{{ old('notes') }}</textarea>
|
||||
<p class="mt-1 text-xs text-gray-500">Add any context or what you are most interested in (themes, characters, key insights, etc.).</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit" class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-md">Submit request</button>
|
||||
<a href="{{ route('requests.index') }}" class="ml-3 text-indigo-600 hover:underline">My requests</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="mt-6 p-4 bg-indigo-50 border border-indigo-100 rounded-lg">
|
||||
<p class="text-sm text-indigo-900">
|
||||
Books featured on this site are sourced from <a href="https://www.gutenberg.org/" class="text-indigo-700 underline" target="_blank" rel="noopener">Project Gutenberg</a> and are part of the public domain. Summaries are generated using AI and may contain inaccuracies.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,58 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<h1 class="text-3xl font-bold text-indigo-700">My Summary Requests</h1>
|
||||
<a href="{{ route('requests.create') }}" class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-md">New request</a>
|
||||
</div>
|
||||
|
||||
@if (session('success'))
|
||||
<div class="mb-4 rounded-md bg-green-50 border border-green-200 text-green-800 p-3">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($requests->count() === 0)
|
||||
<div class="bg-white rounded-lg shadow p-6 text-center text-gray-600">
|
||||
You haven't requested any summaries yet.
|
||||
</div>
|
||||
@else
|
||||
<div class="bg-white rounded-lg shadow overflow-hidden">
|
||||
<table class="min-w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr class="text-left text-sm text-gray-600">
|
||||
<th class="px-4 py-3">Gutenberg ID</th>
|
||||
<th class="px-4 py-3">Title</th>
|
||||
<th class="px-4 py-3">Status</th>
|
||||
<th class="px-4 py-3">Requested</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100">
|
||||
@foreach($requests as $r)
|
||||
<tr class="text-sm">
|
||||
<td class="px-4 py-3">
|
||||
<a href="https://www.gutenberg.org/ebooks/{{ $r->gutenberg_id }}" target="_blank" rel="noopener" class="text-indigo-600 hover:underline">{{ $r->gutenberg_id }}</a>
|
||||
</td>
|
||||
<td class="px-4 py-3">{{ $r->title ?? '—' }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="inline-flex items-center px-2 py-1 rounded text-xs {{ $r->status === 'pending' ? 'bg-yellow-50 text-yellow-800' : ($r->status === 'completed' ? 'bg-green-50 text-green-800' : 'bg-gray-100 text-gray-700') }}">{{ ucfirst($r->status) }}</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-gray-500">{{ $r->created_at->diffForHumans() }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
{{ $requests->links() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="mt-6 p-4 bg-indigo-50 border border-indigo-100 rounded-lg">
|
||||
<p class="text-sm text-indigo-900">
|
||||
Books featured on this site are sourced from <a href="https://www.gutenberg.org/" class="text-indigo-700 underline" target="_blank" rel="noopener">Project Gutenberg</a> and are part of the public domain. Summaries are generated using AI and may contain inaccuracies.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,17 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<h1 class="text-3xl font-bold text-indigo-700 mb-4">About</h1>
|
||||
<div class="prose max-w-none bg-white rounded-xl shadow p-6">
|
||||
<p>Welcome to {{ config('app.name', 'OpenTextSummaries') }} — a place to quickly learn from books through concise summaries.</p>
|
||||
<p class="mt-4 text-gray-700">Our mission is to make knowledge accessible by providing brief, readable takeaways from great works.</p>
|
||||
|
||||
<div class="mt-6 p-4 bg-indigo-50 border border-indigo-100 rounded-lg">
|
||||
<p class="text-sm text-indigo-900">
|
||||
Books featured on this site are sourced from <a href="https://www.gutenberg.org/" class="text-indigo-700 underline" target="_blank" rel="noopener">Project Gutenberg</a> and are part of the public domain. Summaries are generated using AI and may contain inaccuracies.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,52 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-xl mx-auto">
|
||||
<h1 class="text-3xl font-bold text-indigo-700 mb-4">Contact</h1>
|
||||
<div class="bg-white rounded-xl shadow p-6">
|
||||
@if (session('success'))
|
||||
<div class="mb-4 rounded-md bg-green-50 border border-green-200 text-green-800 p-3">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{ route('contact.send') }}" method="POST" class="space-y-4">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700" for="name">Your name</label>
|
||||
<input id="name" name="name" type="text" value="{{ old('name') }}" required class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 @error('name') border-red-500 focus:border-red-500 focus:ring-red-500 @enderror">
|
||||
@error('name')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700" for="email">Your email</label>
|
||||
<input id="email" name="email" type="email" value="{{ old('email') }}" required class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 @error('email') border-red-500 focus:border-red-500 focus:ring-red-500 @enderror">
|
||||
@error('email')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700" for="message">Message</label>
|
||||
<textarea id="message" name="message" rows="6" required class="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 @error('message') border-red-500 focus:border-red-500 focus:ring-red-500 @enderror">{{ old('message') }}</textarea>
|
||||
@error('message')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit" class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-md">Send</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="mt-6 p-4 bg-indigo-50 border border-indigo-100 rounded-lg">
|
||||
<p class="text-sm text-indigo-900">
|
||||
Books featured on this site are sourced from <a href="https://www.gutenberg.org/" class="text-indigo-700 underline" target="_blank" rel="noopener">Project Gutenberg</a> and are part of the public domain. Summaries are generated using AI and may contain inaccuracies.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,17 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<h1 class="text-3xl font-bold text-indigo-700 mb-4">Privacy Policy</h1>
|
||||
<div class="prose max-w-none bg-white rounded-xl shadow p-6">
|
||||
<p>Your privacy matters to us. We collect only the information necessary to provide and improve our services, such as account details you voluntarily provide.</p>
|
||||
<p class="mt-2">We do not sell your personal information. For questions, please contact us via the contact page.</p>
|
||||
|
||||
<div class="mt-6 p-4 bg-indigo-50 border border-indigo-100 rounded-lg">
|
||||
<p class="text-sm text-indigo-900">
|
||||
Books featured on this site are sourced from <a href="https://www.gutenberg.org/" class="text-indigo-700 underline" target="_blank" rel="noopener">Project Gutenberg</a> and are part of the public domain. Summaries are generated using AI and may contain inaccuracies.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,17 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<h1 class="text-3xl font-bold text-indigo-700 mb-4">Terms of Service</h1>
|
||||
<div class="prose max-w-none bg-white rounded-xl shadow p-6">
|
||||
<p>By using {{ config('app.name', 'OpenTextSummaries') }}, you agree to use the service responsibly and abide by applicable laws. We provide content "as is" without warranties of any kind.</p>
|
||||
<p class="mt-2">We may update these terms from time to time. Continued use of the site constitutes acceptance of the revised terms.</p>
|
||||
|
||||
<div class="mt-6 p-4 bg-indigo-50 border border-indigo-100 rounded-lg">
|
||||
<p class="text-sm text-indigo-900">
|
||||
Books featured on this site are sourced from <a href="https://www.gutenberg.org/" class="text-indigo-700 underline" target="_blank" rel="noopener">Project Gutenberg</a> and are part of the public domain. Summaries are generated using AI and may contain inaccuracies.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -4,12 +4,26 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-D5Z2BTSK43"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-D5Z2BTSK43');
|
||||
</script>
|
||||
|
||||
<title>{{ config('app.name', 'Open Text Summaries') }}</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=instrument-sans:400,500,600|playfair-display:700" rel="stylesheet" />
|
||||
|
||||
<!-- Tailwind CSS (CDN) to ensure styling even without a build) -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
<!-- Styles / Scripts -->
|
||||
@if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot')))
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
@@ -74,53 +88,47 @@
|
||||
</section>
|
||||
|
||||
<section id="featured" class="max-w-6xl mx-auto mb-20">
|
||||
<h3 class="text-3xl font-bold text-center text-indigo-700 dark:text-indigo-400 mb-10">Featured Summaries</h3>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
<!-- Book 1 -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-md overflow-hidden transition-transform duration-300 hover:shadow-lg hover:-translate-y-1">
|
||||
<div class="h-48 bg-indigo-100 dark:bg-indigo-900 flex items-center justify-center">
|
||||
<svg class="w-24 h-24 text-indigo-500 dark:text-indigo-400" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 6.25278V19.2528M12 6.25278C10.8321 5.47686 9.24649 5 7.5 5C5.75351 5 4.16789 5.47686 3 6.25278V19.2528C4.16789 18.4769 5.75351 18 7.5 18C9.24649 18 10.8321 18.4769 12 19.2528M12 6.25278C13.1679 5.47686 14.7535 5 16.5 5C18.2465 5 19.8321 5.47686 21 6.25278V19.2528C19.8321 18.4769 18.2465 18 16.5 18C14.7535 18 13.1679 18.4769 12 19.2528" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<h4 class="text-xl font-bold text-gray-800 dark:text-white mb-2">Atomic Habits</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-300 mb-3">James Clear</p>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-4">Learn how tiny changes can lead to remarkable results through the power of atomic habits.</p>
|
||||
<a href="#" class="text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-300 font-medium">Read Summary →</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Book 2 -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-md overflow-hidden transition-transform duration-300 hover:shadow-lg hover:-translate-y-1">
|
||||
<div class="h-48 bg-indigo-100 dark:bg-indigo-900 flex items-center justify-center">
|
||||
<svg class="w-24 h-24 text-indigo-500 dark:text-indigo-400" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 6.25278V19.2528M12 6.25278C10.8321 5.47686 9.24649 5 7.5 5C5.75351 5 4.16789 5.47686 3 6.25278V19.2528C4.16789 18.4769 5.75351 18 7.5 18C9.24649 18 10.8321 18.4769 12 19.2528M12 6.25278C13.1679 5.47686 14.7535 5 16.5 5C18.2465 5 19.8321 5.47686 21 6.25278V19.2528C19.8321 18.4769 18.2465 18 16.5 18C14.7535 18 13.1679 18.4769 12 19.2528" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<h4 class="text-xl font-bold text-gray-800 dark:text-white mb-2">Thinking, Fast and Slow</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-300 mb-3">Daniel Kahneman</p>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-4">Explore the two systems that drive the way we think and make decisions.</p>
|
||||
<a href="#" class="text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-300 font-medium">Read Summary →</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Book 3 -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-md overflow-hidden transition-transform duration-300 hover:shadow-lg hover:-translate-y-1">
|
||||
<div class="h-48 bg-indigo-100 dark:bg-indigo-900 flex items-center justify-center">
|
||||
<svg class="w-24 h-24 text-indigo-500 dark:text-indigo-400" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 6.25278V19.2528M12 6.25278C10.8321 5.47686 9.24649 5 7.5 5C5.75351 5 4.16789 5.47686 3 6.25278V19.2528C4.16789 18.4769 5.75351 18 7.5 18C9.24649 18 10.8321 18.4769 12 19.2528M12 6.25278C13.1679 5.47686 14.7535 5 16.5 5C18.2465 5 19.8321 5.47686 21 6.25278V19.2528C19.8321 18.4769 18.2465 18 16.5 18C14.7535 18 13.1679 18.4769 12 19.2528" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<h4 class="text-xl font-bold text-gray-800 dark:text-white mb-2">Sapiens</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-300 mb-3">Yuval Noah Harari</p>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-4">A brief history of humankind, from the emergence of Homo sapiens to the present day.</p>
|
||||
<a href="#" class="text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-300 font-medium">Read Summary →</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<h3 class="text-3xl font-bold text-indigo-700 dark:text-indigo-400">Latest Books</h3>
|
||||
<a href="{{ route('books.index') }}" class="text-indigo-600 dark:text-indigo-400 hover:underline">View all →</a>
|
||||
</div>
|
||||
@if(isset($latestBooks) && $latestBooks->count())
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
@foreach($latestBooks as $book)
|
||||
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-md overflow-hidden transition-transform duration-300 hover:shadow-lg hover:-translate-y-1">
|
||||
@if($book->cover_image)
|
||||
<img src="{{ $book->cover_image }}" alt="{{ $book->title }} cover" class="w-full h-48 object-cover" />
|
||||
@else
|
||||
<div class="h-48 bg-indigo-100 dark:bg-indigo-900 flex items-center justify-center">
|
||||
<svg class="w-24 h-24 text-indigo-500 dark:text-indigo-400" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 6.25278V19.2528M12 6.25278C10.8321 5.47686 9.24649 5 7.5 5C5.75351 5 4.16789 5.47686 3 6.25278V19.2528C4.16789 18.4769 5.75351 18 7.5 18C9.24649 18 10.8321 18.4769 12 19.2528M12 6.25278C13.1679 5.47686 14.7535 5 16.5 5C18.2465 5 19.8321 5.47686 21 6.25278V19.2528C19.8321 18.4769 18.2465 18 16.5 18C14.7535 18 13.1679 18.4769 12 19.2528" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
@endif
|
||||
<div class="p-6">
|
||||
<h4 class="text-xl font-bold text-gray-800 dark:text-white mb-2">
|
||||
<a href="{{ route('books.show', $book) }}" class="hover:underline">{{ $book->title }}</a>
|
||||
</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-300 mb-3">
|
||||
@if($book->authors && $book->authors->count())
|
||||
{{ $book->authors->pluck('name')->join(', ') }}
|
||||
@elseif($book->author)
|
||||
{{ $book->author }}
|
||||
@endif
|
||||
</p>
|
||||
@if($book->summary)
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-4">{{ Str::limit(strip_tags($book->summary->content), 120) }}</p>
|
||||
@else
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-4">No summary available yet.</p>
|
||||
@endif
|
||||
<a href="{{ route('books.show', $book) }}" class="text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-300 font-medium">Read Summary →</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<p class="text-center text-gray-600 dark:text-gray-300">No books available yet. Ingest some via the API!</p>
|
||||
@endif
|
||||
</section>
|
||||
|
||||
<section id="how-it-works" class="max-w-4xl mx-auto mb-20">
|
||||
@@ -171,10 +179,10 @@
|
||||
<span class="ml-2 text-lg font-bold text-gray-800 dark:text-white">OpenTextSummaries</span>
|
||||
</div>
|
||||
<div class="flex gap-6">
|
||||
<a href="#" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400">About</a>
|
||||
<a href="#" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400">Contact</a>
|
||||
<a href="#" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400">Privacy</a>
|
||||
<a href="#" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400">Terms</a>
|
||||
<a href="{{ route('about') }}" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400">About</a>
|
||||
<a href="{{ route('contact.show') }}" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400">Contact</a>
|
||||
<a href="{{ route('privacy') }}" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400">Privacy</a>
|
||||
<a href="{{ route('terms') }}" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400">Terms</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-8 pt-8 border-t border-gray-200 dark:border-gray-800 text-center text-gray-500 dark:text-gray-400">
|
||||
|
||||
Reference in New Issue
Block a user