Files
cleargame/resources/views/forum/posts/edit.blade.php
T
2026-02-22 20:02:34 +02:00

55 lines
2.9 KiB
PHP

@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