72 lines
3.7 KiB
PHP
72 lines
3.7 KiB
PHP
@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
|