source: resources/views/dashboard/folders/files.blade.php@ df6e9ec

develop
Last change on this file since df6e9ec was 94f05dc, checked in by beratkjufliju <kufliju@…>, 3 years ago

bug fixes

  • Property mode set to 100644
File size: 22.0 KB
Line 
1@extends('layouts.app')
2
3@section("title", "SaveSpace - Folder")
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 class="btn btn-secondary btn-block text-white" href="javascript:void(0)" data-target="#createModal{{$folder->id}}" data-toggle="modal">
13 Edit 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($folders as $obj)
24 <a href="{{ route("dashboard.folders.files", ["id" => $obj->id]) }}" class="list-group-item d-flex align-items-center">
25 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
26 {{$obj->name}}
27 <span class="small ml-auto">{{$obj->files->count()}}</span>
28 </a>
29 @endforeach
30 </div>
31 </div>
32 </div>
33 </div>
34 <div class="col-md-9 app-content">
35 <div class="app-content-overlay"></div>
36 <div class="app-action">
37 <div class="action-left">
38 <ul class="list-inline">
39 @if(auth()->user()->hasPermission('manage_all_folders'))
40 <li class="list-inline-item mb-0">
41 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">
42 Actions
43 </a>
44 <div class="dropdown-menu">
45 <a class="dropdown-item" href="javascript:void(0)" data-toggle="modal" data-target="#editModal_{{$folder->id}}">
46 Edit folder
47 </a>
48 </div>
49 </li>
50 @endif
51 <li class="list-inline-item mb-0">
52 @if(auth()->user()->hasPermission('download_data'))
53 <a href="{{ route("dashboard.folders.downloadFolder", ['id' => $folder->id]) }}" class="btn btn-outline-light">
54 Download folder
55 </a>
56 @endif
57 </li>
58 </ul>
59 </div>
60 <div class="action-right">
61 <form action="{{ route("dashboard.folders.files", $folder->id) }}" method="get" class="d-flex mr-3">
62 <div class="input-group">
63 <input type="text" name="search" class="form-control" placeholder="Search files"
64 aria-describedby="button-addon1" required>
65 <div class="input-group-append">
66 <button class="btn btn-outline-light searchSubmitBtn" type="submit" value="Search">
67 <i data-feather="search"></i>
68 </button>
69 </div>
70 </div>
71 </form>
72 </div>
73 </div>
74
75 <p>Files</p>
76
77 <div class="row">
78 @forelse($files as $file)
79 <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">
80 <div class="card app-file-list">
81 <div class="app-file-icon">
82 @if(in_array(explode('.', $file->name)[1], $excelExt))
83 <i class="fa fa-file-excel-o text-success"></i>
84 @else @if(in_array(explode('.', $file->name)[1], $textExt))
85 <i class="fa fa-file-word-o text-info"></i>
86 @else @if(explode('.', $file->name)[1] == 'pdf')
87 <i class="fa fa-file-pdf-o text-danger"></i>
88 @else @if(in_array(explode('.', $file->name)[1], $imageExt))
89 <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
90 <a href="{{ url('/storage/' . $file->location) }}" class="image-popup-gallery-item">
91 <div class="image-hover">
92 <img src="{{ url('/storage/' . $file->location) }}" class="rounded" width="100" alt="image">
93 </div>
94 </a>
95 </div>
96 @else
97 <i class="fa fa-file-text-o text-warning"></i>
98 @endif
99 @endif
100 @endif
101 @endif
102 <div class="dropdown position-absolute top-0 right-0 mr-3">
103 <a href="#" class="btn btn-outline-light btn-sm" data-toggle="dropdown">
104 <i class="fa fa-ellipsis-h"></i>
105 </a>
106 <div class="dropdown-menu dropdown-menu-right">
107 @if(auth()->user()->hasPermission('manage_all_files'))
108 <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#editFileModal_{{$file->id}}">
109 Rename
110 </a>
111 @endif
112 @if(auth()->user()->hasPermission('download_data'))
113 <a href="{{ route("dashboard.files.downloadFile", $file->id) }}" class="dropdown-item">
114 Download
115 </a>
116 @endif
117 @if(auth()->user()->hasPermission('manage_all_files'))
118 <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#deleteModal_{{$file->id}}">
119 Delete
120 </a>
121 @endif
122 </div>
123 </div>
124 </div>
125 <div class="p-2 small">
126 <div>{{$file->name}}</div>
127 <div class="text-muted">{{ $file->getSize($file->location) }} MB</div>
128 </div>
129 </div>
130 </div>
131 <div class="modal fade" id="deleteModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
132 <div class="modal-dialog modal-dialog-centered" role="document">
133 <div class="modal-content">
134 <div class="modal-header">
135 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
136 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
137 <i class="ti-close"></i>
138 </button>
139 </div>
140 <div class="modal-body">
141 <form action="{{ route("dashboard.files.deleteFile", $file->id) }}" method="POST">
142 @csrf
143 @method('DELETE')
144 <p>Are you sure you want to delete file {{$file->name}}?</p>
145 <div class="modal-footer">
146 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
147 </button>
148 <button type="submit" class="btn btn-primary">Save changes</button>
149 </div>
150 </form>
151 </div>
152
153 </div>
154 </div>
155 </div>
156
157 <div class="modal fade" id="editFileModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
158 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
159 <div class="modal-content">
160 <div class="modal-header">
161 <h5 class="modal-title" id="exampleModalCenterTitle">Edit file name</h5>
162 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
163 <i class="ti-close"></i>
164 </button>
165 </div>
166 <div class="modal-body">
167 <form action="{{ route("dashboard.files.renameFile", ["id" =>$file->id]) }}" method="post" accept-charset="utf-8">
168 @method("patch")
169 @csrf
170 <div class="row">
171 <div class="col-md-12">
172 <div class="form-group">
173 <label class="form-label">Current name: {{$file->name}}</label>
174 <input type="text" name="name" value="{{ explode('.', $file->name)[0] }}" maxlength="255" title="Don't include: '\/.|'" pattern="^[^.\/|]+$" class="form-control" required>
175 </div>
176 </div>
177 </div>
178 <br/>
179 <div class="modal-footer">
180 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
181 </button>
182 <button type="submit" class="btn btn-primary">Save changes</button>
183 </div>
184 </form>
185 </div>
186 </div>
187 </div>
188 </div>
189 @empty
190 <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>
191 @endforelse
192
193 <div class="modal fade" id="editModal_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
194 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
195 <div class="modal-content">
196 <div class="modal-header">
197 <h5 class="modal-title" id="exampleModalCenterTitle">Edit folder</h5>
198 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
199 <i class="ti-close"></i>
200 </button>
201 </div>
202 <div class="modal-body">
203 <form action="{{ route("dashboard.folders.edit", ["id" => $folder->id]) }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
204 @method("patch")
205 @csrf
206 <div class="row">
207 <div class="col-md-6">
208 <div class="form-group">
209 <label>Department</label>
210 <select class="form-control edit_folder_deparment" name="department" required>
211 @foreach ($departments as $department)
212 <option value="{{ $department->id }}" data-dept-code="{{ $department->code }}" {{ old("department", $folder->department->id) == $department->id ? "selected" : "" }}>{{ $department->name }}</option>
213 @endforeach
214 </select>
215 </div>
216 </div>
217 <div class="col-md-6">
218 <div class="form-group">
219 <label>Archive ID</label>
220 <input type="text" name="arch_id" value="{{ old("arch_id", $folder->arch_id) }}" class="form-control" placeholder="Archive ID" required>
221 </div>
222 </div>
223 </div>
224 <div class="row">
225 <div class="col-md-6">
226 <div class="form-group">
227 <label>Name</label>
228 <input type="text" name="name" value="{{ old("name", $folder->name) }}" class="form-control" placeholder="Name" minlength="2" maxlength="30" required>
229 </div>
230 </div>
231 <div class="col-md-6">
232 <div class="form-group">
233 <label>Note</label>
234 <textarea class="form-control" name="note" maxlength="80">
235 {{ old("note", $folder->note) }}
236 </textarea>
237 </div>
238 </div>
239 </div>
240 <div class="row">
241 <div class="col-md-6">
242 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
243 </div>
244 </div>
245 <br/>
246 <div class="modal-footer">
247 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
248 </button>
249 <button type="submit" class="btn btn-primary">Save changes</button>
250 </div>
251 </form>
252 </div>
253
254 </div>
255 </div>
256 </div>
257
258 <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-hidden="true">
259 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
260 <div class="modal-content">
261 <div class="modal-header">
262 <h5 class="modal-title" id="exampleModalCenterTitle">Create folder</h5>
263 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
264 <i class="ti-close"></i>
265 </button>
266 </div>
267 <div class="modal-body">
268 <form action="{{ route("dashboard.folders.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
269 @csrf
270 <div class="row">
271 <div class="col-md-6">
272 <div class="form-group">
273 <label for="exampleFormControlSelect1">Department</label>
274 @if($departments->count())
275 <select class="form-control new_folder_deparment" name="department" required>
276 @foreach ($departments as $department)
277 <option value="{{ $department->id }}" data-dept-code="{{ $department->code }}" {{ (old("department") == $department->id ? "selected" : "") }}>{{ $department->name }}</option>
278 @endforeach
279 @else
280 <p>You haven't created any departments yet. <a class="text-primary" href="{{ route("dashboard.departments.create") }}">Create now.</a></p>
281 @endif
282 </select>
283 </div>
284 </div>
285 <div class="col-md-6">
286 <div class="form-group">
287 <label>Archive ID</label>
288 <input type="text" name="arch_id" value="" class="form-control" placeholder="Archive ID" required>
289 </div>
290 </div>
291 </div>
292 <div class="row">
293 <div class="col-md-6">
294 <div class="form-group">
295 <label>Name</label>
296 <input type="text" name="name" value="{{ old("name") }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
297 </div>
298 </div>
299 <div class="col-md-6">
300 <div class="form-group">
301 <label>Note</label>
302 <textarea class="form-control" name="note" maxlength="80"> {{old("note")}} </textarea>
303 </div>
304 </div>
305 </div>
306 <div class="row">
307 <div class="col-md-6">
308 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
309 </div>
310 <div class="col-md-6">
311 <div class="form-group">
312 <div class="form-check">
313 <input class="form-check-input" type="checkbox" value="{{old("is_important")}}" id="is_important" name="is_important">
314 <label class="form-check-label">
315 Mark as important
316 </label>
317 </div>
318 </div>
319 </div>
320 </div>
321 <br/>
322 <div class="modal-footer">
323 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
324 </button>
325 <button type="submit" class="btn btn-primary">Save changes</button>
326 </div>
327 </form>
328 </div>
329
330 </div>
331 </div>
332 </div>
333 </div>
334
335 @if(!Request::query('search'))
336 {{$files->appends($_GET)->links('layouts.pagination') }}
337 @endif
338
339 </div>
340
341 </div>
342
343@endsection
344
345@yield('script')
346
347
Note: See TracBrowser for help on using the repository browser.