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

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

added fileTypes controller, notifications, excel export, edited views

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