source: resources/views/dashboard/folders/index.blade.php@ 28bab7b

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

added create version

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