[0924b6c] | 1 | @extends("layouts.dashboard")
|
---|
| 2 |
|
---|
| 3 | @section("title", "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">Dashboard</h1>
|
---|
| 13 | </div>
|
---|
| 14 |
|
---|
| 15 | <div class="row row-cards">
|
---|
| 16 |
|
---|
| 17 | @if(auth()->user()->hasPermission("access_all_posts"))
|
---|
| 18 | <div class="col">
|
---|
| 19 | <div class="card">
|
---|
| 20 | <div class="card-body p-3 text-center">
|
---|
| 21 | <div class="h1 m-0 pt-4">{{ $counters["allPosts"] }}</div>
|
---|
| 22 | <div class="text-muted mb-4 font-weight-bold"><a href="{{ route("dashboard.posts.index") }}">Total Posts</a></div>
|
---|
| 23 | </div>
|
---|
| 24 | </div>
|
---|
| 25 | </div>
|
---|
| 26 | @endif
|
---|
| 27 |
|
---|
| 28 | <div class="col">
|
---|
| 29 | <div class="card">
|
---|
| 30 | <div class="card-body p-3 text-center">
|
---|
| 31 | <div class="h1 m-0 pt-4">{{ $counters["currentUserPosts"] }}</div>
|
---|
| 32 | <div class="text-muted mb-4 font-weight-bold"><a href="{{ route("blog.user-profile", ["profileLink" => auth()->user()->userProfile->profile_link]) }}">Your Posts</a></div>
|
---|
| 33 | </div>
|
---|
| 34 | </div>
|
---|
| 35 | </div>
|
---|
| 36 |
|
---|
| 37 | @if(auth()->user()->hasPermission("access_all_users"))
|
---|
| 38 | <div class="col">
|
---|
| 39 | <div class="card">
|
---|
| 40 | <div class="card-body p-3 text-center">
|
---|
| 41 | <div class="h1 m-0 pt-4">{{ $counters["users"] }}</div>
|
---|
| 42 | <div class="text-muted mb-4 font-weight-bold"><a href="{{ route("dashboard.users.index") }}">Users</a></div>
|
---|
| 43 | </div>
|
---|
| 44 | </div>
|
---|
| 45 | </div>
|
---|
| 46 | @endif
|
---|
| 47 |
|
---|
| 48 | @if(auth()->user()->hasPermission("approve_all_comments"))
|
---|
| 49 | <div class="col">
|
---|
| 50 | <div class="card">
|
---|
| 51 | <div class="card-body p-3 text-center">
|
---|
| 52 | <div class="h1 m-0 pt-4">{{ $counters["total_comments"] }}</div>
|
---|
| 53 | <div class="text-muted mb-4 font-weight-bold"><a href="{{ route("dashboard.comments.index") }}">Total Comments</a></div>
|
---|
| 54 | </div>
|
---|
| 55 | </div>
|
---|
| 56 | </div>
|
---|
| 57 | @endif
|
---|
| 58 |
|
---|
| 59 | <div class="col">
|
---|
| 60 | <div class="card">
|
---|
| 61 | <div class="card-body p-3 text-center">
|
---|
| 62 | <div class="h1 m-0 pt-4">{{ $counters["comments"] }}</div>
|
---|
| 63 | <div class="text-muted mb-4 font-weight-bold"><a href="{{ route("dashboard.comments.index") }}">Your Post Comments</a></div>
|
---|
| 64 | </div>
|
---|
| 65 | </div>
|
---|
| 66 | </div>
|
---|
| 67 |
|
---|
| 68 | </div>
|
---|
| 69 |
|
---|
| 70 | <div class="row row-cards row-deck">
|
---|
| 71 |
|
---|
| 72 | @if(auth()->user()->hasPermission("confirm_post"))
|
---|
| 73 | <div class="col">
|
---|
| 74 | <div class="card">
|
---|
| 75 | <div class="card-header">
|
---|
| 76 | <h3 class="card-title">Pending Posts</h3>
|
---|
| 77 | </div>
|
---|
| 78 | <div class="card-body o-auto" style="height: 15rem">
|
---|
| 79 | <ul class="list-unstyled list-separated">
|
---|
| 80 | @foreach ($pendingPosts as $post)
|
---|
| 81 | <li class="list-separated-item">
|
---|
| 82 | <div class="row align-items-center">
|
---|
| 83 | <div class="col">
|
---|
| 84 | <div>
|
---|
| 85 | <a href="javascript:void(0)" class="text-inherit">{{ $post->title }}</a>
|
---|
| 86 | </div>
|
---|
| 87 | <small class="d-block item-except text-sm text-muted h-1x">{{ $post->user->getFullName() }}</small>
|
---|
| 88 | </div>
|
---|
| 89 | <div class="col-auto">
|
---|
| 90 | <div class="item-action dropdown">
|
---|
| 91 | <a href="javascript:void(0)" data-toggle="dropdown" class="icon" aria-expanded="false"><i class="fe fe-more-vertical"></i></a>
|
---|
| 92 | <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;">
|
---|
| 93 | <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>
|
---|
| 94 | <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>
|
---|
| 95 | </div>
|
---|
| 96 | </div>
|
---|
| 97 | </div>
|
---|
| 98 | </div>
|
---|
| 99 | </li>
|
---|
| 100 | @endforeach
|
---|
| 101 | </ul>
|
---|
| 102 | </div>
|
---|
| 103 | </div>
|
---|
| 104 | </div>
|
---|
| 105 | @endif
|
---|
| 106 |
|
---|
| 107 | @php
|
---|
| 108 |
|
---|
| 109 | $flag = true;
|
---|
| 110 |
|
---|
| 111 | if(!auth()->user()->hasPermission("confirm_post")) {
|
---|
| 112 | $flag = false;
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 | @endphp
|
---|
| 116 |
|
---|
| 117 | <div class="{{ $flag ? "col" : "col-md-6" }}">
|
---|
| 118 | <div class="card">
|
---|
| 119 | <div class="card-header">
|
---|
| 120 | <h3 class="card-title">Pending Comments</h3>
|
---|
| 121 | </div>
|
---|
| 122 | <div class="card-body o-auto" style="height: 15rem">
|
---|
| 123 | <ul class="list-unstyled list-separated">
|
---|
| 124 | @foreach ($pendingComments as $comment)
|
---|
| 125 | <li class="list-separated-item">
|
---|
| 126 | <div class="row align-items-center">
|
---|
| 127 | <div class="col">
|
---|
| 128 | <div>
|
---|
| 129 | <a href="javascript:void(0)" class="text-inherit">{{ $comment->comment }}</a>
|
---|
| 130 | </div>
|
---|
| 131 | <small class="d-block item-except text-sm text-muted h-1x">{{ $comment->name }}</small>
|
---|
| 132 | </div>
|
---|
| 133 | <div class="col-auto">
|
---|
| 134 | <div class="item-action dropdown">
|
---|
| 135 | <a href="javascript:void(0)" data-toggle="dropdown" class="icon" aria-expanded="false"><i class="fe fe-more-vertical"></i></a>
|
---|
| 136 | <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;">
|
---|
| 137 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.comments.confirm", ["id" => $comment->id]) }}" data-method="patch"><i class="dropdown-icon fe fe-check"></i> Confirm </a>
|
---|
| 138 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.comments.destroy", ["id" => $comment->id]) }}" data-method="delete"><i class="dropdown-icon fe fe-trash-2 text-danger"></i> Delete </a>
|
---|
| 139 | </div>
|
---|
| 140 | </div>
|
---|
| 141 | </div>
|
---|
| 142 | </div>
|
---|
| 143 | </li>
|
---|
| 144 | @endforeach
|
---|
| 145 | </ul>
|
---|
| 146 | </div>
|
---|
| 147 | </div>
|
---|
| 148 | </div>
|
---|
| 149 |
|
---|
| 150 | @if($flag)
|
---|
| 151 | </div>
|
---|
| 152 | @endif
|
---|
| 153 |
|
---|
| 154 | <div class="{{ $flag ? "row row-cards row-deck" : "col-md-6" }}">
|
---|
| 155 |
|
---|
| 156 | <div class="{{ $flag ? "col-md-12" : "" }}">
|
---|
| 157 | <div class="card">
|
---|
| 158 | <div class="card-header">
|
---|
| 159 | <h4 class="card-title">Popular Posts</h4>
|
---|
| 160 | </div>
|
---|
| 161 | <table class="table card-table">
|
---|
| 162 | <tbody>
|
---|
| 163 | @foreach ($mostLikedPosts as $post)
|
---|
| 164 | <tr>
|
---|
| 165 | <td><a href="{{ route("blog.post", ["category" => strtolower($post->category->name), "slug" => $post->slug]) }}" target="_blank">{{ $post->title }}</a></td>
|
---|
| 166 | <td width="1"></td>
|
---|
| 167 | <td class="text-right"><span class="text-muted">{{ $post->total_likes }}</span></td>
|
---|
| 168 | </tr>
|
---|
| 169 | @endforeach
|
---|
| 170 | </tbody>
|
---|
| 171 | </table>
|
---|
| 172 | </div>
|
---|
| 173 | </div>
|
---|
| 174 |
|
---|
| 175 | </div>
|
---|
| 176 |
|
---|
| 177 | @if(!$flag)
|
---|
| 178 | </div>
|
---|
| 179 | @endif
|
---|
| 180 |
|
---|
| 181 | </div>
|
---|
| 182 |
|
---|
| 183 | </div>
|
---|
| 184 |
|
---|
| 185 | @endsection
|
---|