source: resources/views/dashboard/files/index.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: 16.1 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 @else
85 <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
86 <i class="fa fa-file-text-o text-warning fa-2x"></i>
87 </div>
88 @endif
89 @endif
90 @endif
91 @endif
92
93
94 </td>
95 <td>{{ $file->name }}</td>
96 <td>{{ date('d.m.Y - H:i', strtotime($file->created_at)) }}</td>
97 @if($file->updated_at==NULL)
98 <td>/</td>
99 @else
100 <td>{{ date('d.m.Y - H:i', strtotime($file->updated_at)) }}</td>
101 @endif
102 <td><a href="{{ route('dashboard.folders.files', ['id' => $file->folder_id]) }}" class="text-linkedin">{{ \App\Models\Folder::find($file->folder_id)->name }}</a></td>
103 <td>{{ \App\Models\Folder::find($file->folder_id)->arch_id }}</td>
104 <!-- Trigger -->
105 <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">
106 <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"/>
107 <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"/>
108 </svg></button>
109 </td>
110 @if(auth()->user()->hasPermission('manage_all_files'))
111 <td>
112 <a href="javascript:void(0)" class="text-secondary" data-toggle="modal" data-target="#editModal_{{$file->id}}" title="Edit">
113 <i class="ti-pencil"></i>
114 </a>
115 <a href="{{ route("dashboard.files.downloadFile", ['id' => $file->id]) }}" class="text-danger ml-2"title="Download">
116 <i class="ti-download"></i>
117 </a>
118 <a href="javascript:void(0)" class="text-danger ml-2" data-toggle="modal" data-target="#deleteModal_{{$file->id}}" title="Delete">
119 <i class="ti-trash"></i>
120 </a>
121 </td>
122 @else
123 <td></td>
124 @endif
125 </tr>
126 <div class="modal fade" id="deleteModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
127 <div class="modal-dialog modal-dialog-centered" role="document">
128 <div class="modal-content">
129 <div class="modal-header">
130 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
131 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
132 <i class="ti-close"></i>
133 </button>
134 </div>
135 <div class="modal-body">
136 <form action="{{ route("dashboard.files.deleteFile", $file->id) }}" method="POST">
137 @csrf
138 @method('DELETE')
139 <p>Are you sure you want to delete file {{$file->name}}?</p>
140 <p>Location: <span class="pr-1">{{$file->location}}</span></p>
141 <div class="modal-footer">
142 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
143 </button>
144 <button type="submit" class="btn btn-primary">Save changes</button>
145 </div>
146 </form>
147 </div>
148
149 </div>
150 </div>
151 </div>
152
153 <div class="modal fade" id="editModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
154 <div class="modal-dialog modal-dialog-centered" role="document">
155 <div class="modal-content">
156 <div class="modal-header">
157 <h5 class="modal-title" id="exampleModalCenterTitle">Rename file</h5>
158 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
159 <i class="ti-close"></i>
160 </button>
161 </div>
162 <div class="modal-body">
163 <form action="{{ route("dashboard.files.renameFile", ["id" =>$file->id]) }}" method="post" accept-charset="utf-8">
164 @method("patch")
165 @csrf
166 <div class="row">
167 <div class="col-md-12">
168 <div class="form-group">
169 <label class="form-label">Current name: {{$file->name}}</label>
170 <input type="text" name="name" value="{{ explode('.', $file->name)[0] }}" maxlength="255" title="Don't include: '\/.|'" pattern="^[^.\/|]+$" class="form-control" required>
171 </div>
172 </div>
173 </div>
174 <br/>
175 <div class="modal-footer">
176 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
177 </button>
178 <button type="submit" class="btn btn-primary">Save changes</button>
179 </div>
180 </form>
181 </div>
182
183 </div>
184 </div>
185 </div>
186 @endforeach
187
188 </tbody>
189 </table>
190
191 <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-hidden="true">
192 <div class="modal-dialog modal-dialog-centered" role="document">
193 <div class="modal-content">
194 <div class="modal-header">
195 <h5 class="modal-title" id="exampleModalCenterTitle">Upload</h5>
196 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
197 <i class="ti-close"></i>
198 </button>
199 </div>
200 <div class="modal-body">
201 <form action="{{ route("dashboard.files.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
202 @csrf
203 <div class="row">
204 <div class="col-md-10">
205 <div class="form-group">
206 <label for="exampleFormControlSelect1">Folder</label>
207 @if($folders->count())
208 <select class="form-control" name="folder" required>
209 @foreach ($folders as $folder)
210 <option value="{{ $folder->id }}" {{ (old("folder") == $folder->id ? "selected" : "") }}>{{ $folder->name }}</option>
211 @endforeach
212 @else
213 <p>You haven't created any folders yet. <a class="text-primary" href="{{ route("dashboard.folders.index") }}">Create now.</a></p>
214 @endif
215 </select>
216 </div>
217 </div>
218 <div class="col-md-10">
219 <div class="form-group">
220 <label for="exampleFormControlSelect1">Uploads</label>
221
222
223 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
224 </div>
225 </div>
226 </div>
227 <br/>
228 <div class="modal-footer">
229 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
230 </button>
231 <button type="submit" class="btn btn-primary">Save changes</button>
232 </div>
233 </form>
234 </div>
235
236 </div>
237 </div>
238 </div>
239
240 </div>
241 </div>
242 </div>
243 </div>
244 </div>
245
246@endsection
247
248@section('script')
249
250 @yield('script')
251
252 <script src="{{ url('assets/js/examples/pages/user-list.js') }}"></script>
253@endsection
Note: See TracBrowser for help on using the repository browser.