lots of improvements
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Create Category - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item active">Create Category</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h1 class="h3 mb-0">Create New Category</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('forum.categories.store') }}" method="POST">
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Category Name</label>
|
||||
<input type="text" class="form-control bg-dark text-white @error('name') is-invalid @enderror" id="name" name="name" value="{{ old('name') }}" required>
|
||||
@error('name')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="description" class="form-label">Description</label>
|
||||
<textarea class="form-control bg-dark text-white @error('description') is-invalid @enderror" id="description" name="description" rows="3">{{ old('description') }}</textarea>
|
||||
@error('description')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="order" class="form-label">Display Order</label>
|
||||
<input type="number" class="form-control bg-dark text-white @error('order') is-invalid @enderror" id="order" name="order" value="{{ old('order', 0) }}">
|
||||
<div class="form-text text-muted">Categories with lower numbers will be displayed first.</div>
|
||||
@error('order')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-gradient">Create Category</button>
|
||||
<a href="{{ route('forum.index') }}" class="btn btn-outline-light">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,53 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit Category - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.categories.show', $category) }}" class="text-decoration-none">{{ $category->name }}</a></li>
|
||||
<li class="breadcrumb-item active">Edit</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h1 class="h3 mb-0">Edit Category</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('forum.categories.update', $category) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Category Name</label>
|
||||
<input type="text" class="form-control bg-dark text-white @error('name') is-invalid @enderror" id="name" name="name" value="{{ old('name', $category->name) }}" required>
|
||||
@error('name')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="description" class="form-label">Description</label>
|
||||
<textarea class="form-control bg-dark text-white @error('description') is-invalid @enderror" id="description" name="description" rows="3">{{ old('description', $category->description) }}</textarea>
|
||||
@error('description')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="order" class="form-label">Display Order</label>
|
||||
<input type="number" class="form-control bg-dark text-white @error('order') is-invalid @enderror" id="order" name="order" value="{{ old('order', $category->order) }}">
|
||||
<div class="form-text text-muted">Categories with lower numbers will be displayed first.</div>
|
||||
@error('order')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-gradient">Update Category</button>
|
||||
<a href="{{ route('forum.categories.show', $category) }}" class="btn btn-outline-light">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,150 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', $category->name . ' - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item active">{{ $category->name }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h1 class="h2 fw-bold gradient-text">{{ $category->name }}</h1>
|
||||
<p class="text-muted">{{ $category->description }}</p>
|
||||
</div>
|
||||
<div>
|
||||
@auth
|
||||
<a href="{{ route('forum.threads.create', ['category_id' => $category->id]) }}" class="btn btn-gradient">
|
||||
<i class="fas fa-plus me-1"></i> New Thread
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ route('login') }}" class="btn btn-gradient">
|
||||
<i class="fas fa-sign-in-alt me-1"></i> Login to Post
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($threads->isEmpty())
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-body text-center py-5">
|
||||
<i class="fas fa-comments fa-3x text-muted mb-3"></i>
|
||||
<h3 class="text-muted">No threads yet</h3>
|
||||
<p class="text-muted">Be the first to start a discussion in this category!</p>
|
||||
@auth
|
||||
<a href="{{ route('forum.threads.create', ['category_id' => $category->id]) }}" class="btn btn-gradient mt-3">
|
||||
<i class="fas fa-plus me-1"></i> Create Thread
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ route('login') }}" class="btn btn-gradient mt-3">
|
||||
<i class="fas fa-sign-in-alt me-1"></i> Login to Create Thread
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">Threads</h5>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-sm btn-outline-light dropdown-toggle" type="button" data-bs-toggle="dropdown">
|
||||
<i class="fas fa-sort me-1"></i> Sort
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a class="dropdown-item" href="{{ route('forum.categories.show', ['category' => $category, 'sort' => 'latest']) }}">Latest Activity</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('forum.categories.show', ['category' => $category, 'sort' => 'newest']) }}">Newest</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('forum.categories.show', ['category' => $category, 'sort' => 'views']) }}">Most Viewed</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group list-group-flush">
|
||||
@foreach($threads as $thread)
|
||||
<div class="list-group-item bg-dark text-white border-secondary {{ $thread->is_sticky ? 'bg-dark bg-opacity-75' : '' }}">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-7">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="me-3">
|
||||
@if($thread->is_sticky)
|
||||
<i class="fas fa-thumbtack fa-lg text-warning"></i>
|
||||
@elseif($thread->is_locked)
|
||||
<i class="fas fa-lock fa-lg text-danger"></i>
|
||||
@else
|
||||
<i class="fas fa-comments fa-lg text-primary"></i>
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-1">
|
||||
<a href="{{ route('forum.threads.show', $thread) }}" class="text-white text-decoration-none">
|
||||
{{ $thread->title }}
|
||||
</a>
|
||||
@if($thread->is_sticky)
|
||||
<span class="badge bg-warning text-dark ms-2">Sticky</span>
|
||||
@endif
|
||||
@if($thread->is_locked)
|
||||
<span class="badge bg-danger ms-2">Locked</span>
|
||||
@endif
|
||||
</h5>
|
||||
<div class="text-muted small">
|
||||
Started by <a href="{{ route('profile.show', $thread->user) }}" class="text-decoration-none">{{ $thread->user->name }}</a>
|
||||
<span class="mx-1">•</span>
|
||||
<span>{{ $thread->created_at->diffForHumans() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<div class="text-muted">
|
||||
<span class="d-block">{{ $thread->topics->count() }}</span>
|
||||
<small>Topics</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 text-center">
|
||||
<div class="text-muted">
|
||||
<span class="d-block">{{ $thread->views }}</span>
|
||||
<small>Views</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
@if($thread->last_activity_at)
|
||||
<div class="small text-end">
|
||||
<div class="text-muted">
|
||||
<small>
|
||||
<i class="far fa-clock me-1"></i> {{ $thread->last_activity_at->diffForHumans() }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-center">
|
||||
{{ $threads->links() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@auth
|
||||
@if(auth()->user()->hasRole('admin'))
|
||||
<div class="mt-4 d-flex gap-2">
|
||||
<a href="{{ route('forum.categories.edit', $category) }}" class="btn btn-outline-primary">
|
||||
<i class="fas fa-edit me-1"></i> Edit Category
|
||||
</a>
|
||||
<form action="{{ route('forum.categories.destroy', $category) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-outline-danger" onclick="return confirm('Are you sure you want to delete this category? All threads and posts will be deleted.')">
|
||||
<i class="fas fa-trash me-1"></i> Delete Category
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,104 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="h2 fw-bold gradient-text">Forum</h1>
|
||||
@auth
|
||||
@if(auth()->user()->hasRole('admin'))
|
||||
<a href="{{ route('forum.categories.create') }}" class="btn btn-gradient">
|
||||
<i class="fas fa-plus me-1"></i> New Category
|
||||
</a>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
@if($categories->isEmpty())
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-body text-center py-5">
|
||||
<i class="fas fa-comments fa-3x text-muted mb-3"></i>
|
||||
<h3 class="text-muted">No categories yet</h3>
|
||||
<p class="text-muted">Check back later for forum discussions.</p>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Categories</h5>
|
||||
</div>
|
||||
<div class="list-group list-group-flush">
|
||||
@foreach($categories as $category)
|
||||
<div class="list-group-item bg-dark text-white border-secondary">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-7">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="me-3">
|
||||
<i class="fas fa-folder fa-2x text-primary"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-1">
|
||||
<a href="{{ route('forum.categories.show', $category) }}" class="text-white text-decoration-none">
|
||||
{{ $category->name }}
|
||||
</a>
|
||||
</h5>
|
||||
<p class="text-muted mb-0">{{ $category->description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<div class="text-muted">
|
||||
<span class="d-block">{{ $category->threads->count() }}</span>
|
||||
<small>Threads</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@if($category->threads->count() > 0)
|
||||
@php
|
||||
$latestThread = $category->threads()->orderBy('last_activity_at', 'desc')->first();
|
||||
@endphp
|
||||
<div class="small">
|
||||
<a href="{{ route('forum.threads.show', $latestThread) }}" class="text-white">
|
||||
{{ Str::limit($latestThread->title, 30) }}
|
||||
</a>
|
||||
<div class="text-muted">
|
||||
<small>
|
||||
<i class="far fa-clock me-1"></i> {{ $latestThread->last_activity_at->diffForHumans() }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-muted small">No threads yet</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Forum Statistics</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row text-center">
|
||||
<div class="col-md-4">
|
||||
<h3 class="gradient-text">{{ \App\Models\ForumThread::count() }}</h3>
|
||||
<p class="text-muted">Threads</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3 class="gradient-text">{{ \App\Models\ForumTopic::count() }}</h3>
|
||||
<p class="text-muted">Topics</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3 class="gradient-text">{{ \App\Models\ForumPost::count() }}</h3>
|
||||
<p class="text-muted">Posts</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,71 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Reply to Topic - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.categories.show', $thread->category) }}" class="text-decoration-none">{{ $thread->category->name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.threads.show', $thread) }}" class="text-decoration-none">{{ $thread->title }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.topics.show', $topic) }}" class="text-decoration-none">{{ $topic->title }}</a></li>
|
||||
<li class="breadcrumb-item active">Reply</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h1 class="h3 mb-0">Reply to Topic</h1>
|
||||
<p class="text-muted mb-0">{{ $topic->title }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- Original Topic Content (for reference) -->
|
||||
<div class="card bg-dark border-secondary mb-4">
|
||||
<div class="card-header">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="me-3">
|
||||
<i class="fas fa-user-circle fa-2x"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-0">
|
||||
<a href="{{ route('profile.show', $topic->user) }}" class="text-white text-decoration-none">
|
||||
{{ $topic->user->name }}
|
||||
</a>
|
||||
</h5>
|
||||
<div class="text-muted small">
|
||||
<span>{{ $topic->created_at->format('M j, Y g:i A') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="topic-content">
|
||||
{!! nl2br(e(Str::limit($topic->content, 300))) !!}
|
||||
@if(strlen($topic->content) > 300)
|
||||
<a href="{{ route('forum.topics.show', $topic) }}" class="text-primary">Read full topic</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Reply Form -->
|
||||
<form action="{{ route('forum.posts.store') }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="topic_id" value="{{ $topic->id }}">
|
||||
<div class="mb-3">
|
||||
<label for="content" class="form-label">Your Reply</label>
|
||||
<textarea class="form-control bg-dark text-white @error('content') is-invalid @enderror" id="content" name="content" rows="10" required>{{ old('content') }}</textarea>
|
||||
@error('content')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-gradient">Post Reply</button>
|
||||
<a href="{{ route('forum.topics.show', $topic) }}" class="btn btn-outline-light">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,54 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit Reply - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.categories.show', $post->topic->thread->category) }}" class="text-decoration-none">{{ $post->topic->thread->category->name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.threads.show', $post->topic->thread) }}" class="text-decoration-none">{{ $post->topic->thread->title }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.topics.show', $post->topic) }}" class="text-decoration-none">{{ $post->topic->title }}</a></li>
|
||||
<li class="breadcrumb-item active">Edit Reply</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h1 class="h3 mb-0">Edit Reply</h1>
|
||||
<p class="text-muted mb-0">in topic: {{ $post->topic->title }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('forum.posts.update', $post) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="mb-3">
|
||||
<label for="content" class="form-label">Content</label>
|
||||
<textarea class="form-control bg-dark text-white @error('content') is-invalid @enderror" id="content" name="content" rows="10" required>{{ old('content', $post->content) }}</textarea>
|
||||
@error('content')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
@if(auth()->user()->hasRole('admin'))
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="is_solution" name="is_solution" value="1" {{ old('is_solution', $post->is_solution) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_solution">
|
||||
Mark as Solution
|
||||
</label>
|
||||
<div class="form-text text-muted">Mark this post as the solution to the topic.</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-gradient">Update Reply</button>
|
||||
<a href="{{ route('forum.topics.show', $post->topic) }}#post-{{ $post->id }}" class="btn btn-outline-light">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,70 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Create Thread - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
@if(isset($category_id))
|
||||
@php
|
||||
$category = \App\Models\ForumCategory::find($category_id);
|
||||
@endphp
|
||||
@if($category)
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.categories.show', $category) }}" class="text-decoration-none">{{ $category->name }}</a></li>
|
||||
@endif
|
||||
@endif
|
||||
<li class="breadcrumb-item active">Create Thread</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h1 class="h3 mb-0">Create New Thread</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('forum.threads.store') }}" method="POST">
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label for="category_id" class="form-label">Category</label>
|
||||
<select class="form-select bg-dark text-white @error('category_id') is-invalid @enderror" id="category_id" name="category_id" required>
|
||||
<option value="">Select a category</option>
|
||||
@foreach($categories as $category)
|
||||
<option value="{{ $category->id }}" {{ old('category_id', $category_id) == $category->id ? 'selected' : '' }}>
|
||||
{{ $category->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('category_id')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="title" class="form-label">Thread Title</label>
|
||||
<input type="text" class="form-control bg-dark text-white @error('title') is-invalid @enderror" id="title" name="title" value="{{ old('title') }}" required>
|
||||
@error('title')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="content" class="form-label">Initial Post Content</label>
|
||||
<textarea class="form-control bg-dark text-white @error('content') is-invalid @enderror" id="content" name="content" rows="10" required>{{ old('content') }}</textarea>
|
||||
<div class="form-text text-muted">This will be the first topic in your thread.</div>
|
||||
@error('content')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-gradient">Create Thread</button>
|
||||
@if(isset($category_id) && $category)
|
||||
<a href="{{ route('forum.categories.show', $category) }}" class="btn btn-outline-light">Cancel</a>
|
||||
@else
|
||||
<a href="{{ route('forum.index') }}" class="btn btn-outline-light">Cancel</a>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,86 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit Thread - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.categories.show', $thread->category) }}" class="text-decoration-none">{{ $thread->category->name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.threads.show', $thread) }}" class="text-decoration-none">{{ $thread->title }}</a></li>
|
||||
<li class="breadcrumb-item active">Edit</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h1 class="h3 mb-0">Edit Thread</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('forum.threads.update', $thread) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="mb-3">
|
||||
<label for="category_id" class="form-label">Category</label>
|
||||
<select class="form-select bg-dark text-white @error('category_id') is-invalid @enderror" id="category_id" name="category_id" required>
|
||||
@foreach($categories as $category)
|
||||
<option value="{{ $category->id }}" {{ old('category_id', $thread->category_id) == $category->id ? 'selected' : '' }}>
|
||||
{{ $category->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('category_id')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="title" class="form-label">Thread Title</label>
|
||||
<input type="text" class="form-control bg-dark text-white @error('title') is-invalid @enderror" id="title" name="title" value="{{ old('title', $thread->title) }}" required>
|
||||
@error('title')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
@if(isset($initialTopic))
|
||||
<div class="mb-3">
|
||||
<label for="content" class="form-label">Initial Post Content</label>
|
||||
<textarea class="form-control bg-dark text-white @error('content') is-invalid @enderror" id="content" name="content" rows="10" required>{{ old('content', $initialTopic->content) }}</textarea>
|
||||
@error('content')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(auth()->user()->hasRole('admin'))
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="is_sticky" name="is_sticky" value="1" {{ old('is_sticky', $thread->is_sticky) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_sticky">
|
||||
Sticky Thread
|
||||
</label>
|
||||
<div class="form-text text-muted">Sticky threads appear at the top of the category.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="is_locked" name="is_locked" value="1" {{ old('is_locked', $thread->is_locked) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_locked">
|
||||
Lock Thread
|
||||
</label>
|
||||
<div class="form-text text-muted">Locked threads cannot receive new topics or posts.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-gradient">Update Thread</button>
|
||||
<a href="{{ route('forum.threads.show', $thread) }}" class="btn btn-outline-light">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,195 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', $thread->title . ' - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.categories.show', $thread->category) }}" class="text-decoration-none">{{ $thread->category->name }}</a></li>
|
||||
<li class="breadcrumb-item active">{{ $thread->title }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h1 class="h2 fw-bold gradient-text">{{ $thread->title }}</h1>
|
||||
<div class="text-muted">
|
||||
<span>Started by <a href="{{ route('profile.show', $thread->user) }}" class="text-decoration-none">{{ $thread->user->name }}</a></span>
|
||||
<span class="mx-1">•</span>
|
||||
<span>{{ $thread->created_at->format('M j, Y g:i A') }}</span>
|
||||
<span class="mx-1">•</span>
|
||||
<span>{{ $thread->views }} views</span>
|
||||
@if($thread->is_sticky)
|
||||
<span class="badge bg-warning text-dark ms-2">Sticky</span>
|
||||
@endif
|
||||
@if($thread->is_locked)
|
||||
<span class="badge bg-danger ms-2">Locked</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@auth
|
||||
@if(!$thread->is_locked)
|
||||
<a href="{{ route('forum.topics.create', ['thread_id' => $thread->id]) }}" class="btn btn-gradient">
|
||||
<i class="fas fa-plus me-1"></i> New Topic
|
||||
</a>
|
||||
@endif
|
||||
@if(auth()->id() === $thread->user_id || auth()->user()->hasRole('admin'))
|
||||
<div class="dropdown d-inline-block ms-2">
|
||||
<button class="btn btn-outline-light dropdown-toggle" type="button" data-bs-toggle="dropdown">
|
||||
<i class="fas fa-cog"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<a href="{{ route('forum.threads.edit', $thread) }}" class="dropdown-item">
|
||||
<i class="fas fa-edit me-1"></i> Edit Thread
|
||||
</a>
|
||||
</li>
|
||||
@if(auth()->user()->hasRole('admin'))
|
||||
<li>
|
||||
<form action="{{ route('forum.threads.update', $thread) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<input type="hidden" name="is_sticky" value="{{ $thread->is_sticky ? 0 : 1 }}">
|
||||
<input type="hidden" name="title" value="{{ $thread->title }}">
|
||||
<input type="hidden" name="category_id" value="{{ $thread->category_id }}">
|
||||
<button type="submit" class="dropdown-item">
|
||||
<i class="fas fa-thumbtack me-1"></i> {{ $thread->is_sticky ? 'Unsticky' : 'Sticky' }}
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form action="{{ route('forum.threads.update', $thread) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<input type="hidden" name="is_locked" value="{{ $thread->is_locked ? 0 : 1 }}">
|
||||
<input type="hidden" name="title" value="{{ $thread->title }}">
|
||||
<input type="hidden" name="category_id" value="{{ $thread->category_id }}">
|
||||
<button type="submit" class="dropdown-item">
|
||||
<i class="fas fa-lock me-1"></i> {{ $thread->is_locked ? 'Unlock' : 'Lock' }}
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
@endif
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<form action="{{ route('forum.threads.destroy', $thread) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="dropdown-item text-danger" onclick="return confirm('Are you sure you want to delete this thread? All topics and posts will be deleted.')">
|
||||
<i class="fas fa-trash me-1"></i> Delete Thread
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<a href="{{ route('login') }}" class="btn btn-gradient">
|
||||
<i class="fas fa-sign-in-alt me-1"></i> Login to Post
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($topics->isEmpty())
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-body text-center py-5">
|
||||
<i class="fas fa-comments fa-3x text-muted mb-3"></i>
|
||||
<h3 class="text-muted">No topics yet</h3>
|
||||
<p class="text-muted">Be the first to start a topic in this thread!</p>
|
||||
@auth
|
||||
@if(!$thread->is_locked)
|
||||
<a href="{{ route('forum.topics.create', ['thread_id' => $thread->id]) }}" class="btn btn-gradient mt-3">
|
||||
<i class="fas fa-plus me-1"></i> Create Topic
|
||||
</a>
|
||||
@else
|
||||
<div class="alert alert-danger mt-3">
|
||||
<i class="fas fa-lock me-1"></i> This thread is locked. You cannot create new topics.
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<a href="{{ route('login') }}" class="btn btn-gradient mt-3">
|
||||
<i class="fas fa-sign-in-alt me-1"></i> Login to Create Topic
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="topics-list">
|
||||
@foreach($topics as $topic)
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="me-3">
|
||||
<i class="fas fa-user-circle fa-2x"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-0">
|
||||
<a href="{{ route('forum.topics.show', $topic) }}" class="text-white text-decoration-none">
|
||||
{{ $topic->title }}
|
||||
</a>
|
||||
@if($topic->is_pinned)
|
||||
<span class="badge bg-warning text-dark ms-2">Pinned</span>
|
||||
@endif
|
||||
</h5>
|
||||
<div class="text-muted small">
|
||||
Posted by <a href="{{ route('profile.show', $topic->user) }}" class="text-decoration-none">{{ $topic->user->name }}</a>
|
||||
<span class="mx-1">•</span>
|
||||
<span>{{ $topic->created_at->diffForHumans() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-muted small">
|
||||
<span>{{ $topic->posts->count() }} {{ Str::plural('reply', $topic->posts->count()) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="topic-content">
|
||||
{!! nl2br(e(Str::limit($topic->content, 300))) !!}
|
||||
@if(strlen($topic->content) > 300)
|
||||
<a href="{{ route('forum.topics.show', $topic) }}" class="text-primary">Read more</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-dark border-top border-secondary">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<a href="{{ route('forum.topics.show', $topic) }}" class="btn btn-link text-white p-0">
|
||||
View full topic
|
||||
</a>
|
||||
@auth
|
||||
@if(auth()->id() === $topic->user_id || auth()->user()->hasRole('admin'))
|
||||
<div class="d-flex gap-2">
|
||||
<a href="{{ route('forum.topics.edit', $topic) }}" class="btn btn-outline-primary btn-sm">
|
||||
<i class="fas fa-edit"></i> Edit
|
||||
</a>
|
||||
<form action="{{ route('forum.topics.destroy', $topic) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm" onclick="return confirm('Are you sure you want to delete this topic?')">
|
||||
<i class="fas fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-center">
|
||||
{{ $topics->links() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($thread->is_locked)
|
||||
<div class="alert alert-danger mt-4">
|
||||
<i class="fas fa-lock me-1"></i> This thread is locked. You cannot create new topics.
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Create Topic - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.categories.show', $thread->category) }}" class="text-decoration-none">{{ $thread->category->name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.threads.show', $thread) }}" class="text-decoration-none">{{ $thread->title }}</a></li>
|
||||
<li class="breadcrumb-item active">Create Topic</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h1 class="h3 mb-0">Create New Topic</h1>
|
||||
<p class="text-muted mb-0">in thread: {{ $thread->title }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('forum.topics.store') }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="thread_id" value="{{ $thread->id }}">
|
||||
<div class="mb-3">
|
||||
<label for="title" class="form-label">Topic Title</label>
|
||||
<input type="text" class="form-control bg-dark text-white @error('title') is-invalid @enderror" id="title" name="title" value="{{ old('title') }}" required>
|
||||
@error('title')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="content" class="form-label">Content</label>
|
||||
<textarea class="form-control bg-dark text-white @error('content') is-invalid @enderror" id="content" name="content" rows="10" required>{{ old('content') }}</textarea>
|
||||
@error('content')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-gradient">Create Topic</button>
|
||||
<a href="{{ route('forum.threads.show', $thread) }}" class="btn btn-outline-light">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,61 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit Topic - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.categories.show', $thread->category) }}" class="text-decoration-none">{{ $thread->category->name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.threads.show', $thread) }}" class="text-decoration-none">{{ $thread->title }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.topics.show', $topic) }}" class="text-decoration-none">{{ $topic->title }}</a></li>
|
||||
<li class="breadcrumb-item active">Edit</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h1 class="h3 mb-0">Edit Topic</h1>
|
||||
<p class="text-muted mb-0">in thread: {{ $thread->title }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('forum.topics.update', $topic) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="mb-3">
|
||||
<label for="title" class="form-label">Topic Title</label>
|
||||
<input type="text" class="form-control bg-dark text-white @error('title') is-invalid @enderror" id="title" name="title" value="{{ old('title', $topic->title) }}" required>
|
||||
@error('title')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="content" class="form-label">Content</label>
|
||||
<textarea class="form-control bg-dark text-white @error('content') is-invalid @enderror" id="content" name="content" rows="10" required>{{ old('content', $topic->content) }}</textarea>
|
||||
@error('content')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
@if(auth()->user()->hasRole('admin'))
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="is_pinned" name="is_pinned" value="1" {{ old('is_pinned', $topic->is_pinned) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_pinned">
|
||||
Pin Topic
|
||||
</label>
|
||||
<div class="form-text text-muted">Pinned topics appear at the top of the thread.</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-gradient">Update Topic</button>
|
||||
<a href="{{ route('forum.topics.show', $topic) }}" class="btn btn-outline-light">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,246 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', $topic->title . ' - Forum - ClearGame')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.index') }}" class="text-decoration-none">Forum</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.categories.show', $thread->category) }}" class="text-decoration-none">{{ $thread->category->name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('forum.threads.show', $thread) }}" class="text-decoration-none">{{ $thread->title }}</a></li>
|
||||
<li class="breadcrumb-item active">{{ $topic->title }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h1 class="h2 fw-bold gradient-text">{{ $topic->title }}</h1>
|
||||
<div class="text-muted">
|
||||
<span>Started by <a href="{{ route('profile.show', $topic->user) }}" class="text-decoration-none">{{ $topic->user->name }}</a></span>
|
||||
<span class="mx-1">•</span>
|
||||
<span>{{ $topic->created_at->format('M j, Y g:i A') }}</span>
|
||||
@if($topic->is_pinned)
|
||||
<span class="badge bg-warning text-dark ms-2">Pinned</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@auth
|
||||
@if(!$thread->is_locked)
|
||||
<a href="{{ route('forum.posts.create', ['topic_id' => $topic->id]) }}" class="btn btn-gradient">
|
||||
<i class="fas fa-reply me-1"></i> Reply
|
||||
</a>
|
||||
@endif
|
||||
@if(auth()->id() === $topic->user_id || auth()->user()->hasRole('admin'))
|
||||
<div class="dropdown d-inline-block ms-2">
|
||||
<button class="btn btn-outline-light dropdown-toggle" type="button" data-bs-toggle="dropdown">
|
||||
<i class="fas fa-cog"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<a href="{{ route('forum.topics.edit', $topic) }}" class="dropdown-item">
|
||||
<i class="fas fa-edit me-1"></i> Edit Topic
|
||||
</a>
|
||||
</li>
|
||||
@if(auth()->user()->hasRole('admin'))
|
||||
<li>
|
||||
<form action="{{ route('forum.topics.update', $topic) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<input type="hidden" name="is_pinned" value="{{ $topic->is_pinned ? 0 : 1 }}">
|
||||
<input type="hidden" name="title" value="{{ $topic->title }}">
|
||||
<input type="hidden" name="content" value="{{ $topic->content }}">
|
||||
<button type="submit" class="dropdown-item">
|
||||
<i class="fas fa-thumbtack me-1"></i> {{ $topic->is_pinned ? 'Unpin' : 'Pin' }}
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
@endif
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<form action="{{ route('forum.topics.destroy', $topic) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="dropdown-item text-danger" onclick="return confirm('Are you sure you want to delete this topic? All posts will be deleted.')">
|
||||
<i class="fas fa-trash me-1"></i> Delete Topic
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<a href="{{ route('login') }}" class="btn btn-gradient">
|
||||
<i class="fas fa-sign-in-alt me-1"></i> Login to Reply
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Original Topic Post -->
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="me-3">
|
||||
<i class="fas fa-user-circle fa-2x"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-0">
|
||||
<a href="{{ route('profile.show', $topic->user) }}" class="text-white text-decoration-none">
|
||||
{{ $topic->user->name }}
|
||||
</a>
|
||||
</h5>
|
||||
<div class="text-muted small">
|
||||
<span>{{ $topic->created_at->format('M j, Y g:i A') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="topic-content">
|
||||
{!! nl2br(e($topic->content)) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-dark border-top border-secondary">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<!-- Placeholder for potential like/share buttons -->
|
||||
</div>
|
||||
@auth
|
||||
@if(auth()->id() === $topic->user_id || auth()->user()->hasRole('admin'))
|
||||
<div class="d-flex gap-2">
|
||||
<a href="{{ route('forum.topics.edit', $topic) }}" class="btn btn-outline-primary btn-sm">
|
||||
<i class="fas fa-edit"></i> Edit
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Replies/Posts -->
|
||||
@if($posts->isEmpty())
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-body text-center py-5">
|
||||
<i class="fas fa-comments fa-3x text-muted mb-3"></i>
|
||||
<h3 class="text-muted">No replies yet</h3>
|
||||
<p class="text-muted">Be the first to reply to this topic!</p>
|
||||
@auth
|
||||
@if(!$thread->is_locked)
|
||||
<a href="{{ route('forum.posts.create', ['topic_id' => $topic->id]) }}" class="btn btn-gradient mt-3">
|
||||
<i class="fas fa-reply me-1"></i> Post Reply
|
||||
</a>
|
||||
@else
|
||||
<div class="alert alert-danger mt-3">
|
||||
<i class="fas fa-lock me-1"></i> This thread is locked. You cannot post replies.
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<a href="{{ route('login') }}" class="btn btn-gradient mt-3">
|
||||
<i class="fas fa-sign-in-alt me-1"></i> Login to Reply
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<h3 class="h5 mb-3">Replies ({{ $posts->count() }})</h3>
|
||||
<div class="posts-list">
|
||||
@foreach($posts as $post)
|
||||
<div class="card bg-dark text-white mb-4" id="post-{{ $post->id }}">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="me-3">
|
||||
<i class="fas fa-user-circle fa-2x"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-0">
|
||||
<a href="{{ route('profile.show', $post->user) }}" class="text-white text-decoration-none">
|
||||
{{ $post->user->name }}
|
||||
</a>
|
||||
</h5>
|
||||
<div class="text-muted small">
|
||||
<span>{{ $post->created_at->format('M j, Y g:i A') }}</span>
|
||||
@if($post->edited_at)
|
||||
<span class="mx-1">•</span>
|
||||
<span>Edited {{ $post->edited_at->diffForHumans() }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a href="#post-{{ $post->id }}" class="text-muted text-decoration-none">
|
||||
<i class="fas fa-link"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="post-content">
|
||||
{!! nl2br(e($post->content)) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-dark border-top border-secondary">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
@if($post->is_solution)
|
||||
<span class="badge bg-success">
|
||||
<i class="fas fa-check me-1"></i> Solution
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
@auth
|
||||
@if(auth()->id() === $post->user_id || auth()->user()->hasRole('admin'))
|
||||
<div class="d-flex gap-2">
|
||||
<a href="{{ route('forum.posts.edit', $post) }}" class="btn btn-outline-primary btn-sm">
|
||||
<i class="fas fa-edit"></i> Edit
|
||||
</a>
|
||||
<form action="{{ route('forum.posts.destroy', $post) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm" onclick="return confirm('Are you sure you want to delete this post?')">
|
||||
<i class="fas fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-center">
|
||||
{{ $posts->links() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Reply Form -->
|
||||
@auth
|
||||
@if(!$thread->is_locked)
|
||||
<div class="card bg-dark text-white mt-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Post a Reply</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('forum.posts.store') }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="topic_id" value="{{ $topic->id }}">
|
||||
<div class="mb-3">
|
||||
<textarea name="content" class="form-control bg-dark text-white" rows="5" placeholder="Write your reply here..." required></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-gradient">
|
||||
<i class="fas fa-paper-plane me-1"></i> Post Reply
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger mt-4">
|
||||
<i class="fas fa-lock me-1"></i> This thread is locked. You cannot post replies.
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
@endsection
|
||||
@@ -38,61 +38,74 @@
|
||||
<i class="fas fa-filter me-1"></i> Filter
|
||||
</button>
|
||||
<ul class="dropdown-menu p-3" style="min-width: 300px;">
|
||||
<li class="mb-2">
|
||||
<label class="form-label text-white mb-1"><i class="fas fa-tv me-1"></i> Platform</label>
|
||||
<select name="platform" class="form-select bg-dark text-white border-0" onchange="this.form.submit()">
|
||||
<option value="">All Platforms</option>
|
||||
@foreach($platforms as $platform)
|
||||
<option value="{{ $platform->slug }}" {{ request('platform') == $platform->slug ? 'selected' : '' }}>
|
||||
{{ $platform->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<label class="form-label text-white mb-1"><i class="fas fa-tags me-1"></i> Genre</label>
|
||||
<select name="genre" class="form-select bg-dark text-white border-0" onchange="this.form.submit()">
|
||||
<option value="">All Genres</option>
|
||||
@foreach($genres as $genre)
|
||||
<option value="{{ $genre->slug }}" {{ request('genre') == $genre->slug ? 'selected' : '' }}>
|
||||
{{ $genre->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<label class="form-label text-white mb-1"><i class="fas fa-calendar-alt me-1"></i> Release Year</label>
|
||||
<select name="year" class="form-select bg-dark text-white border-0" onchange="this.form.submit()">
|
||||
<option value="">All Years</option>
|
||||
@foreach($years as $year)
|
||||
<option value="{{ $year }}" {{ request('year') == $year ? 'selected' : '' }}>
|
||||
{{ $year }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<label class="form-label text-white mb-1"><i class="fas fa-star me-1"></i> Rating Range</label>
|
||||
<select name="rating_range" class="form-select bg-dark text-white border-0" onchange="this.form.submit()">
|
||||
<option value="">All Ratings</option>
|
||||
<option value="90-100" {{ request('rating_range') == '90-100' ? 'selected' : '' }}>90+</option>
|
||||
<option value="80-89" {{ request('rating_range') == '80-89' ? 'selected' : '' }}>80-89</option>
|
||||
<option value="70-79" {{ request('rating_range') == '70-79' ? 'selected' : '' }}>70-79</option>
|
||||
<option value="60-69" {{ request('rating_range') == '60-69' ? 'selected' : '' }}>60-69</option>
|
||||
<option value="0-59" {{ request('rating_range') == '0-59' ? 'selected' : '' }}>Below 60</option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="mt-3">
|
||||
<a href="{{ route('games.index') }}" class="btn btn-outline-gradient btn-sm w-100">
|
||||
<i class="fas fa-times me-1"></i> Clear Filters
|
||||
</a>
|
||||
</li>
|
||||
<form action="{{ route('games.index') }}" method="GET">
|
||||
<!-- Preserve any existing query parameters -->
|
||||
@if(request('search'))
|
||||
<input type="hidden" name="search" value="{{ request('search') }}">
|
||||
@endif
|
||||
@if(request('sort'))
|
||||
<input type="hidden" name="sort" value="{{ request('sort') }}">
|
||||
@endif
|
||||
@if(request('direction'))
|
||||
<input type="hidden" name="direction" value="{{ request('direction') }}">
|
||||
@endif
|
||||
|
||||
<li class="mb-2">
|
||||
<label class="form-label text-white mb-1"><i class="fas fa-tv me-1"></i> Platform</label>
|
||||
<select name="platform" class="form-select bg-dark text-white border-0" onchange="this.form.submit()">
|
||||
<option value="">All Platforms</option>
|
||||
@foreach($platforms as $platform)
|
||||
<option value="{{ $platform->slug }}" {{ request('platform') == $platform->slug ? 'selected' : '' }}>
|
||||
{{ $platform->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<label class="form-label text-white mb-1"><i class="fas fa-tags me-1"></i> Genre</label>
|
||||
<select name="genre" class="form-select bg-dark text-white border-0" onchange="this.form.submit()">
|
||||
<option value="">All Genres</option>
|
||||
@foreach($genres as $genre)
|
||||
<option value="{{ $genre->slug }}" {{ request('genre') == $genre->slug ? 'selected' : '' }}>
|
||||
{{ $genre->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<label class="form-label text-white mb-1"><i class="fas fa-calendar-alt me-1"></i> Release Year</label>
|
||||
<select name="year" class="form-select bg-dark text-white border-0" onchange="this.form.submit()">
|
||||
<option value="">All Years</option>
|
||||
@foreach($years as $year)
|
||||
<option value="{{ $year }}" {{ request('year') == $year ? 'selected' : '' }}>
|
||||
{{ $year }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<label class="form-label text-white mb-1"><i class="fas fa-star me-1"></i> Rating Range</label>
|
||||
<select name="rating_range" class="form-select bg-dark text-white border-0" onchange="this.form.submit()">
|
||||
<option value="">All Ratings</option>
|
||||
<option value="90-100" {{ request('rating_range') == '90-100' ? 'selected' : '' }}>90+</option>
|
||||
<option value="80-89" {{ request('rating_range') == '80-89' ? 'selected' : '' }}>80-89</option>
|
||||
<option value="70-79" {{ request('rating_range') == '70-79' ? 'selected' : '' }}>70-79</option>
|
||||
<option value="60-69" {{ request('rating_range') == '60-69' ? 'selected' : '' }}>60-69</option>
|
||||
<option value="0-59" {{ request('rating_range') == '0-59' ? 'selected' : '' }}>Below 60</option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="mt-3">
|
||||
<a href="{{ route('games.index') }}" class="btn btn-outline-gradient btn-sm w-100">
|
||||
<i class="fas fa-times me-1"></i> Clear Filters
|
||||
</a>
|
||||
</li>
|
||||
</form>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(request()->hasAny(['platform', 'genre', 'year ', 'rating_range']))
|
||||
@if(request()->hasAny(['platform', 'genre', 'year', 'rating_range']))
|
||||
<div class="mb-4">
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
@if(request('platform'))
|
||||
|
||||
@@ -3,48 +3,29 @@
|
||||
@section('title', $game->name)
|
||||
|
||||
@section('content')
|
||||
<!-- Hero Section -->
|
||||
<div class="game-hero position-relative mb-5">
|
||||
@if($game->screenshots()->count())
|
||||
<div class="game-hero-bg position-absolute w-100 h-100" style="background: linear-gradient(rgba(18, 18, 18, 0.7), rgba(18, 18, 18, 1)), url('{{ $game->screenshots()->first()->url }}') no-repeat center center; background-size: cover; filter: blur(3px); z-index: -1;"></div>
|
||||
@else
|
||||
<div class="game-hero-bg position-absolute w-100 h-100" style="background: linear-gradient(rgba(18, 18, 18, 0.9), rgba(18, 18, 18, 1)); z-index: -1;"></div>
|
||||
@endif
|
||||
|
||||
<div class="container py-5">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-lg-3 col-md-4 mb-4 mb-md-0">
|
||||
<div class="game-cover position-relative">
|
||||
<img src="{{ $game->cover_url }}" class="img-fluid rounded shadow-lg" alt="{{ $game->name }}">
|
||||
@if($game->rating)
|
||||
<div class="position-absolute top-0 end-0 bg-dark bg-opacity-75 p-2 rounded-circle m-2 shadow">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<span class="fw-bold text-warning">{{ number_format($game->rating, 1) }}</span>
|
||||
</div>
|
||||
<div class="container mt-4">
|
||||
<!-- Main Game Info Section -->
|
||||
<div class="row mb-4">
|
||||
<!-- Left Column: Cover, Rating, Add to List -->
|
||||
<div class="col-md-3">
|
||||
<!-- Cover Image -->
|
||||
<div class="game-cover position-relative mb-3">
|
||||
<img src="{{ $game->cover_url }}" class="img-fluid rounded shadow-lg w-100" alt="{{ $game->name }}">
|
||||
@if($game->rating)
|
||||
<div class="position-absolute top-0 end-0 bg-dark bg-opacity-75 p-2 rounded-circle m-2 shadow">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<span class="fw-bold text-warning">{{ number_format($game->rating, 1) }}</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-8">
|
||||
<h1 class="display-4 fw-bold mb-2">{{ $game->name }}</h1>
|
||||
<div class="d-flex flex-wrap gap-2 mb-3">
|
||||
@foreach($game->genres()->get() as $genre)
|
||||
<span class="badge bg-primary">{{ $genre->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="d-flex flex-wrap gap-2 mb-4">
|
||||
@foreach($game->platforms()->get() as $platform)
|
||||
<span class="badge bg-secondary">{{ $platform->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
<p class="lead mb-4">{{ Str::limit($game->summary, 200) }}</p>
|
||||
<div class="d-flex flex-wrap gap-3 align-items-center">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="far fa-calendar-alt me-2"></i>
|
||||
<span>{{ $game->first_release_date->format('F j, Y') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Rating Section -->
|
||||
<div class="card bg-dark text-white mb-3">
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Rating</h5>
|
||||
@if($game->rating)
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="rating-stars d-flex gap-1">
|
||||
@for($i = 1; $i <= 5; $i++)
|
||||
<i class="fas fa-star {{ $i <= ($game->rating/20) ? 'text-warning' : 'text-secondary' }}"></i>
|
||||
@@ -52,240 +33,214 @@
|
||||
</div>
|
||||
<span class="ms-2">({{ number_format($game->rating_count) }} ratings)</span>
|
||||
</div>
|
||||
@else
|
||||
<p class="text-muted">No ratings yet</p>
|
||||
@endif
|
||||
@auth
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="addToListDropdown"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fas fa-plus me-2"></i>Add to List
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="addToListDropdown">
|
||||
@foreach(Auth::user()->lists as $list)
|
||||
<li>
|
||||
<form action="{{ route('lists.addGame', $list) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
<input type="hidden" name="game_id" value="{{ $game->id }}">
|
||||
<button type="submit" class="dropdown-item">
|
||||
<i class="fas fa-list me-2"></i>{{ $list->name }}
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
@endforeach
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{ route('lists.create') }}">
|
||||
<i class="fas fa-plus me-2"></i>Create New List
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@endauth
|
||||
@auth
|
||||
<a href="{{ route('games.reviews.create', $game) }}" class="btn btn-gradient">
|
||||
<i class="fas fa-star me-2"></i>Write a Review
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add to List Button -->
|
||||
@auth
|
||||
<div class="dropdown mb-3 w-100">
|
||||
<button class="btn btn-outline-primary dropdown-toggle w-100" type="button" id="addToListDropdown"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fas fa-plus me-2"></i>Add to List
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-dark w-100" aria-labelledby="addToListDropdown">
|
||||
@foreach(Auth::user()->lists as $list)
|
||||
<li>
|
||||
<form action="{{ route('lists.addGame', $list) }}" method="POST" class="d-inline">
|
||||
@csrf
|
||||
<input type="hidden" name="game_id" value="{{ $game->id }}">
|
||||
<button type="submit" class="dropdown-item">
|
||||
<i class="fas fa-list me-2"></i>{{ $list->name }}
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
@endforeach
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{ route('lists.create') }}">
|
||||
<i class="fas fa-plus me-2"></i>Create New List
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
<!-- Middle Column: Title, Release Date, Description -->
|
||||
<div class="col-md-6">
|
||||
<!-- Title and Release Date -->
|
||||
<h1 class="fw-bold mb-2">{{ $game->name }}</h1>
|
||||
<p class="text-muted mb-3">
|
||||
<i class="far fa-calendar-alt me-2"></i> Released on {{ $game->first_release_date->format('F j, Y') }}
|
||||
@if(isset($game->company))
|
||||
by {{ $game->company }}
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<!-- Description -->
|
||||
<div class="card bg-dark text-white mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-3">Description</h5>
|
||||
<p class="card-text">{{ $game->summary }}</p>
|
||||
@if($game->storyline)
|
||||
<h6 class="mt-4 mb-2">Storyline</h6>
|
||||
<p class="card-text">{{ $game->storyline }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Column: Platforms, Genres -->
|
||||
<div class="col-md-3">
|
||||
<!-- Platforms -->
|
||||
<div class="card bg-dark text-white mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-3">Platforms</h5>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
@foreach($game->platforms()->get() as $platform)
|
||||
<span class="badge bg-secondary">{{ $platform->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Genres -->
|
||||
<div class="card bg-dark text-white mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-3">Genres</h5>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
@foreach($game->genres()->get() as $genre)
|
||||
<span class="badge bg-primary">{{ $genre->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<!-- Tabs Navigation -->
|
||||
<ul class="nav nav-tabs mb-4" id="gameDetailsTabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="about-tab" data-bs-toggle="tab" data-bs-target="#about" type="button" role="tab" aria-controls="about" aria-selected="true">
|
||||
<i class="fas fa-info-circle me-2"></i>About
|
||||
</button>
|
||||
</li>
|
||||
@if($game->screenshots()->count())
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="media-tab" data-bs-toggle="tab" data-bs-target="#media" type="button" role="tab" aria-controls="media" aria-selected="false">
|
||||
<i class="fas fa-images me-2"></i>Media
|
||||
</button>
|
||||
</li>
|
||||
@endif
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="reviews-tab" data-bs-toggle="tab" data-bs-target="#reviews" type="button" role="tab" aria-controls="reviews" aria-selected="false">
|
||||
<i class="fas fa-comments me-2"></i>Reviews
|
||||
@if($game->reviews->count() > 0)
|
||||
<span class="badge bg-primary ms-1">{{ $game->reviews->count() }}</span>
|
||||
@endif
|
||||
</button>
|
||||
</li>
|
||||
@if($game->similar_games->count() > 0)
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="similar-tab" data-bs-toggle="tab" data-bs-target="#similar" type="button" role="tab" aria-controls="similar" aria-selected="false">
|
||||
<i class="fas fa-gamepad me-2"></i>Similar Games
|
||||
</button>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
<!-- Tabs Content -->
|
||||
<div class="tab-content" id="gameDetailsTabsContent">
|
||||
<!-- About Tab -->
|
||||
<div class="tab-pane fade show active" id="about" role="tabpanel" aria-labelledby="about-tab">
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Summary</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-text">{{ $game->summary }}</p>
|
||||
@if($game->storyline)
|
||||
<h6 class="mt-4 mb-2">Storyline</h6>
|
||||
<p class="card-text">{{ $game->storyline }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($game->dlcs->count() > 0)
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">DLCs & Expansions</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
@foreach($game->dlcs as $dlc)
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card bg-dark h-100">
|
||||
<img src="{{ $dlc->cover_url }}" class="card-img-top" alt="{{ $dlc->name }}">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">{{ $dlc->name }}</h6>
|
||||
<a href="{{ route('games.show', $dlc) }}" class="btn btn-sm btn-outline-primary mt-2">View Details</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
<!-- Bottom Section -->
|
||||
<div class="row mb-4">
|
||||
<!-- Left Column: Stats -->
|
||||
<div class="col-md-4">
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Stats</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group list-group-flush bg-transparent">
|
||||
<li class="list-group-item bg-dark text-white border-secondary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span><i class="far fa-calendar-alt me-2"></i>Release Date</span>
|
||||
<span class="text-end">{{ $game->first_release_date->format('F j, Y') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@if($game->rating)
|
||||
<li class="list-group-item bg-dark text-white border-secondary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span><i class="fas fa-star me-2"></i>Rating</span>
|
||||
<span class="text-end">{{ number_format($game->rating, 1) }}/100 ({{ number_format($game->rating_count) }} ratings)</span>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
@if($game->url)
|
||||
<li class="list-group-item bg-dark text-white border-secondary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span><i class="fas fa-external-link-alt me-2"></i>Website</span>
|
||||
<a href="{{ $game->url }}" target="_blank" class="text-primary">Visit</a>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
@if($reviews->isNotEmpty())
|
||||
<div class="mt-4">
|
||||
<h6 class="mb-3">Rating Distribution</h6>
|
||||
@foreach($ratingDistribution as $rating)
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="rating-label me-2" style="width: 30px;">{{ $rating['range'] }}</div>
|
||||
<div class="progress flex-grow-1" style="height: 10px;">
|
||||
<div class="progress-bar bg-warning" role="progressbar" style="width: {{ $rating['percentage'] }}%"></div>
|
||||
</div>
|
||||
<div class="ms-2" style="width: 40px;">{{ $rating['count'] }}</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Game Details</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group list-group-flush bg-transparent">
|
||||
<li class="list-group-item bg-dark text-white border-secondary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span><i class="far fa-calendar-alt me-2"></i>Release Date</span>
|
||||
<span class="text-end">{{ $game->first_release_date->format('F j, Y') }}</span>
|
||||
</div>
|
||||
</li>
|
||||
@if($game->rating)
|
||||
<li class="list-group-item bg-dark text-white border-secondary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span><i class="fas fa-star me-2"></i>Rating</span>
|
||||
<span class="text-end">{{ number_format($game->rating, 1) }}/100 ({{ number_format($game->rating_count) }} ratings)</span>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
<li class="list-group-item bg-dark text-white border-secondary">
|
||||
<div>
|
||||
<span><i class="fas fa-tags me-2"></i>Genres</span>
|
||||
<div class="d-flex flex-wrap gap-1 mt-2">
|
||||
@foreach($game->genres()->get() as $genre)
|
||||
<span class="badge bg-primary">{{ $genre->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item bg-dark text-white border-secondary">
|
||||
<div>
|
||||
<span><i class="fas fa-desktop me-2"></i>Platforms</span>
|
||||
<div class="d-flex flex-wrap gap-1 mt-2">
|
||||
@foreach($game->platforms()->get() as $platform)
|
||||
<span class="badge bg-secondary">{{ $platform->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@if($game->url)
|
||||
<li class="list-group-item bg-dark text-white border-secondary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span><i class="fas fa-external-link-alt me-2"></i>Website</span>
|
||||
<a href="{{ $game->url }}" target="_blank" class="text-primary">Visit</a>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Media Tab -->
|
||||
@if($game->screenshots()->count() || $game->videos()->count())
|
||||
<div class="tab-pane fade" id="media" role="tabpanel" aria-labelledby="media-tab">
|
||||
@if($game->screenshots()->count())
|
||||
<!-- Right Column: Games on Series (Similar Games) -->
|
||||
<div class="col-md-8">
|
||||
@if($game->similar_games->count() > 0)
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">Screenshots</h5>
|
||||
<button class="btn btn-sm btn-outline-primary" data-bs-toggle="collapse" data-bs-target="#screenshotsCollapse">
|
||||
<i class="fas fa-chevron-down"></i>
|
||||
</button>
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Games on Series</h5>
|
||||
</div>
|
||||
<div class="collapse show" id="screenshotsCollapse">
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
@foreach($game->screenshots()->get() as $screenshot)
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<a href="{{ $screenshot->url }}" data-lightbox="game-screenshots" data-title="{{ $game->name }} Screenshot">
|
||||
<img src="{{ $screenshot->url }}" class="img-fluid rounded shadow-sm hover-scale" alt="Game Screenshot">
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
@foreach($game->similar_games as $similar)
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card bg-dark h-100 hover-scale">
|
||||
<a href="{{ route('games.show', $similar) }}" class="text-decoration-none">
|
||||
<img src="{{ $similar->cover_url }}" class="card-img-top" alt="{{ $similar->name }}">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-white">{{ $similar->name }}</h6>
|
||||
<p class="card-text text-muted small">{{ $similar->first_release_date->format('Y') }}</p>
|
||||
@if($similar->rating)
|
||||
<div class="d-flex align-items-center mt-2">
|
||||
<div class="rating-stars d-flex gap-1">
|
||||
@for($i = 1; $i <= 5; $i++)
|
||||
<i class="fas fa-star {{ $i <= ($similar->rating/20) ? 'text-warning' : 'text-secondary' }}"></i>
|
||||
@endfor
|
||||
</div>
|
||||
<span class="ms-2 small">{{ number_format($similar->rating, 1) }}</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($game->videos()->count())
|
||||
@if($game->dlcs->count() > 0)
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">Videos</h5>
|
||||
<button class="btn btn-sm btn-outline-primary" data-bs-toggle="collapse" data-bs-target="#videosCollapse">
|
||||
<i class="fas fa-chevron-down"></i>
|
||||
</button>
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">DLCs & Expansions</h5>
|
||||
</div>
|
||||
<div class="collapse show" id="videosCollapse">
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
@foreach($game->videos()->get() as $video)
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-dark border-secondary">
|
||||
<div class="ratio ratio-16x9">
|
||||
<iframe src="https://www.youtube.com/embed/{{ $video->video_id }}"
|
||||
title="{{ $video->name }}" allowfullscreen></iframe>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">{{ $video->name }}</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
@foreach($game->dlcs as $dlc)
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card bg-dark h-100">
|
||||
<img src="{{ $dlc->cover_url }}" class="card-img-top" alt="{{ $dlc->name }}">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">{{ $dlc->name }}</h6>
|
||||
<a href="{{ route('games.show', $dlc) }}" class="btn btn-sm btn-outline-primary mt-2">View Details</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Reviews Tab -->
|
||||
<div class="tab-pane fade" id="reviews" role="tabpanel" aria-labelledby="reviews-tab">
|
||||
<!-- Latest Reviews Section -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">User Reviews</h5>
|
||||
<h5 class="mb-0">Latest Reviews</h5>
|
||||
@auth
|
||||
<a href="{{ route('games.reviews.create', $game) }}" class="btn btn-gradient btn-sm">
|
||||
<i class="fas fa-plus me-2"></i>Write a Review
|
||||
@@ -293,7 +248,7 @@
|
||||
@endauth
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($game->reviews->isEmpty())
|
||||
@if($reviews->isEmpty())
|
||||
<div class="text-center py-5">
|
||||
<i class="fas fa-comments fa-3x text-muted mb-3"></i>
|
||||
<p class="text-muted mb-3">No reviews yet. Be the first to review this game!</p>
|
||||
@@ -308,56 +263,8 @@
|
||||
@endauth
|
||||
</div>
|
||||
@else
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-4">
|
||||
<div class="card bg-dark border-secondary h-100">
|
||||
<div class="card-body text-center">
|
||||
<h2 class="display-4 fw-bold text-warning mb-0">
|
||||
{{ number_format($game->reviews->avg('rating'), 1) }}
|
||||
</h2>
|
||||
<div class="rating-stars d-flex gap-1 justify-content-center my-2">
|
||||
@for($i = 1; $i <= 5; $i++)
|
||||
<i class="fas fa-star {{ $i <= ($game->reviews->avg('rating')/2) ? 'text-warning' : 'text-secondary' }}"></i>
|
||||
@endfor
|
||||
</div>
|
||||
<p class="text-muted">Based on {{ $game->reviews->count() }} reviews</p>
|
||||
<div class="d-flex justify-content-center gap-3">
|
||||
<div class="text-center">
|
||||
<span class="d-block fw-bold text-success">{{ $game->reviews->where('recommended', true)->count() }}</span>
|
||||
<small class="text-muted">Recommended</small>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<span class="d-block fw-bold text-danger">{{ $game->reviews->where('recommended', false)->count() }}</span>
|
||||
<small class="text-muted">Not Recommended</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card bg-dark border-secondary h-100">
|
||||
<div class="card-body">
|
||||
<h6 class="mb-3">Rating Distribution</h6>
|
||||
@for($i = 10; $i >= 1; $i--)
|
||||
@php
|
||||
$count = $game->reviews->where('rating', '>=', ($i-1)*2)->where('rating', '<', $i*2)->count();
|
||||
$percentage = $game->reviews->count() > 0 ? ($count / $game->reviews->count()) * 100 : 0;
|
||||
@endphp
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="rating-label me-2" style="width: 30px;">{{ $i*2-1 }}-{{ $i*2 }}</div>
|
||||
<div class="progress flex-grow-1" style="height: 10px;">
|
||||
<div class="progress-bar bg-warning" role="progressbar" style="width: {{ $percentage }}%"></div>
|
||||
</div>
|
||||
<div class="ms-2" style="width: 40px;">{{ $count }}</div>
|
||||
</div>
|
||||
@endfor
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="reviews-list">
|
||||
@foreach($game->reviews as $review)
|
||||
@foreach($reviews->take(3) as $review)
|
||||
<div class="card bg-dark border-secondary mb-4">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
@@ -377,13 +284,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="rating-badge me-2 px-2 py-1 rounded" style="background-color: {{ $review->rating >= 15 ? '#28a745' : ($review->rating >= 10 ? '#ffc107' : '#dc3545') }};">
|
||||
<span class="fw-bold">{{ $review->rating }}/20</span>
|
||||
<div class="rating-badge me-2 px-2 py-1 rounded" style="background-color: {{ $review->rating >= 7 ? '#28a745' : ($review->rating >= 5 ? '#ffc107' : '#dc3545') }};">
|
||||
<span class="fw-bold">{{ $review->rating }}/10</span>
|
||||
</div>
|
||||
@if($review->recommended)
|
||||
<span class="badge bg-success">Recommended</span>
|
||||
@else
|
||||
<span class="badge bg-danger">Not Recommended</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -419,59 +324,23 @@
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@if($reviews->count() > 3)
|
||||
<div class="text-center mt-3">
|
||||
<a href="{{ route('games.reviews.index', $game) }}" class="btn btn-outline-primary">
|
||||
View All {{ $reviews->count() }} Reviews
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Similar Games Tab -->
|
||||
@if($game->similar_games->count() > 0)
|
||||
<div class="tab-pane fade" id="similar" role="tabpanel" aria-labelledby="similar-tab">
|
||||
<div class="card bg-dark text-white">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Similar Games You Might Like</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row g-4">
|
||||
@foreach($game->similar_games as $similar)
|
||||
<div class="col-md-6 col-lg-3">
|
||||
<div class="card bg-dark h-100 hover-scale">
|
||||
<a href="{{ route('games.show', $similar) }}" class="text-decoration-none">
|
||||
<img src="{{ $similar->cover_url }}" class="card-img-top" alt="{{ $similar->name }}">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-white">{{ $similar->name }}</h6>
|
||||
<p class="card-text text-muted small">{{ $similar->first_release_date->format('Y') }}</p>
|
||||
@if($similar->rating)
|
||||
<div class="d-flex align-items-center mt-2">
|
||||
<div class="rating-stars d-flex gap-1">
|
||||
@for($i = 1; $i <= 5; $i++)
|
||||
<i class="fas fa-star {{ $i <= ($similar->rating/20) ? 'text-warning' : 'text-secondary' }}"></i>
|
||||
@endfor
|
||||
</div>
|
||||
<span class="ms-2 small">{{ number_format($similar->rating, 1) }}</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.game-hero {
|
||||
min-height: 400px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.hover-scale {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
@@ -480,29 +349,6 @@
|
||||
transform: scale(1.03);
|
||||
}
|
||||
|
||||
.nav-tabs {
|
||||
border-bottom: 1px solid #343a40;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link {
|
||||
color: #eaeaea;
|
||||
border: none;
|
||||
border-bottom: 2px solid transparent;
|
||||
padding: 0.75rem 1rem;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link:hover {
|
||||
border-color: transparent;
|
||||
border-bottom: 2px solid var(--accent);
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link.active {
|
||||
color: var(--accent);
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
border-bottom: 2px solid var(--accent);
|
||||
}
|
||||
|
||||
.btn-gradient {
|
||||
background: linear-gradient(90deg, var(--primary), var(--accent));
|
||||
border: none;
|
||||
|
||||
@@ -161,6 +161,11 @@
|
||||
<i class="fas fa-gamepad me-1"></i> Games
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ request()->routeIs('forum.*') ? 'active' : '' }}" href="{{ route('forum.index') }}">
|
||||
<i class="fas fa-comments me-1"></i> Forum
|
||||
</a>
|
||||
</li>
|
||||
@auth
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ request()->routeIs('lists.*') ? 'active' : '' }}" href="{{ route('lists.index') }}">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@endif
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="rating" class="form-label">Rating (1-20)</label>
|
||||
<label for="rating" class="form-label">Rating (1-10)</label>
|
||||
<div class="interactive-stars mb-2">
|
||||
<div class="stars-container" id="starsContainer">
|
||||
@for ($i = 1; $i <= 10; $i++)
|
||||
@@ -21,6 +21,21 @@
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="platform_id" class="form-label">Platform</label>
|
||||
<select name="platform_id" id="platform_id" class="form-control bg-dark text-white @error('platform_id') is-invalid @enderror" required>
|
||||
<option value="">Select a platform</option>
|
||||
@foreach($platforms as $platform)
|
||||
<option value="{{ $platform->id }}" {{ isset($review) && $review->platform_id == $platform->id ? 'selected' : '' }}>
|
||||
{{ $platform->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('platform_id')
|
||||
<div class="text-danger mt-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="content" class="form-label">Review</label>
|
||||
<textarea name="content" id="content" class="form-control bg-dark text-white @error('content') is-invalid @enderror" rows="10" required>{{ old('content', $review->content ?? '') }}</textarea>
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
{{ $review->recommended ? 'Recommended' : 'Not Recommended' }}
|
||||
</span>
|
||||
<span class="badge bg-primary">{{ $review->rating }}/10</span>
|
||||
@if($review->platform)
|
||||
<span class="badge bg-info">{{ $review->platform->name }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<small class="text-gray-400">{{ $review->created_at->diffForHumans() }}</small>
|
||||
@@ -28,4 +31,4 @@
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
@endfor
|
||||
</div>
|
||||
@if($review->recommended)
|
||||
<span class="badge bg-success">Recommended</span>
|
||||
@else
|
||||
<span class="badge bg-danger">Not Recommended</span>
|
||||
<span class="badge bg-success me-2">Recommended</span>
|
||||
@endif
|
||||
@if($review->platform)
|
||||
<span class="badge bg-info">{{ $review->platform->name }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,4 +100,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user