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_files'))
|
---|
12 | <a href="javascript:void(0)" class="btn btn-secondary btn-block file-upload-btn text-white" data-toggle="modal" data-target="#uploadFiles_{{$folder->id}}">
|
---|
13 | Upload files
|
---|
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 | @if($obj == $folder)
|
---|
25 | <a href="{{ route("dashboard.folders.files", ["id" => $folder->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 | {{$folder->name}}
|
---|
28 | <span class="small ml-auto">{{$folder->files->count()}}</span>
|
---|
29 | </a>
|
---|
30 | @else
|
---|
31 | <a href="{{ route("dashboard.folders.files", ["id" => $obj->id]) }}" class="list-group-item d-flex align-items-center">
|
---|
32 | <i data-feather="folder" class="width-15 height-15 mr-2"></i>
|
---|
33 | {{$obj->name}}
|
---|
34 | <span class="small ml-auto">{{$obj->files->count()}}</span>
|
---|
35 | </a>
|
---|
36 | @endif
|
---|
37 | @endforeach
|
---|
38 | </div>
|
---|
39 | </div>
|
---|
40 | </div>
|
---|
41 | </div>
|
---|
42 | <div class="col-md-9 app-content">
|
---|
43 | <div class="app-content-overlay"></div>
|
---|
44 | <div class="app-action">
|
---|
45 | <div class="action-left">
|
---|
46 | <ul class="list-inline">
|
---|
47 | <li class="list-inline-item mb-0">
|
---|
48 | @if(auth()->user()->hasPermission('download_data'))
|
---|
49 | <a href="{{ route("dashboard.folders.downloadFolder", ['id' => $folder->id]) }}" class="btn btn-outline-light">
|
---|
50 | Download folder
|
---|
51 | </a>
|
---|
52 | @endif
|
---|
53 | </li>
|
---|
54 | </ul>
|
---|
55 | </div>
|
---|
56 | <div class="action-right">
|
---|
57 | <form action="{{ route("dashboard.folders.files", $folder->id) }}" method="get" class="d-flex mr-3">
|
---|
58 | <div class="input-group">
|
---|
59 | <input type="text" name="search" class="form-control" placeholder="Search files"
|
---|
60 | aria-describedby="button-addon1" required>
|
---|
61 | <div class="input-group-append">
|
---|
62 | <button class="btn btn-outline-light searchSubmitBtn" type="submit" value="Search">
|
---|
63 | <i data-feather="search"></i>
|
---|
64 | </button>
|
---|
65 | </div>
|
---|
66 | </div>
|
---|
67 | </form>
|
---|
68 | </div>
|
---|
69 | </div>
|
---|
70 |
|
---|
71 | <p>Files in {{$folder->name}}</p>
|
---|
72 |
|
---|
73 | <div class="row">
|
---|
74 | @forelse($files as $file)
|
---|
75 | <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">
|
---|
76 | <div class="card app-file-list">
|
---|
77 | <div class="app-file-icon">
|
---|
78 | @if(in_array(explode('.', $file->name)[1], $excelExt))
|
---|
79 | <i class="fa fa-file-excel-o text-success"></i>
|
---|
80 | @else @if(in_array(explode('.', $file->name)[1], $textExt))
|
---|
81 | <i class="fa fa-file-word-o text-info"></i>
|
---|
82 | @else @if(explode('.', $file->name)[1] == 'pdf')
|
---|
83 | <i class="fa fa-file-pdf-o text-danger"></i>
|
---|
84 | @else @if(in_array(explode('.', $file->name)[1], $imageExt))
|
---|
85 | {{-- <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">--}}
|
---|
86 | {{-- <a href="{{ url('/storage/' . $file->location) }}" class="image-popup-gallery-item">--}}
|
---|
87 | {{-- <div class="image-hover">--}}
|
---|
88 | {{-- <img src="{{ url('/storage/' . $file->location) }}" class="rounded" width="100" alt="image">--}}
|
---|
89 | {{-- </div>--}}
|
---|
90 | {{-- </a>--}}
|
---|
91 | {{-- </div>--}}
|
---|
92 | <i class="fa fa-file-image-o text-danger"></i>
|
---|
93 | @else
|
---|
94 | <i class="fa fa-file-text-o text-warning"></i>
|
---|
95 | @endif
|
---|
96 | @endif
|
---|
97 | @endif
|
---|
98 | @endif
|
---|
99 | <div class="dropdown position-absolute top-0 right-0 mr-3">
|
---|
100 | <a href="#" class="btn btn-outline-light btn-sm" data-toggle="dropdown">
|
---|
101 | <i class="fa fa-ellipsis-h"></i>
|
---|
102 | </a>
|
---|
103 | <div class="dropdown-menu dropdown-menu-right">
|
---|
104 | @if(auth()->user()->hasPermission('download_data'))
|
---|
105 | <a href="{{ route("dashboard.files.downloadFile", $file->id) }}" class="dropdown-item">
|
---|
106 | Download
|
---|
107 | </a>
|
---|
108 | @endif
|
---|
109 | @if(auth()->user()->hasPermission('delete_data'))
|
---|
110 | <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#deleteModal_{{$file->id}}">
|
---|
111 | Delete
|
---|
112 | </a>
|
---|
113 | @endif
|
---|
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 | @empty
|
---|
150 | <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>
|
---|
151 | @endforelse
|
---|
152 |
|
---|
153 | </div>
|
---|
154 |
|
---|
155 | @if(!Request::query('search'))
|
---|
156 | {{$files->appends($_GET)->links('layouts.pagination') }}
|
---|
157 | @endif
|
---|
158 |
|
---|
159 | </div>
|
---|
160 | <div class="modal fade" id="uploadFiles_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
|
---|
161 | <div class="modal-dialog modal-dialog-centered" role="document">
|
---|
162 | <div class="modal-content">
|
---|
163 | <div class="modal-header">
|
---|
164 | <h5 class="modal-title" id="exampleModalCenterTitle">Upload</h5>
|
---|
165 | <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
---|
166 | <i class="ti-close"></i>
|
---|
167 | </button>
|
---|
168 | </div>
|
---|
169 | <div class="modal-body">
|
---|
170 | <form action="{{ route("dashboard.files.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
|
---|
171 | @csrf
|
---|
172 | <div class="row">
|
---|
173 | <div class="col-md-10">
|
---|
174 | <div class="form-group">
|
---|
175 | <select class="form-control" name="folder" hidden>
|
---|
176 | <option value="{{ $folder->id }}" {{ (old("folder") == $folder->id ? "selected" : "") }}>{{ $folder->name }}</option>
|
---|
177 | </select>
|
---|
178 | </div>
|
---|
179 | </div>
|
---|
180 | <div class="col-md-10">
|
---|
181 | <div class="form-group">
|
---|
182 | <label for="exampleFormControlSelect1">Files</label>
|
---|
183 |
|
---|
184 |
|
---|
185 | <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
|
---|
186 | </div>
|
---|
187 | </div>
|
---|
188 | </div>
|
---|
189 | <br/>
|
---|
190 | <div class="modal-footer">
|
---|
191 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
|
---|
192 | </button>
|
---|
193 | <button type="submit" class="btn btn-primary">Save changes</button>
|
---|
194 | </div>
|
---|
195 | </form>
|
---|
196 | </div>
|
---|
197 |
|
---|
198 | </div>
|
---|
199 | </div>
|
---|
200 | </div>
|
---|
201 | </div>
|
---|
202 |
|
---|
203 | @endsection
|
---|
204 |
|
---|
205 | @yield('script')
|
---|
206 |
|
---|
207 |
|
---|