<?php $this->layout('layouts/main'); ?>

<?php $this->push('scripts'); ?>
<script src="<?php echo $this->asset('/js/plugins/ckeditor/ckeditor.js') ?>"></script>
<script src="<?php echo $this->asset('/js/ckeditor5.js') ?>"></script>
<?php $this->end(); ?>

<section class="section forum-section">
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<?php $this->insert('components/breadcrumb', ['items' => [
					[
						"url" => url('suggestions.index'),
						"text" => t__('Suggestions')
					],
					[
						"url" => url('suggestions.show', ['id' => $suggestion["id"], 'slug' => $suggestion["slug"]]),
						"text" => $suggestion["title"]
					],
					[
						"text" => t__('Edit Reply')
					]
				]]) ?>
			</div>
		</div>
		
		<div class="card mb-0">
			<div class="card-header">
				<h2 class="card-title"><?php e__('Edit Reply') ?></h2>
			</div>
			<div class="card-body">
				<div class="forum-content">
					<form data-toggle="form-submit-with-loader" action="<?php echo url('suggestions.replies.update', ['id' => $reply["id"]]) ?>" method="post">
						<?php _method('PATCH'); ?>
						<?php _csrf(); ?>
						<div class="mb-3">
							<textarea
								id="ckeditor"
								name="message"
								placeholder=""
								class="form-control"
								style="min-height: 500px;"
								data-upload="<?php echo url('suggestions.upload') ?>"
								data-csrf="<?php echo csrf_token(); ?>"><?php _old('message', $reply["message"]); ?></textarea>
						</div>
						<div class="d-flex justify-content-end">
							<button type="submit" class="btn btn-primary">
								<?php e__('Save Changes') ?>
							</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</section>
