source: resources/views/dashboard/folders/index.blade.php@ 1f7c934

Last change on this file since 1f7c934 was e3af09e, checked in by beratkjufliju <kufliju@…>, 3 years ago

bug fixes

  • Property mode set to 100644
File size: 25.6 KB
Line 
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">
11 @if(auth()->user()->hasPermission('manage_all_folders'))
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>
15 @endif
16 </div>
17 <div class="app-sidebar-menu">
18 <div class="list-group list-group-flush">
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;">
21 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
22 Folders
23 </a>
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
30 @foreach($departments as $department)
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;">
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>
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
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">
76 @if(auth()->user()->hasPermission('manage_all_folders'))
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>
80 Actions
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>
84 @endif
85 @if(auth()->user()->hasPermission('export_data'))
86 <a href="{{ route('dashboard.folders.export') }}" class="dropdown-item text-success">Export</a>
87 </div>
88 </li>
89 @endif
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>
109 <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=no_of_files" }}">Number of files</a>
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>
113 <a class="dropdown-item" href="{{ URL::current()."?sort=no_of_files" }}">Number of files</a>
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">
143 <div class="card">
144 <div class="card-body">
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
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">
154 <a href="{{ route("dashboard.folders.files", ["id" => $folder->id]) }}" class="dropdown-item">View files</a>
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
158 @if(auth()->user()->hasPermission('download_data'))
159 <a href="{{ route("dashboard.folders.downloadFolder", ['id' => $folder->id]) }}" class="dropdown-item">Download</a>
160 @endif
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
164 @if(auth()->user()->hasPermission('delete_data'))
165 <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#deleteModal_{{$folder->id}}">Delete</a>
166 @endif
167 </div>
168 </div>
169 </div>
170 <div class="text-muted small mt-1 mb-3">Number of files: {{$folder->files->count()}}</div>
171 <p class="badge bg-success-bright text-success">Version: {{$folder->version}}</p>
172 <p>Archive ID: {{$folder->arch_id}}</p>
173 <p>Note: {{$folder->note}}</p>
174 <div class="row">
175 <div class="col">
176 <div class="text-muted mb-1 small">Created</div>
177 <div> {{ $folder->created_at->diffForHumans() }}, {{ date('d.m.Y', strtotime($folder->created_at))}}</div>
178 </div>
179 </div>
180 </div>
181 <div class="card-footer">
182 <small class="text-muted">Last updated: {{ date('d.m.Y H:i', strtotime($folder->updated_at)) }}</small>
183
184 </div>
185 </div>
186 </div>
187
188 <div class="modal fade" id="deleteModal_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
189 <div class="modal-dialog modal-dialog-centered" role="document">
190 <div class="modal-content">
191 <div class="modal-header">
192 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
193 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
194 <i class="ti-close"></i>
195 </button>
196 </div>
197 <div class="modal-body">
198 <form action="{{ route("dashboard.folders.destroy", $folder->id) }}" method="POST">
199 @csrf
200 @method('DELETE')
201 <p>Are you sure you want to delete folder {{$folder->name}} with Archive ID: {{ $folder->arch_id }}?</p>
202 <div class="modal-footer">
203 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
204 </button>
205 <button type="submit" class="btn btn-primary">Save changes</button>
206 </div>
207 </form>
208 </div>
209 </div>
210 </div>
211 </div>
212
213 <div class="modal fade" id="uploadFiles_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
214 <div class="modal-dialog modal-dialog-centered" role="document">
215 <div class="modal-content">
216 <div class="modal-header">
217 <h5 class="modal-title" id="exampleModalCenterTitle">Upload files to {{$folder->name}}</h5>
218 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
219 <i class="ti-close"></i>
220 </button>
221 </div>
222 <div class="modal-body">
223 <form action="{{ route("dashboard.files.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
224 @csrf
225 <div class="row">
226 <div class="col-md-10">
227 <div class="form-group">
228 <select class="form-control" name="folder" hidden>
229 <option value="{{ $folder->id }}" {{ (old("folder") == $folder->id ? "selected" : "") }}>{{ $folder->name }}</option>
230 </select>
231 </div>
232 </div>
233 <div class="col-md-10">
234 <div class="form-group">
235 <label for="exampleFormControlSelect1">Files</label>
236
237
238 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
239 </div>
240 </div>
241 </div>
242 <br/>
243 <div class="modal-footer">
244 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
245 </button>
246 <button type="submit" class="btn btn-primary">Save changes</button>
247 </div>
248 </form>
249 </div>
250
251 </div>
252 </div>
253 </div>
254
255 <div class="modal fade" id="createVersionModal_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
256 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
257 <div class="modal-content">
258 <div class="modal-header">
259 <h5 class="modal-title" id="exampleModalCenterTitle">Create folder</h5>
260 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
261 <i class="ti-close"></i>
262 </button>
263 </div>
264 <div class="modal-body">
265 <form action="{{ route("dashboard.folders.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
266 @csrf
267 <div class="row">
268 <div class="col-md-6">
269 <div class="form-group">
270 <label for="exampleFormControlSelect1">Department</label>
271 <select class="form-control" name="department" required>
272 <option value="{{ $folder->department->id }}">{{ $folder->department->name }}</option>
273 </select>
274 </div>
275 </div>
276 <div class="col-md-6">
277 <div class="form-group">
278 <label>Archive ID</label>
279 <input type="text" name="arch_id" value="{{$folder->arch_id}}" class="form-control" placeholder="Archive ID" required>
280 </div>
281 </div>
282 </div>
283 <div class="row">
284 <div class="col-md-6">
285 <div class="form-group">
286 <label>Name</label>
287 <input type="text" name="name" value="{{ $folder->name }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
288 </div>
289 </div>
290 <div class="col-md-6">
291 <div class="form-group">
292 <label>Note</label>
293 <textarea class="form-control" name="note" maxlength="80">{{ old('note') }}</textarea>
294 </div>
295 </div>
296 </div>
297 <div class="row">
298 <div class="col-md-6">
299 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
300 </div>
301 </div>
302 <br/>
303 <div class="modal-footer">
304 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
305 </button>
306 <button type="submit" class="btn btn-primary">Save changes</button>
307 </div>
308 </form>
309 </div>
310
311 </div>
312 </div>
313 </div>
314
315 @empty
316 <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>
317 @endforelse
318
319 <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-hidden="true">
320 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
321 <div class="modal-content">
322 <div class="modal-header">
323 <h5 class="modal-title" id="exampleModalCenterTitle">Create folder</h5>
324 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
325 <i class="ti-close"></i>
326 </button>
327 </div>
328 <div class="modal-body">
329 <form action="{{ route("dashboard.folders.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
330 @csrf
331 <div class="row">
332 <div class="col-md-6">
333 <div class="form-group">
334 <label for="exampleFormControlSelect1">Department</label>
335 @if($departments->count())
336 <select class="form-control new_folder_deparment" name="department" required>
337 @foreach ($departments as $department)
338 <option value="{{ $department->id }}" data-dept-code="{{ $department->code }}" {{ (old("department") == $department->id ? "selected" : "") }}>{{ $department->name }}</option>
339 @endforeach
340 @else
341 <p>You haven't created any departments yet. <a class="text-primary" href="{{ route("dashboard.departments.create") }}">Create now.</a></p>
342 @endif
343 </select>
344 </div>
345 </div>
346 <div class="col-md-6">
347 <div class="form-group">
348 <label>Archive ID</label>
349 <input type="text" name="arch_id" value="" class="form-control" placeholder="Archive ID" required>
350 </div>
351 </div>
352 </div>
353 <div class="row">
354 <div class="col-md-6">
355 <div class="form-group">
356 <label>Name</label>
357 <input type="text" name="name" value="{{ old('name') }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
358 </div>
359 </div>
360 <div class="col-md-6">
361 <div class="form-group">
362 <label>Note</label>
363 <textarea class="form-control" name="note" maxlength="80">{{ old('note') }}</textarea>
364 </div>
365 </div>
366 </div>
367 <div class="row">
368 <div class="col-md-6">
369 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
370 </div>
371 </div>
372 <br/>
373 <div class="modal-footer">
374 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
375 </button>
376 <button type="submit" class="btn btn-primary">Save changes</button>
377 </div>
378 </form>
379 </div>
380
381 </div>
382 </div>
383 </div>
384
385 </div>
386 @if(!Request::query('search'))
387 {{$folders->appends($_GET)->links('layouts.pagination') }}
388 @endif
389 </div>
390
391 @endsection
392
393 @section('script')
394
395 @yield('script')
396
397@endsection
Note: See TracBrowser for help on using the repository browser.