lots of improvements
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user