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

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

bug fixes

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