1 | @extends("layouts.dashboard")
|
---|
2 |
|
---|
3 | @section("title", "Users - 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">Users</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 users</h3>
|
---|
22 | <a href="{{ route("dashboard.users.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 class="text-center w-1"><i class="icon-people"></i></th>
|
---|
33 | <th>User</th>
|
---|
34 | <th>Posts</th>
|
---|
35 | <th>Technoblog E-mail</th>
|
---|
36 | <th>Registration Date</th>
|
---|
37 | <th>Status</th>
|
---|
38 | <th class="text-center">Actions</th>
|
---|
39 | </tr>
|
---|
40 | </thead>
|
---|
41 | <tbody>
|
---|
42 | @foreach ($users as $user)
|
---|
43 | <tr>
|
---|
44 | <td class="text-center">
|
---|
45 | <div class="avatar d-block" style="background-image: url(demo/faces/female/26.jpg)"></div>
|
---|
46 | </td>
|
---|
47 | <td>
|
---|
48 | <div>{{ $user->name .' '. $user->surname }}</div>
|
---|
49 | <div class="small text-muted">
|
---|
50 | {{ ucfirst($user->role->name) }}
|
---|
51 | <br>
|
---|
52 | {{ $user->email }}
|
---|
53 | <br>
|
---|
54 | {{ $user->mobile_number }}
|
---|
55 | </div>
|
---|
56 | </td>
|
---|
57 | <td>
|
---|
58 | {{ $user->getPostsCount($user->id) }}
|
---|
59 | </td>
|
---|
60 | <td>{{ $user->userProfile->technoblog_email }}</td>
|
---|
61 | <td>{{ date('d.m.Y', strtotime($user->created_at)) }}</td>
|
---|
62 | <td>
|
---|
63 | @if($user->is_confirmed)
|
---|
64 | @if ($user->is_active)
|
---|
65 | Active
|
---|
66 | @else
|
---|
67 | Blocked
|
---|
68 | @endif
|
---|
69 | @else
|
---|
70 | New user
|
---|
71 | @endif
|
---|
72 | </td>
|
---|
73 | <td class="text-center">
|
---|
74 | @if ($user->is_confirmed)
|
---|
75 | <div class="item-action dropdown">
|
---|
76 | <a href="javascript:void(0)" data-toggle="dropdown" class="icon" aria-expanded="false"><i class="fe fe-more-vertical"></i></a>
|
---|
77 | <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;">
|
---|
78 |
|
---|
79 | <a href="{{ route("blog.user-profile", ["profileLink" => $user->userProfile->profile_link]) }}" target="_blank" class="dropdown-item"><i class="dropdown-icon fe fe-user"></i> View profile </a>
|
---|
80 |
|
---|
81 | @if (auth()->user()->id != $user->id)
|
---|
82 |
|
---|
83 | @if ($user->is_active)
|
---|
84 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.users.block", ["id" => $user->id]) }}" data-method="patch"><i class="dropdown-icon fe fe-lock"></i> Block </a>
|
---|
85 | @else
|
---|
86 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.users.unblock", ["id" => $user->id]) }}" data-method="patch"><i class="dropdown-icon fe fe-unlock"></i> Unblock </a>
|
---|
87 | @endif
|
---|
88 |
|
---|
89 | <div class="dropdown-divider"></div>
|
---|
90 |
|
---|
91 | @if ($user->post->count() > 0)
|
---|
92 | <a href="javascript:void(0)" data-from="{{ $user->id }}" class="dropdown-item transferPostsAndDelete"style="cursor: pointer;"><i class="dropdown-icon fe fe-trash-2 text-danger"></i> Delete </a>
|
---|
93 | @else
|
---|
94 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.users.destroy", ["id" => $user->id]) }}" data-method="delete"><i class="dropdown-icon fe fe-trash-2 text-danger"></i> Delete </a>
|
---|
95 | @endif
|
---|
96 |
|
---|
97 | @endif
|
---|
98 |
|
---|
99 | </div>
|
---|
100 | </div>
|
---|
101 | @else
|
---|
102 | <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.users.destroy", ["id" => $user->id]) }}" data-method="delete"><i class="dropdown-icon fe fe-trash-2 text-danger"></i> Delete </a>
|
---|
103 | @endif
|
---|
104 |
|
---|
105 | </td>
|
---|
106 |
|
---|
107 | </tr>
|
---|
108 |
|
---|
109 | @endforeach
|
---|
110 |
|
---|
111 | </tbody>
|
---|
112 |
|
---|
113 | </table>
|
---|
114 |
|
---|
115 | <div class="modal fade deleteUser" id="transferPosts" tabindex="-1" role="dialog" aria-hidden="true">
|
---|
116 |
|
---|
117 | <div class="modal-dialog modal-dialog-centered" role="document">
|
---|
118 |
|
---|
119 | <div class="modal-content">
|
---|
120 |
|
---|
121 | <div class="modal-header">
|
---|
122 | <h5 class="modal-title" id="exampleModalLabel">Delete User</h5>
|
---|
123 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
|
---|
124 | </div>
|
---|
125 |
|
---|
126 | <div class="modal-body">
|
---|
127 |
|
---|
128 | <form id="transferPosts" action="/dashboard/settings/transfer" method="post">
|
---|
129 |
|
---|
130 | @csrf
|
---|
131 |
|
---|
132 | <div class="form-group">
|
---|
133 | <label class="form-label">Transfer posts to</label>
|
---|
134 | <select class="selectData" id="selectWithContent" name="to">
|
---|
135 | @foreach ($users as $user)
|
---|
136 | <option value="{{ $user->id }}" {{ (old("to") == $user->id) ? "selected" : "" }} data-data='{"image": "/uploads/users/{{ $user->userProfile->profile_photo_link }}"}'>{{ $user->getFullName() }}</option>
|
---|
137 | @endforeach
|
---|
138 | </select>
|
---|
139 | </div>
|
---|
140 |
|
---|
141 | <input type="hidden" name="from" value="">
|
---|
142 |
|
---|
143 | <div class="modal-footer">
|
---|
144 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
---|
145 | <input type="submit" class="btn btn-primary" value="Transfer">
|
---|
146 | </div>
|
---|
147 |
|
---|
148 | </form>
|
---|
149 |
|
---|
150 | </div>
|
---|
151 |
|
---|
152 | </div>
|
---|
153 |
|
---|
154 | </div>
|
---|
155 |
|
---|
156 | </div>
|
---|
157 |
|
---|
158 | </div>
|
---|
159 |
|
---|
160 | </div>
|
---|
161 |
|
---|
162 | </div>
|
---|
163 |
|
---|
164 | </div>
|
---|
165 |
|
---|
166 | </div>
|
---|
167 |
|
---|
168 | </div>
|
---|
169 |
|
---|
170 | @endsection
|
---|