source: resources/views/dashboard/folders/index.blade.php@ 79aa35c

Last change on this file since 79aa35c was ec7b69d, checked in by beratkjufliju <kufliju@…>, 3 years ago

added confirmation modal on userSettings

  • Property mode set to 100644
File size: 25.8 KB
RevLine 
[c6b84df]1@extends('layouts.app')
2
3@section("title", "SaveSpace - Folders")
4
5@section('content')
6
7 <div class="row app-block mb-4">
8 <div class="col-md-3 app-sidebar">
9 <div class="card">
10 <div class="card-body">
[0df7a93]11 @if(auth()->user()->hasPermission('manage_all_folders'))
[c6b84df]12 <a href="javascript:void(0)" class="btn btn-secondary btn-block file-upload-btn text-white" data-toggle="modal" data-target="#createModal">
13 Add folder
14 </a>
[0df7a93]15 @endif
[c6b84df]16 </div>
17 <div class="app-sidebar-menu">
18 <div class="list-group list-group-flush">
[e3af09e]19 @if(Route::is("dashboard.folders.index") && Request::query('id')==null)
20 <a href="{{route("dashboard.folders.index")}}" class="list-group-item d-flex align-items-center" style="font-weight: bold;">
[c6b84df]21 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
22 Folders
23 </a>
[e3af09e]24 @else
25 <a href="{{route("dashboard.folders.index")}}" class="list-group-item d-flex align-items-center">
26 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
27 Folders
28 </a>
29 @endif
[c6b84df]30 @foreach($departments as $department)
[4521f25]31 @if(Request::query('id') == $department->id)
32 <a href="{{ route("dashboard.folders.index", ["id" => $department->id]) }}" class="list-group-item d-flex align-items-center" style="font-weight: bold;">
[c6b84df]33 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
34 {{$department->name}}
35 <span class="small ml-auto">{{$department->folder->count()}}</span>
36 </a>
[4521f25]37 @else
38 <a href="{{ route("dashboard.folders.index", ["id" => $department->id]) }}" class="list-group-item d-flex align-items-center">
39 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
40 {{$department->name}}
41 <span class="small ml-auto">{{$department->folder->count()}}</span>
42 </a>
43 @endif
[c6b84df]44 @endforeach
45 <a href="{{ URL::current()."?sort=recent" }}" class="list-group-item">
46 <i data-feather="upload-cloud" class="width-15 height-15 mr-2"></i>
47 Recents
48 </a>
49 </div>
50 <div class="card-body">
51 <h6 class="mb-4">Storage Status</h6>
52 <div class="d-flex align-items-center">
53 <div class="mr-3">
54 <i data-feather="database" class="width-30 height-30"></i>
55 </div>
56 <div class="flex-grow-1">
57 <div class="progress" style="height: 10px">
58 <div class="progress-bar progress-bar-striped" role="progressbar"
59 style="width: {{$diskUse}}" aria-valuenow="10" aria-valuemin="0"
60 aria-valuemax="100"></div>
61 <span class="sr-only">{{$diskUse}}</span>
62 </div>
63 <div class="line-height-12 small text-muted mt-2">{{round($diskUsedSize,2)}} GB /
64 {{round($diskTotalSize,2)}} GB ({{$diskUse}})</div>
65 </div>
66 </div>
67 </div>
68 </div>
69 </div>
70 </div>
71 <div class="col-md-9 app-content">
72 <div class="app-content-overlay"></div>
73 <div class="app-action">
74 <div class="action-left">
75 <ul class="list-inline">
[0df7a93]76 @if(auth()->user()->hasPermission('manage_all_folders'))
[c6b84df]77 <li class="list-inline-item mb-0">
78 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">
79 <i data-feather="plus" class="mr-1"></i>
[0df7a93]80 Actions
[c6b84df]81 </a>
82 <div class="dropdown-menu">
83 <a class="dropdown-item" href="javascript:void(0)" data-toggle="modal" data-target="#createModal">Add folder</a>
[0df7a93]84 @endif
[0a1fb54]85 @if(auth()->user()->hasPermission('export_data') && Request::query('id')==null)
[0208bbd]86 <a href="{{ route('dashboard.folders.export') }}" class="dropdown-item text-success">Export</a>
[c6b84df]87 </div>
88 </li>
[0df7a93]89 @endif
[c6b84df]90 <li class="list-inline-item mb-0">
91 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">Departments</a>
92 <div class="dropdown-menu">
93 @foreach($departments as $department)
94 <a class="dropdown-item d-flex justify-content-between m-5" href="{{ route("dashboard.folders.index", ["id" => $department->id]) }}">
95 {{$department->name}}
96 <span class="text-muted">{{$department->folder->count()}}</span>
97 </a>
98 @endforeach
99 </div>
100 </li>
101 <li class="list-inline-item mb-0">
102 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">
103 Order by
104 </a>
105 <div class="dropdown-menu">
106 @if(Request::get('id'))
107 <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=newest" }}">Date</a>
108 <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=name" }}">Name</a>
[4b7e2d3]109 <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=no_of_files" }}">Number of files</a>
[c6b84df]110 @else
111 <a class="dropdown-item" href="{{ URL::current()."?sort=newest" }}">Date</a>
112 <a class="dropdown-item" href="{{ URL::current()."?sort=name" }}">Name</a>
[4b7e2d3]113 <a class="dropdown-item" href="{{ URL::current()."?sort=no_of_files" }}">Number of files</a>
[c6b84df]114 @endif
115 </div>
116 </li>
117 </ul>
118 </div>
119 <div class="action-right">
120 <form action="{{ route("dashboard.folders.index") }}" method="get" class="d-flex mr-3">
121 <div class="input-group">
122 <input type="text" name="search" class="form-control" placeholder="Search folder"
123 aria-describedby="button-addon1" required>
124 <div class="input-group-append">
125 <button class="btn btn-outline-light searchSubmitBtn" type="submit" value="Search">
126 <i data-feather="search"></i>
127 </button>
128 </div>
129 </div>
130 </form>
131 </div>
132 </div>
133 @if(!Request::query('id'))
134 <h4>Folders</h4><br/>
135 @else
136 <h4> {{ $deptName }} - {{$deptCode}} </h4>
137 <br/>
138 @endif
139
140 <div class="row">
141 @forelse($folders as $folder)
142 <div class="col-xl-4 col-lg-6">
[cbb901a]143 <div class="card">
[c6b84df]144 <div class="card-body">
[e78295c]145 <i class="fa fa-folder fa-2x pr-2" aria-hidden="true"></i>
146 <span class="card-title" style="font-size: 1.5rem;">{{$folder->name}}</span>
147
[c6b84df]148 <div class="d-flex align-items-center">
149 <div class="dropdown ml-auto">
150 <a href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
151 <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
152 </a>
153 <div class="dropdown-menu dropdown-menu-right">
[e78295c]154 <a href="{{ route("dashboard.folders.files", ["id" => $folder->id]) }}" class="dropdown-item">View files</a>
[4521f25]155 @if(auth()->user()->hasPermission('manage_all_files'))
156 <a href="javascript:void(0)" data-toggle="modal" data-target="#uploadFiles_{{$folder->id}}" class="dropdown-item">Upload files</a>
157 @endif
[0df7a93]158 @if(auth()->user()->hasPermission('download_data'))
[c6b84df]159 <a href="{{ route("dashboard.folders.downloadFolder", ['id' => $folder->id]) }}" class="dropdown-item">Download</a>
[0df7a93]160 @endif
[28bab7b]161 @if(auth()->user()->hasPermission('manage_all_folders'))
162 <a href="javascript:void(0)" data-toggle="modal" data-target="#createVersionModal_{{$folder->id}}" class="dropdown-item">Create version</a>
163 @endif
[190db9f]164 @if(auth()->user()->hasPermission('delete_data'))
[c6b84df]165 <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#deleteModal_{{$folder->id}}">Delete</a>
[0df7a93]166 @endif
[c6b84df]167 </div>
168 </div>
169 </div>
170 <div class="text-muted small mt-1 mb-3">Number of files: {{$folder->files->count()}}</div>
[e78295c]171 <p class="badge bg-success-bright text-success">Version: {{$folder->version}}</p>
172 <p>Archive ID: {{$folder->arch_id}}</p>
[0a1fb54]173 <p>Department: {{$folder->department->name}}</p>
[c6b84df]174 <p>Note: {{$folder->note}}</p>
175 <div class="row">
176 <div class="col">
177 <div class="text-muted mb-1 small">Created</div>
178 <div> {{ $folder->created_at->diffForHumans() }}, {{ date('d.m.Y', strtotime($folder->created_at))}}</div>
179 </div>
180 </div>
181 </div>
182 <div class="card-footer">
183 <small class="text-muted">Last updated: {{ date('d.m.Y H:i', strtotime($folder->updated_at)) }}</small>
184
185 </div>
186 </div>
187 </div>
188
[4b7e2d3]189 <div class="modal fade" id="deleteModal_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
[68b1a22]190 <div class="modal-dialog modal-dialog-centered" role="document">
[4b7e2d3]191 <div class="modal-content">
192 <div class="modal-header">
193 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
194 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
195 <i class="ti-close"></i>
196 </button>
197 </div>
198 <div class="modal-body">
199 <form action="{{ route("dashboard.folders.destroy", $folder->id) }}" method="POST">
200 @csrf
201 @method('DELETE')
202 <p>Are you sure you want to delete folder {{$folder->name}} with Archive ID: {{ $folder->arch_id }}?</p>
203 <div class="modal-footer">
204 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
205 </button>
206 <button type="submit" class="btn btn-primary">Save changes</button>
207 </div>
208 </form>
209 </div>
210 </div>
211 </div>
212 </div>
[4521f25]213
214 <div class="modal fade" id="uploadFiles_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
215 <div class="modal-dialog modal-dialog-centered" role="document">
216 <div class="modal-content">
217 <div class="modal-header">
[28bab7b]218 <h5 class="modal-title" id="exampleModalCenterTitle">Upload files to {{$folder->name}}</h5>
[4521f25]219 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
220 <i class="ti-close"></i>
221 </button>
222 </div>
223 <div class="modal-body">
224 <form action="{{ route("dashboard.files.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
225 @csrf
226 <div class="row">
227 <div class="col-md-10">
228 <div class="form-group">
229 <select class="form-control" name="folder" hidden>
230 <option value="{{ $folder->id }}" {{ (old("folder") == $folder->id ? "selected" : "") }}>{{ $folder->name }}</option>
231 </select>
232 </div>
233 </div>
234 <div class="col-md-10">
235 <div class="form-group">
236 <label for="exampleFormControlSelect1">Files</label>
237
238
239 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
240 </div>
241 </div>
242 </div>
243 <br/>
244 <div class="modal-footer">
245 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
246 </button>
247 <button type="submit" class="btn btn-primary">Save changes</button>
248 </div>
249 </form>
250 </div>
251
252 </div>
253 </div>
254 </div>
[28bab7b]255
256 <div class="modal fade" id="createVersionModal_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
257 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
258 <div class="modal-content">
259 <div class="modal-header">
[ec7b69d]260 <h5 class="modal-title" id="exampleModalCenterTitle">Create version</h5>
[28bab7b]261 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
262 <i class="ti-close"></i>
263 </button>
264 </div>
265 <div class="modal-body">
266 <form action="{{ route("dashboard.folders.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
267 @csrf
268 <div class="row">
269 <div class="col-md-6">
270 <div class="form-group">
271 <label for="exampleFormControlSelect1">Department</label>
[ec7b69d]272 <select class="form-control" name="department" disabled required>
[28bab7b]273 <option value="{{ $folder->department->id }}">{{ $folder->department->name }}</option>
274 </select>
275 </div>
276 </div>
277 <div class="col-md-6">
278 <div class="form-group">
279 <label>Archive ID</label>
[ec7b69d]280 <input type="text" name="arch_id" value="{{$folder->arch_id}}" class="form-control" placeholder="Archive ID" disabled>
[28bab7b]281 </div>
282 </div>
283 </div>
284 <div class="row">
285 <div class="col-md-6">
286 <div class="form-group">
287 <label>Name</label>
[ec7b69d]288 <input type="text" name="name" value="{{ $folder->name }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" disabled>
[28bab7b]289 </div>
290 </div>
291 <div class="col-md-6">
292 <div class="form-group">
293 <label>Note</label>
294 <textarea class="form-control" name="note" maxlength="80">{{ old('note') }}</textarea>
295 </div>
296 </div>
297 </div>
298 <div class="row">
299 <div class="col-md-6">
300 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
301 </div>
302 </div>
303 <br/>
304 <div class="modal-footer">
305 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
306 </button>
307 <button type="submit" class="btn btn-primary">Save changes</button>
308 </div>
309 </form>
310 </div>
311
312 </div>
313 </div>
314 </div>
315
[4b7e2d3]316 @empty
317 <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>
318 @endforelse
319
[c6b84df]320 <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-hidden="true">
321 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
322 <div class="modal-content">
323 <div class="modal-header">
324 <h5 class="modal-title" id="exampleModalCenterTitle">Create folder</h5>
325 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
326 <i class="ti-close"></i>
327 </button>
328 </div>
329 <div class="modal-body">
330 <form action="{{ route("dashboard.folders.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
331 @csrf
332 <div class="row">
333 <div class="col-md-6">
334 <div class="form-group">
335 <label for="exampleFormControlSelect1">Department</label>
336 @if($departments->count())
337 <select class="form-control new_folder_deparment" name="department" required>
338 @foreach ($departments as $department)
339 <option value="{{ $department->id }}" data-dept-code="{{ $department->code }}" {{ (old("department") == $department->id ? "selected" : "") }}>{{ $department->name }}</option>
340 @endforeach
341 @else
342 <p>You haven't created any departments yet. <a class="text-primary" href="{{ route("dashboard.departments.create") }}">Create now.</a></p>
343 @endif
344 </select>
345 </div>
346 </div>
347 <div class="col-md-6">
348 <div class="form-group">
349 <label>Archive ID</label>
350 <input type="text" name="arch_id" value="" class="form-control" placeholder="Archive ID" required>
351 </div>
352 </div>
353 </div>
354 <div class="row">
355 <div class="col-md-6">
356 <div class="form-group">
357 <label>Name</label>
358 <input type="text" name="name" value="{{ old('name') }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
359 </div>
360 </div>
361 <div class="col-md-6">
362 <div class="form-group">
363 <label>Note</label>
364 <textarea class="form-control" name="note" maxlength="80">{{ old('note') }}</textarea>
365 </div>
366 </div>
367 </div>
368 <div class="row">
369 <div class="col-md-6">
370 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
371 </div>
372 </div>
373 <br/>
374 <div class="modal-footer">
375 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
376 </button>
377 <button type="submit" class="btn btn-primary">Save changes</button>
378 </div>
379 </form>
380 </div>
381
382 </div>
383 </div>
384 </div>
385
386 </div>
387 @if(!Request::query('search'))
388 {{$folders->appends($_GET)->links('layouts.pagination') }}
389 @endif
390 </div>
391
392 @endsection
393
394 @section('script')
395
396 @yield('script')
397
398@endsection
Note: See TracBrowser for help on using the repository browser.