[c6b84df] | 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">
|
---|
[4521f25] | 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>
|
---|
[c6b84df] | 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)
|
---|
[4521f25] | 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;">
|
---|
[c6b84df] | 26 | <i data-feather="folder" class="width-15 height-15 mr-2"></i>
|
---|
[ec7b69d] | 27 | {{$folder->name}} v.{{$folder->version}}
|
---|
[4521f25] | 28 | <span class="small ml-auto">{{$folder->files->count()}}</span>
|
---|
[c6b84df] | 29 | </a>
|
---|
[4521f25] | 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>
|
---|
[ec7b69d] | 33 | {{$obj->name}} v.{{$obj->version}}
|
---|
[4521f25] | 34 | <span class="small ml-auto">{{$obj->files->count()}}</span>
|
---|
| 35 | </a>
|
---|
| 36 | @endif
|
---|
[c6b84df] | 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">
|
---|
[0df7a93] | 48 | @if(auth()->user()->hasPermission('download_data'))
|
---|
[c6b84df] | 49 | <a href="{{ route("dashboard.folders.downloadFolder", ['id' => $folder->id]) }}" class="btn btn-outline-light">
|
---|
| 50 | Download folder
|
---|
| 51 | </a>
|
---|
[0df7a93] | 52 | @endif
|
---|
[c6b84df] | 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 |
|
---|
[4521f25] | 71 | <p>Files in {{$folder->name}}</p>
|
---|
[0a1fb54] | 72 | {{-- @dd($files)--}}
|
---|
[c6b84df] | 73 | <div class="row">
|
---|
| 74 | @forelse($files as $file)
|
---|
[0a1fb54] | 75 |
|
---|
[c6b84df] | 76 | <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">
|
---|
| 77 | <div class="card app-file-list">
|
---|
| 78 | <div class="app-file-icon">
|
---|
| 79 | @if(in_array(explode('.', $file->name)[1], $excelExt))
|
---|
| 80 | <i class="fa fa-file-excel-o text-success"></i>
|
---|
| 81 | @else @if(in_array(explode('.', $file->name)[1], $textExt))
|
---|
| 82 | <i class="fa fa-file-word-o text-info"></i>
|
---|
| 83 | @else @if(explode('.', $file->name)[1] == 'pdf')
|
---|
| 84 | <i class="fa fa-file-pdf-o text-danger"></i>
|
---|
| 85 | @else @if(in_array(explode('.', $file->name)[1], $imageExt))
|
---|
[ff5b46e] | 86 | {{-- <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">--}}
|
---|
| 87 | {{-- <a href="{{ url('/storage/' . $file->location) }}" class="image-popup-gallery-item">--}}
|
---|
| 88 | {{-- <div class="image-hover">--}}
|
---|
| 89 | {{-- <img src="{{ url('/storage/' . $file->location) }}" class="rounded" width="100" alt="image">--}}
|
---|
| 90 | {{-- </div>--}}
|
---|
| 91 | {{-- </a>--}}
|
---|
| 92 | {{-- </div>--}}
|
---|
[4521f25] | 93 | <i class="fa fa-file-image-o text-danger"></i>
|
---|
[c6b84df] | 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">
|
---|
[0df7a93] | 105 | @if(auth()->user()->hasPermission('download_data'))
|
---|
[c6b84df] | 106 | <a href="{{ route("dashboard.files.downloadFile", $file->id) }}" class="dropdown-item">
|
---|
| 107 | Download
|
---|
| 108 | </a>
|
---|
[0df7a93] | 109 | @endif
|
---|
[190db9f] | 110 | @if(auth()->user()->hasPermission('delete_data'))
|
---|
[c6b84df] | 111 | <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#deleteModal_{{$file->id}}">
|
---|
| 112 | Delete
|
---|
| 113 | </a>
|
---|
[0df7a93] | 114 | @endif
|
---|
[c6b84df] | 115 | </div>
|
---|
| 116 | </div>
|
---|
| 117 | </div>
|
---|
| 118 | <div class="p-2 small">
|
---|
| 119 | <div>{{$file->name}}</div>
|
---|
| 120 | <div class="text-muted">{{ $file->getSize($file->location) }} MB</div>
|
---|
| 121 | </div>
|
---|
| 122 | </div>
|
---|
| 123 | </div>
|
---|
| 124 | <div class="modal fade" id="deleteModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
|
---|
| 125 | <div class="modal-dialog modal-dialog-centered" role="document">
|
---|
| 126 | <div class="modal-content">
|
---|
| 127 | <div class="modal-header">
|
---|
| 128 | <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
|
---|
| 129 | <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
---|
| 130 | <i class="ti-close"></i>
|
---|
| 131 | </button>
|
---|
| 132 | </div>
|
---|
| 133 | <div class="modal-body">
|
---|
| 134 | <form action="{{ route("dashboard.files.deleteFile", $file->id) }}" method="POST">
|
---|
| 135 | @csrf
|
---|
| 136 | @method('DELETE')
|
---|
| 137 | <p>Are you sure you want to delete file {{$file->name}}?</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 |
|
---|
[4b7e2d3] | 150 | @empty
|
---|
| 151 | <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>
|
---|
| 152 | @endforelse
|
---|
| 153 |
|
---|
[c6b84df] | 154 | </div>
|
---|
| 155 |
|
---|
| 156 | @if(!Request::query('search'))
|
---|
| 157 | {{$files->appends($_GET)->links('layouts.pagination') }}
|
---|
| 158 | @endif
|
---|
| 159 |
|
---|
| 160 | </div>
|
---|
[4521f25] | 161 | <div class="modal fade" id="uploadFiles_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
|
---|
| 162 | <div class="modal-dialog modal-dialog-centered" role="document">
|
---|
| 163 | <div class="modal-content">
|
---|
| 164 | <div class="modal-header">
|
---|
[0a1fb54] | 165 | <h5 class="modal-title" id="exampleModalCenterTitle">Upload files to {{$folder->name}}</h5>
|
---|
[4521f25] | 166 | <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
---|
| 167 | <i class="ti-close"></i>
|
---|
| 168 | </button>
|
---|
| 169 | </div>
|
---|
| 170 | <div class="modal-body">
|
---|
| 171 | <form action="{{ route("dashboard.files.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
|
---|
| 172 | @csrf
|
---|
| 173 | <div class="row">
|
---|
| 174 | <div class="col-md-10">
|
---|
| 175 | <div class="form-group">
|
---|
| 176 | <select class="form-control" name="folder" hidden>
|
---|
| 177 | <option value="{{ $folder->id }}" {{ (old("folder") == $folder->id ? "selected" : "") }}>{{ $folder->name }}</option>
|
---|
| 178 | </select>
|
---|
| 179 | </div>
|
---|
| 180 | </div>
|
---|
| 181 | <div class="col-md-10">
|
---|
| 182 | <div class="form-group">
|
---|
| 183 | <label for="exampleFormControlSelect1">Files</label>
|
---|
| 184 |
|
---|
[c6b84df] | 185 |
|
---|
[4521f25] | 186 | <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
|
---|
| 187 | </div>
|
---|
| 188 | </div>
|
---|
| 189 | </div>
|
---|
| 190 | <br/>
|
---|
| 191 | <div class="modal-footer">
|
---|
| 192 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
|
---|
| 193 | </button>
|
---|
| 194 | <button type="submit" class="btn btn-primary">Save changes</button>
|
---|
| 195 | </div>
|
---|
| 196 | </form>
|
---|
| 197 | </div>
|
---|
| 198 |
|
---|
| 199 | </div>
|
---|
| 200 | </div>
|
---|
| 201 | </div>
|
---|
[c6b84df] | 202 | </div>
|
---|
| 203 |
|
---|
| 204 | @endsection
|
---|
| 205 |
|
---|
| 206 | @yield('script')
|
---|
| 207 |
|
---|
| 208 |
|
---|