aboutsummaryrefslogtreecommitdiff
path: root/resources/views/pages/editpost.blade.php
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-11-02 17:45:41 +0100
committerMateja <mail@matejamaric.com>2020-11-02 17:45:41 +0100
commitcdd9fcf7bf49e4468c2290e30a98c6730a334900 (patch)
tree552b1372802e38b13ac6567845a35617e38a4f9c /resources/views/pages/editpost.blade.php
parentb5afd40a49a2c2b061865a501103ea2a060f4997 (diff)
downloadyota-laravel-cdd9fcf7bf49e4468c2290e30a98c6730a334900.tar.gz
yota-laravel-cdd9fcf7bf49e4468c2290e30a98c6730a334900.zip
News system finished...
Diffstat (limited to 'resources/views/pages/editpost.blade.php')
-rw-r--r--resources/views/pages/editpost.blade.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/resources/views/pages/editpost.blade.php b/resources/views/pages/editpost.blade.php
new file mode 100644
index 0000000..4be1dff
--- /dev/null
+++ b/resources/views/pages/editpost.blade.php
@@ -0,0 +1,52 @@
+@extends('layouts.app')
+
+@section('title', 'Edit post')
+
+@section('navbar', View::make('inc.navbar'))
+
+@section('content')
+ <h3 class="mt-2">Edit Post:</h3>
+ @if (session('status'))
+ <div class="alert alert-success">
+ {{ session('status') }}
+ </div>
+ @endif
+ <form action="{{ route('newsEditForm', request()->route()->parameter('id')) }}" method="POST">
+ @csrf
+ <div class="form-group">
+ <label for="title">Title:</label>
+ <input type="text" name="title" value="{{ old('title') ?? $data->title }}" id="title" class="form-control" required>
+ @error('title')
+ <div class="alert alert-danger mt-2">{{ $message }}</div>
+ @enderror
+ </div>
+
+ <div class="form-group">
+ <label for="author">Author:</label>
+ <input type="text" name="author" value="{{ old('author') ?? $data->author }}" id="author" class="form-control">
+ </div>
+
+ <div class="form-group">
+ <label for="editor">Text:</label>
+ <textarea name="text" id="editor" class="form-control">{{ old('text') ?? $data->text }}</textarea>
+ @error('text')
+ <div class="alert alert-danger mt-2">{{ $message }}</div>
+ @enderror
+ </div>
+
+ <div class="form-group">
+ <input type="submit" name="submit" value="Edit post" class="btn btn-primary">
+ <input type="submit" name="submit" value="Cancel" class="btn btn-secondary">
+ </div>
+ </form>
+@endsection
+
+@section('scripts')
+<script src="https://cdn.ckeditor.com/ckeditor5/23.1.0/classic/ckeditor.js"></script>
+<script>
+ClassicEditor.create(document.querySelector('#editor'))
+ .catch(error => {
+ console.error( error );
+ });
+</script>
+@endsection