source: resources/views/dashboard/files/index.blade.php@ ff5b46e

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

bug fixes

  • Property mode set to 100644
File size: 16.4 KB
Line 
1@extends('layouts.app')
2
3@section("title", "SaveSpace - Files")
4
5@section('head')
6
7@endsection
8
9@section('content')
10
11 <div class="page-header justify-content-between">
12 <nav aria-label="breadcrumb" class="d-flex align-items-start">
13 <ol class="breadcrumb">
14 <li class="breadcrumb-item">
15 <a href="{{ url('/') }}">Dashboard</a>
16 </li>
17 <li class="breadcrumb-item active" aria-current="page">Files</li>
18 </ol>
19 </nav>
20 <div class="dropdown">
21 @if(auth()->user()->hasPermission('manage_all_files'))
22 <a href="javascript:void(0)" data-toggle="modal" data-target="#createModal" class="btn btn-primary text-white">
23 <i class="fa fa-upload pr-1"></i> Upload
24 </a>
25 @endif
26 @if(auth()->user()->hasPermission('download_data'))
27 <a href="{{ route("dashboard.departments.downloadAll") }}" class="btn btn-danger text-white">
28 <i class="fa fa-download pr-1"></i> Download
29 </a>
30 @endif
31 @if(auth()->user()->hasPermission('export_data'))
32 <a href="{{ route('dashboard.files.export') }}" class="btn btn-success text-white">
33 <i class="fa fa-table pr-1"></i> Export
34 </a>
35 @endif
36 </div>
37 </div>
38
39 <div class="row">
40 <div class="col-md-12">
41 <div class="card">
42 <div class="card-body">
43 <div class="table-responsive">
44 <table id="user-list" class="table table-lg">
45 <thead>
46 <tr>
47 <th>
48 </th>
49 <th>Image</th>
50 <th>Name</th>
51 <th>Created at</th>
52 <th>Updated at</th>
53 <th>Folder name</th>
54 <th>Folder archive ID</th>
55 <th>Directory</th>
56 <th>Actions</th>
57 </tr>
58 </thead>
59 <tbody>
60 @foreach($files as $file)
61 <tr>
62 <td></td>
63 <td>
64 @if(in_array(explode('.', $file->name)[1], $excelExt))
65 <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
66 <i class="fa fa-file-excel-o text-success fa-2x"></i>
67 </div>
68 @else @if(in_array(explode('.', $file->name)[1], $textExt))
69 <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
70 <i class="fa fa-file-word-o text-info fa-2x"></i>
71 </div>
72 @else @if(explode('.', $file->name)[1] == 'pdf')
73 <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
74 <i class="fa fa-file-pdf-o text-danger fa-2x"></i>
75 </div>
76 @else @if(in_array(explode('.', $file->name)[1], $imageExt))
77{{-- <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">--}}
78{{-- <a href="{{ url('/storage/' . $file->location) }}" class="image-popup-gallery-item">--}}
79{{-- <div class="image-hover">--}}
80{{-- <img src="{{ url('/storage/' . $file->location) }}" class="rounded" width="30" alt="image">--}}
81{{-- </div>--}}
82{{-- </a>--}}
83{{-- </div>--}}
84 <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
85 <i class="fa fa-file-image-o text-danger fa-2x"></i>
86 </div>
87 @else
88 <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
89 <i class="fa fa-file-text-o text-warning fa-2x"></i>
90 </div>
91 @endif
92 @endif
93 @endif
94 @endif
95
96
97 </td>
98 <td>{{ $file->name }}</td>
99 <td>{{ date('d.m.Y - H:i', strtotime($file->created_at)) }}</td>
100 @if($file->updated_at==NULL)
101 <td>/</td>
102 @else
103 <td>{{ date('d.m.Y - H:i', strtotime($file->updated_at)) }}</td>
104 @endif
105 <td><a href="{{ route('dashboard.folders.files', ['id' => $file->folder_id]) }}" class="text-linkedin">{{ \App\Models\Folder::find($file->folder_id)->name }}</a></td>
106 <td>{{ \App\Models\Folder::find($file->folder_id)->arch_id }}</td>
107 <!-- Trigger -->
108 <td><button data-clipboard-text="{{$file->location}}" class="btn btn-sm btn-primary text-white" data-toggle="tooltip" data-placement="right" title="{{$file->location}}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16">
109 <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/>
110 <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"/>
111 </svg></button>
112 </td>
113 @if(auth()->user()->hasPermission('manage_all_files'))
114 <td>
115 <a href="javascript:void(0)" class="text-secondary" data-toggle="modal" data-target="#editModal_{{$file->id}}" title="Edit">
116 <i class="ti-pencil"></i>
117 </a>
118 <a href="{{ route("dashboard.files.downloadFile", ['id' => $file->id]) }}" class="text-danger ml-2"title="Download">
119 <i class="ti-download"></i>
120 </a>
121 <a href="javascript:void(0)" class="text-danger ml-2" data-toggle="modal" data-target="#deleteModal_{{$file->id}}" title="Delete">
122 <i class="ti-trash"></i>
123 </a>
124 </td>
125 @else
126 <td></td>
127 @endif
128 </tr>
129 <div class="modal fade" id="deleteModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
130 <div class="modal-dialog modal-dialog-centered" role="document">
131 <div class="modal-content">
132 <div class="modal-header">
133 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
134 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
135 <i class="ti-close"></i>
136 </button>
137 </div>
138 <div class="modal-body">
139 <form action="{{ route("dashboard.files.deleteFile", $file->id) }}" method="POST">
140 @csrf
141 @method('DELETE')
142 <p>Are you sure you want to delete file {{$file->name}}?</p>
143 <p>Location: <span class="pr-1">{{$file->location}}</span></p>
144 <div class="modal-footer">
145 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
146 </button>
147 <button type="submit" class="btn btn-primary">Save changes</button>
148 </div>
149 </form>
150 </div>
151
152 </div>
153 </div>
154 </div>
155
156 <div class="modal fade" id="editModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
157 <div class="modal-dialog modal-dialog-centered" role="document">
158 <div class="modal-content">
159 <div class="modal-header">
160 <h5 class="modal-title" id="exampleModalCenterTitle">Rename file</h5>
161 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
162 <i class="ti-close"></i>
163 </button>
164 </div>
165 <div class="modal-body">
166 <form action="{{ route("dashboard.files.renameFile", ["id" =>$file->id]) }}" method="post" accept-charset="utf-8">
167 @method("patch")
168 @csrf
169 <div class="row">
170 <div class="col-md-12">
171 <div class="form-group">
172 <label class="form-label">Current name: {{$file->name}}</label>
173 <input type="text" name="name" value="{{ explode('.', $file->name)[0] }}" maxlength="255" title="Don't include: '\/.|'" pattern="^[^.\/|]+$" class="form-control" required>
174 </div>
175 </div>
176 </div>
177 <br/>
178 <div class="modal-footer">
179 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
180 </button>
181 <button type="submit" class="btn btn-primary">Save changes</button>
182 </div>
183 </form>
184 </div>
185
186 </div>
187 </div>
188 </div>
189 @endforeach
190
191 </tbody>
192 </table>
193
194 <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-hidden="true">
195 <div class="modal-dialog modal-dialog-centered" role="document">
196 <div class="modal-content">
197 <div class="modal-header">
198 <h5 class="modal-title" id="exampleModalCenterTitle">Upload</h5>
199 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
200 <i class="ti-close"></i>
201 </button>
202 </div>
203 <div class="modal-body">
204 <form action="{{ route("dashboard.files.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
205 @csrf
206 <div class="row">
207 <div class="col-md-10">
208 <div class="form-group">
209 <label for="exampleFormControlSelect1">Folder</label>
210 @if($folders->count())
211 <select class="form-control" name="folder" required>
212 @foreach ($folders as $folder)
213 <option value="{{ $folder->id }}" {{ (old("folder") == $folder->id ? "selected" : "") }}>{{ $folder->name }}</option>
214 @endforeach
215 @else
216 <p>You haven't created any folders yet. <a class="text-primary" href="{{ route("dashboard.folders.index") }}">Create now.</a></p>
217 @endif
218 </select>
219 </div>
220 </div>
221 <div class="col-md-10">
222 <div class="form-group">
223 <label for="exampleFormControlSelect1">Uploads</label>
224
225
226 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
227 </div>
228 </div>
229 </div>
230 <br/>
231 <div class="modal-footer">
232 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
233 </button>
234 <button type="submit" class="btn btn-primary">Save changes</button>
235 </div>
236 </form>
237 </div>
238
239 </div>
240 </div>
241 </div>
242
243 </div>
244 </div>
245 </div>
246 </div>
247 </div>
248
249@endsection
250
251@section('script')
252
253 @yield('script')
254
255 <script src="{{ url('assets/js/examples/pages/user-list.js') }}"></script>
256@endsection
Note: See TracBrowser for help on using the repository browser.