62 lines
3.3 KiB
PHP
62 lines
3.3 KiB
PHP
@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
|