1 | @extends("layouts.dashboard")
|
---|
2 |
|
---|
3 | @section("title", "Add new post - Dashboard | TechnoBlog")
|
---|
4 |
|
---|
5 | @section("dashboard_content")
|
---|
6 |
|
---|
7 | <div class="my-3 my-md-5">
|
---|
8 |
|
---|
9 | <div class="container">
|
---|
10 |
|
---|
11 | <div class="row">
|
---|
12 |
|
---|
13 | <div class="col-sm-12">
|
---|
14 |
|
---|
15 | @if(!$post->review->is_passed_all_phases)
|
---|
16 | <p class="text-center" style="font-size: 17px;">
|
---|
17 | Current phase: {{ $post->review->getPhase()->name }}
|
---|
18 | @if($post->review->canReview())
|
---|
19 | <a href="javascript:void(0)" class="btn btn-primary actionLink" style="cursor: pointer;" data-action="{{ route("dashboard.posts.confirm", ["id" => $post->id]) }}" data-method="patch"><i class="text-light fe fe-check"></i> Confirm </a>
|
---|
20 | @endif
|
---|
21 | </p>
|
---|
22 | @endif
|
---|
23 |
|
---|
24 | <div class="card">
|
---|
25 |
|
---|
26 | <nav aria-label="breadcrumb">
|
---|
27 | <ol class="breadcrumb" style="border-radius: 0px !important;">
|
---|
28 | <li class="breadcrumb-item">
|
---|
29 | <a href="{{ route("dashboard.index") }}">Dashboard</a>
|
---|
30 | </li>
|
---|
31 | <li class="breadcrumb-item">
|
---|
32 | <a href="{{ route("dashboard.posts.index") }}">Posts</a>
|
---|
33 | </li>
|
---|
34 | <li class="breadcrumb-item active" aria-current="page">Edit Post</li>
|
---|
35 | </ol>
|
---|
36 | </nav>
|
---|
37 |
|
---|
38 | <div class="card-header">
|
---|
39 | <h3 class="card-title">Edit Post</h3>
|
---|
40 | </div>
|
---|
41 |
|
---|
42 | <form class="actionForm" action="{{ route("dashboard.posts.edit", ["id" => $post->id]) }}" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
|
---|
43 |
|
---|
44 | @method("patch")
|
---|
45 | @csrf
|
---|
46 |
|
---|
47 | <div class="row p-5">
|
---|
48 |
|
---|
49 | <div class="col-md-4">
|
---|
50 |
|
---|
51 | <div class="form-group">
|
---|
52 | <label class="form-label">Title</label>
|
---|
53 | <input type="text" value="{{ old("title", $post->title) }}" name="title" class="form-control" required>
|
---|
54 | </div>
|
---|
55 |
|
---|
56 | <div class="form-group">
|
---|
57 | <label class="form-label">Upload Image</label>
|
---|
58 | <div class="custom-file">
|
---|
59 | <input type="file" class="custom-file-input" name="image">
|
---|
60 | <label class="custom-file-label">Choose file</label>
|
---|
61 | </div>
|
---|
62 | </div>
|
---|
63 |
|
---|
64 | <div class="form-group">
|
---|
65 | <label class="form-label">Select Category</label>
|
---|
66 | <select name="category">
|
---|
67 | @foreach ($categories as $category)
|
---|
68 | <option value="{{ $category->id }}" {{ old("category", $post->category->id) == $category->id ? "selected" : "" }}>{{ $category->name }}</option>
|
---|
69 | @endforeach
|
---|
70 | </select>
|
---|
71 | </div>
|
---|
72 |
|
---|
73 | <div class="form-group">
|
---|
74 | <label class="form-label">Select or create new tags</label>
|
---|
75 | <select id="postTags">
|
---|
76 | @foreach ($tags as $tag)
|
---|
77 | <option value="{{ $tag->id }}">{{ $tag->name }}</option>
|
---|
78 | @endforeach
|
---|
79 | </select>
|
---|
80 | <input type="hidden" name="tags" value="{{ old("tags", implode(",", $postTags)) }}">
|
---|
81 | </div>
|
---|
82 |
|
---|
83 | </div>
|
---|
84 |
|
---|
85 | <div class="col-md-8">
|
---|
86 | <label class="form-label">Content</label>
|
---|
87 | <!-- Quill rich text editor -->
|
---|
88 | <div id="postEditor" class="pr-5" style="height: 500px;"></div>
|
---|
89 | <input type="hidden" class="postContent" name="post_content" value='{{ old("post_content", $post->content) }}'>
|
---|
90 | </div>
|
---|
91 |
|
---|
92 | <div class="col mt-5">
|
---|
93 | <div class="form-group border-top">
|
---|
94 | <div class="float-right pt-5">
|
---|
95 | <input type="submit" value="Edit Post" class="submitBtn submitNewPost btn btn-primary">
|
---|
96 | </div>
|
---|
97 | </div>
|
---|
98 | </div>
|
---|
99 |
|
---|
100 | </div>
|
---|
101 |
|
---|
102 | </form>
|
---|
103 |
|
---|
104 | </div>
|
---|
105 |
|
---|
106 | </div>
|
---|
107 |
|
---|
108 | </div>
|
---|
109 |
|
---|
110 | </div>
|
---|
111 |
|
---|
112 | </div>
|
---|
113 |
|
---|
114 | @endsection
|
---|