source: resources/views/dashboard/users/index.blade.php@ 83da0d2

develop
Last change on this file since 83da0d2 was 0208bbd, checked in by Berat Kjufliju <kufliju@…>, 3 years ago

edited pagination

  • Property mode set to 100644
File size: 20.2 KB
Line 
1@extends('layouts.app')
2
3@section("title", "SaveSpace - Users")
4
5@section('head')
6 <!-- Datatable -->
7 <link rel="stylesheet" href="{{ url('vendors/dataTable/dataTables.min.css') }}" type="text/css">
8
9@endsection
10
11@section('content')
12
13 <div class="page-header justify-content-between">
14 <nav aria-label="breadcrumb" class="d-flex align-items-start">
15 <ol class="breadcrumb">
16 <li class="breadcrumb-item">
17 <a href="{{ url('/') }}">Dashboard</a>
18 </li>
19 <li class="breadcrumb-item active" aria-current="page">Users</li>
20 </ol>
21 </nav>
22 <div class="dropdown">
23 <a href="javascript:void(0)" data-toggle="modal" data-target="#createModal" class="btn btn-primary text-white">
24 <i class="fa fa-plus pr-1"></i> New
25 </a>
26 <a href="{{ route('dashboard.users.export') }}" class="btn btn-success text-white">
27 <i class="fa fa-table pr-1"></i> Export
28 </a>
29 </div>
30 </div>
31
32 <div class="row">
33 <div class="col-md-12">
34 <div class="card">
35 <div class="card-body">
36 <div class="table-responsive">
37 <table id="user-list" class="table table-lg">
38 <thead>
39 <tr>
40 <th></th>
41 <th>State</th>
42 <th>Username</th>
43 <th>Name</th>
44 <th>Created by</th>
45 <th>Created at</th>
46 <th>Updated at</th>
47 <th>Status</th>
48 <th>Actions</th>
49 </tr>
50 </thead>
51 <tbody>
52 @foreach($users as $user)
53 <tr>
54 <td></td>
55 <td>
56 @if($user->is_confirmed)
57 @if ($user->is_active)
58 <span class="badge bg-success-bright text-success">Active</span>
59 @else
60 <span class="badge bg-danger-bright text-danger">Blocked</span>
61 @endif
62 @else
63 <span class="badge bg-warning-bright text-warning">New user</span>
64 @endif
65 </td>
66 <td>
67 <figure class="avatar avatar-sm mr-2">
68 @if($user->avatar==NULL)
69 <img src="{{ url('assets/media/images/user.png') }}" class="rounded-circle" alt="avatar">
70 @else
71 <img src="{{url('uploads/users/' . $user->avatar)}}" class="rounded-circle" alt="avatar">
72 @endif
73 </figure>
74 {{$user->username}}
75 </td>
76 <td>{{$user->name .' '. $user->surname}}
77 <div class="font-weight-light p-1">{{$user->role->name}}</div>
78 <div class="font-weight-light p-1">{{$user->email}}</div>
79 <div class="font-weight-light p-1">{{$user->phone_number}}</div>
80 </td>
81 <td>{{ $user->getCreatedByName() }}</td>
82 <td>{{ date('d.m.Y - H:i', strtotime($user->created_at)) }}</td>
83 @if($user->updated_at==NULL)
84 <td>/</td>
85 @else
86 <td>{{ date('d.m.Y - H:i', strtotime($user->updated_at)) }}</td>
87 @endif
88 <td>
89 @if(Cache::has('is_online' . $user->id))
90 <span data-toggle="tooltip" data-placement="bottom" title="{{ $user->last_seen }}" style="cursor: pointer;" class="text-success">Online</span>
91 @else
92 <span data-toggle="tooltip" data-placement="bottom" title="{{ $user->last_seen }}" class="text-secondary">Offline</span>
93 @endif
94 </td>
95 @if($user->hasRole("Referent") && $user->is_confirmed)
96 <td>
97 <a href="javascript:void(0)" class="text-secondary" data-toggle="modal" data-target="#editModal_{{$user->id}}" title="Edit">
98 <i class="ti-pencil"></i>
99 </a>
100 <a href="javascript:void(0)" class="text-danger ml-2" data-action="{{ route("dashboard.users.destroy", ["id" => $user->id]) }}" data-method="delete" title="Delete">
101 <i class="ti-trash"></i>
102 </a>
103 </td>
104 @else
105 <td>/</td>
106 @endif
107 </tr>
108
109 <div class="modal fade" id="editModal_{{$user->id}}" tabindex="-1" role="dialog" aria-hidden="true">
110 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
111 <div class="modal-content">
112 <div class="modal-header">
113 <h5 class="modal-title" id="exampleModalCenterTitle">Edit user</h5>
114 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
115 <i class="ti-close"></i>
116 </button>
117 </div>
118 <div class="modal-body">
119 <form action="{{ route("dashboard.users.edit", ["id" =>$user->id]) }}" method="post" accept-charset="utf-8" enctype='multipart/form-data'>
120 @method("patch")
121 @csrf
122 <div class="row">
123 <div class="col-md-6">
124 <div class="form-group">
125 <label>Name</label>
126 <input type="text" name="name" value="{{ $user->name }}" minlength="2" maxlength="30" pattern="[a-zA-Zа-шА-Ш._\s]+" class="form-control" placeholder="Name" required>
127 </div>
128 </div>
129 <div class="col-md-6">
130 <div class="form-group">
131 <label>Surname</label>
132 <input type="text" name="surname" value="{{$user->surname}}" minlength="2" maxlength="30" pattern="[a-zA-Zа-шА-Ш._\s]+" class="form-control" placeholder="Surname" required>
133 </div>
134 </div>
135 </div>
136 <div class="row">
137 <div class="col-md-6">
138 <div class="form-group">
139 <label class="form-label">Username</label>
140 <input type="text" name="username" value="{{ $user->username }}" minlength="5" maxlength="30" class="form-control" placeholder="Username" required>
141 </div>
142 </div>
143 <div class="col-md-6">
144 <div class="form-group">
145 <label class="form-label">Role</label>
146
147 <select class="form-control" name="userRole" required>
148 @foreach($roles as $role)
149 <option value="{{ $role->id }}" {{ $user->role_id == $role->id ? "selected" : "" }}>{{ $role->name }}</option>
150 @endforeach
151 </select>
152 </div>
153 </div>
154 </div>
155 <div class="row">
156 <div class="col-md-6">
157 <div class="form-group">
158 <label>Email</label>
159 <input type="email" name="email" value="{{ $user->email }}" maxlength="50" class="form-control" placeholder="E-mail" required>
160 </div>
161 </div>
162 <div class="col-md-6">
163 <div class="form-group">
164 <label class="form-label">Phone Number</label>
165 <input type="text" name="phone_number" value="{{ $user->phone_number }}" class="form-control" placeholder="Phone number" autocomplete="off" required>
166 </div>
167 </div>
168 </div>
169 <div class="row">
170 <div class="col-md-5">
171 <div class="form-group">
172 <label>Avatar</label>
173 <input type="file" name="avatar" value="{{ $user->avatar }}" class="form-control" accept="image/*">
174 </div>
175 </div>
176 <div class="col-md-1">
177 <div class="form-group">
178 <label>Current</label>
179 <figure class="avatar avatar-sm mr-2">
180 @if($user->avatar==NULL)
181 <img src="{{ url('assets/media/images/user.png') }}" class="rounded-circle" alt="avatar">
182 @else
183 <img src="{{url('uploads/users/' . $user->avatar)}}" class="rounded-circle" alt="avatar">
184 @endif
185 </figure>
186 </div>
187 </div>
188 </div>
189 <div class="modal-footer">
190 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
191 </button>
192 <button type="submit" class="btn btn-primary">Save changes</button>
193 </div>
194 </form>
195 </div>
196
197 </div>
198 </div>
199 </div>
200
201 @endforeach
202 </tbody>
203 </table>
204
205 <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-hidden="true">
206 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
207 <div class="modal-content">
208 <div class="modal-header">
209 <h5 class="modal-title" id="exampleModalCenterTitle">Create user</h5>
210 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
211 <i class="ti-close"></i>
212 </button>
213 </div>
214 <div class="modal-body">
215 <form action="{{ route("dashboard.users.store") }}" method="post" accept-charset="utf-8" enctype='multipart/form-data'>
216 @csrf
217 <div class="row">
218 <div class="col-md-6">
219 <div class="form-group">
220 <label>Name</label>
221 <input type="text" name="name" value="{{ old('name') }}" minlength="2" maxlength="25" pattern="[a-zA-Zа-шА-Ш._\s]+" class="form-control" placeholder="Name" required>
222 </div>
223 </div>
224 <div class="col-md-6">
225 <div class="form-group">
226 <label>Surname</label>
227 <input type="text" name="surname" value="{{ old('surname') }}" minlength="2" maxlength="25" pattern="[a-zA-Zа-шА-Ш._\s]+" class="form-control" placeholder="Surname" required>
228 </div>
229 </div>
230 </div>
231 <div class="row">
232 <div class="col-md-6">
233 <div class="form-group">
234 <label class="form-label">Username</label>
235 <input type="text" name="username" value="{{ old('username') }}" minlength="5" maxlength="30" class="form-control" placeholder="Username" required>
236 </div>
237 </div>
238 <div class="col-md-6">
239 <div class="form-group">
240 <label class="form-label">Role</label>
241 <select class="form-control" name="userRole" required>
242 @foreach ($roles as $role)
243 <option value="{{ $role->id }}" {{ (old("userRole") == $role->id ? "selected" : "" ) }}>{{ $role->name }}</option>
244 @endforeach
245 </select>
246 </div>
247 </div>
248 </div>
249 <div class="row">
250 <div class="col-md-6">
251 <div class="form-group">
252 <label>Email</label>
253 <input type="email" name="email" value="{{ old('email') }}" class="form-control" placeholder="E-mail" required>
254 </div>
255 </div>
256 <div class="col-md-6">
257 <div class="form-group">
258 <label class="form-label">Phone Number</label>
259 <input type="text" name="phone_number" value="{{ old('phone_number') }}" class="form-control" placeholder="Phone number" autocomplete="off" required>
260 </div>
261 </div>
262 </div>
263 <div class="row">
264 <div class="col-md-6">
265 <div class="form-group">
266 <label>Avatar</label>
267 <input type="file" name="avatar" value="{{ old('avatar') }}" class="form-control" accept="image/*">
268 </div>
269 </div>
270 </div>
271 <div class="modal-footer">
272 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
273 </button>
274 <button type="submit" class="btn btn-primary">Save changes</button>
275 </div>
276 </form>
277 </div>
278 </div>
279 </div>
280 </div>
281
282 </div>
283 </div>
284 </div>
285 </div>
286 </div>
287
288@endsection
289
290@section('script')
291 <script src="{{ url('assets/js/examples/pages/user-list.js') }}"></script>
292 <!-- Datatable -->
293 <script src="{{ url('vendors/dataTable/dataTables.min.js') }}"></script>
294@endsection
Note: See TracBrowser for help on using the repository browser.