1 | @extends("layouts.dashboard")
|
---|
2 |
|
---|
3 | @section("title", "Posts - 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="page-header">
|
---|
12 | <h1 class="page-title">Posts</h1>
|
---|
13 | </div>
|
---|
14 |
|
---|
15 | <div class="row">
|
---|
16 |
|
---|
17 | <div class="col-sm-12">
|
---|
18 | <div class="card">
|
---|
19 |
|
---|
20 | <div class="card-header">
|
---|
21 | <h3 class="card-title">List of posts</h3>
|
---|
22 | <a href="{{ route("dashboard.posts.create") }}" style='margin-left: auto;order: 2;'>
|
---|
23 | <button type="button" class="btn btn-primary">Add new</button>
|
---|
24 | </a>
|
---|
25 | </div>
|
---|
26 |
|
---|
27 | <div class="table-responsive pt-5 pb-5">
|
---|
28 |
|
---|
29 | <table id="dttable" class="table table-hover table-outline table-vcenter text-nowrap card-table">
|
---|
30 | <thead>
|
---|
31 | <tr>
|
---|
32 | <th>Image</th>
|
---|
33 | <th>Title</th>
|
---|
34 | <th>Category</th>
|
---|
35 | <th>User</th>
|
---|
36 | <th>Status</th>
|
---|
37 | <th>Confirmed By</th>
|
---|
38 | <th>Actions</th>
|
---|
39 | </tr>
|
---|
40 | </thead>
|
---|
41 | <tbody>
|
---|
42 | @foreach ($posts as $post)
|
---|
43 | <tr>
|
---|
44 | <td class="text-center">
|
---|
45 | <div class="avatar d-block" style="width: 5rem; height: 5rem; border-radius: 5%; background-image: url(/uploads/{{ $post->image_link }})"></div>
|
---|
46 | </td>
|
---|
47 | <td>{{ $post->title }}</td>
|
---|
48 | <td class="{{ $post->category->is_active ? "" : "text-danger" }}">{{ $post->category->name }}</td>
|
---|
49 | <td>{{ $post->user->getFullName() }}</td>
|
---|
50 | <td>
|
---|
51 | @if($post->is_confirmed)
|
---|
52 | @if($post->is_active)
|
---|
53 | Active
|
---|
54 | @else
|
---|
55 | Blocked
|
---|
56 | @endif
|
---|
57 | @else
|
---|
58 | Not confirmed yet
|
---|
59 | @endif
|
---|
60 | </td>
|
---|
61 | <td>
|
---|
62 | @if ($post->is_confirmed)
|
---|
63 | {{ $post->getConfirmedBy() }}
|
---|
64 | @else
|
---|
65 | Not confirmed yet
|
---|
66 | @endif
|
---|
67 | </td>
|
---|
68 | <td class="text-center">
|
---|
69 | @if($post->is_confirmed || $currentUser->hasPermission("confirm_post"))
|
---|
70 | <div class="item-action dropdown">
|
---|
71 | <a href="javascript:void(0)" data-toggle="dropdown" class="icon" aria-expanded="false"><i class="fe fe-more-vertical"></i></a>
|
---|
72 | <div class="dropdown-menu dropdown-menu-right" x-placement="bottom-end" style="position: absolute; transform: translate3d(15px, 20px, 0px); top: 0px; left: 0px; will-change: transform;">
|
---|
73 |
|
---|
74 | @if ($post->is_confirmed)
|
---|
75 | <a href="{{ route("blog.post", ["category" => strtolower($post->category->name), "slug" => $post->slug]) }}" target="_blank" class="dropdown-item"><i class="dropdown-icon fe fe-file-text"></i> View Post </a>
|
---|
76 | @endif
|
---|
77 |
|
---|
78 | <a href="{{ route("dashboard.posts.edit", ["id" => $post->id]) }}" class="dropdown-item"><i class="dropdown-icon fe fe-edit"></i> Edit Post </a>
|
---|
79 |
|
---|
80 | @if($post->category->is_active)
|
---|
81 | @if ($post->is_confirmed)
|
---|
82 | @if ($post->is_active)
|
---|
83 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.posts.block", ["id" => $post->id]) }}" data-method="patch"><i class="dropdown-icon fe fe-lock"></i> Block </a>
|
---|
84 | <div class="dropdown-divider"></div>
|
---|
85 | @else
|
---|
86 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.posts.unblock", ["id" => $post->id]) }}" data-method="patch"><i class="dropdown-icon fe fe-unlock"></i> Publish </a>
|
---|
87 | <div class="dropdown-divider"></div>
|
---|
88 | @endif
|
---|
89 | @else
|
---|
90 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.posts.confirm", ["id" => $post->id]) }}" data-method="patch"><i class="dropdown-icon fe fe-check"></i> Confirm </a>
|
---|
91 | <div class="dropdown-divider"></div>
|
---|
92 | @endif
|
---|
93 | @endif
|
---|
94 |
|
---|
95 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.posts.destroy", ["id" => $post->id]) }}" data-method="delete"><i class="dropdown-icon fe fe-trash-2 text-danger"></i> Delete </a>
|
---|
96 |
|
---|
97 | </div>
|
---|
98 | </div>
|
---|
99 | @endif
|
---|
100 | </td>
|
---|
101 | </tr>
|
---|
102 | @endforeach
|
---|
103 | </tbody>
|
---|
104 | </table>
|
---|
105 |
|
---|
106 | </div>
|
---|
107 |
|
---|
108 | </div>
|
---|
109 |
|
---|
110 | </div>
|
---|
111 |
|
---|
112 | </div>
|
---|
113 |
|
---|
114 | </div>
|
---|
115 |
|
---|
116 | </div>
|
---|
117 |
|
---|
118 | @endsection
|
---|