source: resources/views/dashboard/folders/index.blade.php@ e78295c

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

added version

  • Property mode set to 100644
File size: 16.9 KB
Line 
1@extends('layouts.app')
2
3@section("title", "SaveSpace - Folders")
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_folders'))
12 <a href="javascript:void(0)" class="btn btn-secondary btn-block file-upload-btn text-white" data-toggle="modal" data-target="#createModal">
13 Add folder
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($departments as $department)
24 <a href="{{ route("dashboard.folders.index", ["id" => $department->id]) }}" class="list-group-item d-flex align-items-center">
25 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
26 {{$department->name}}
27 <span class="small ml-auto">{{$department->folder->count()}}</span>
28 </a>
29 @endforeach
30 <a href="{{ URL::current()."?sort=recent" }}" class="list-group-item">
31 <i data-feather="upload-cloud" class="width-15 height-15 mr-2"></i>
32 Recents
33 </a>
34 </div>
35 <div class="card-body">
36 <h6 class="mb-4">Storage Status</h6>
37 <div class="d-flex align-items-center">
38 <div class="mr-3">
39 <i data-feather="database" class="width-30 height-30"></i>
40 </div>
41 <div class="flex-grow-1">
42 <div class="progress" style="height: 10px">
43 <div class="progress-bar progress-bar-striped" role="progressbar"
44 style="width: {{$diskUse}}" aria-valuenow="10" aria-valuemin="0"
45 aria-valuemax="100"></div>
46 <span class="sr-only">{{$diskUse}}</span>
47 </div>
48 <div class="line-height-12 small text-muted mt-2">{{round($diskUsedSize,2)}} GB /
49 {{round($diskTotalSize,2)}} GB ({{$diskUse}})</div>
50 </div>
51 </div>
52 </div>
53 </div>
54 </div>
55 </div>
56 <div class="col-md-9 app-content">
57 <div class="app-content-overlay"></div>
58 <div class="app-action">
59 <div class="action-left">
60 <ul class="list-inline">
61 @if(auth()->user()->hasPermission('manage_all_folders'))
62 <li class="list-inline-item mb-0">
63 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">
64 <i data-feather="plus" class="mr-1"></i>
65 Actions
66 </a>
67 <div class="dropdown-menu">
68 <a class="dropdown-item" href="javascript:void(0)" data-toggle="modal" data-target="#createModal">Add folder</a>
69 @endif
70 @if(auth()->user()->hasPermission('export_data'))
71 <a href="{{ route('dashboard.folders.export') }}" class="dropdown-item text-success">Export</a>
72 </div>
73 </li>
74 @endif
75 <li class="list-inline-item mb-0">
76 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">Departments</a>
77 <div class="dropdown-menu">
78 @foreach($departments as $department)
79 <a class="dropdown-item d-flex justify-content-between m-5" href="{{ route("dashboard.folders.index", ["id" => $department->id]) }}">
80 {{$department->name}}
81 <span class="text-muted">{{$department->folder->count()}}</span>
82 </a>
83 @endforeach
84 </div>
85 </li>
86 <li class="list-inline-item mb-0">
87 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">
88 Order by
89 </a>
90 <div class="dropdown-menu">
91 @if(Request::get('id'))
92 <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=newest" }}">Date</a>
93 <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=name" }}">Name</a>
94 <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=no_of_files" }}">Number of files</a>
95 @else
96 <a class="dropdown-item" href="{{ URL::current()."?sort=newest" }}">Date</a>
97 <a class="dropdown-item" href="{{ URL::current()."?sort=name" }}">Name</a>
98 <a class="dropdown-item" href="{{ URL::current()."?sort=no_of_files" }}">Number of files</a>
99 @endif
100 </div>
101 </li>
102 </ul>
103 </div>
104 <div class="action-right">
105 <form action="{{ route("dashboard.folders.index") }}" method="get" class="d-flex mr-3">
106 <div class="input-group">
107 <input type="text" name="search" class="form-control" placeholder="Search folder"
108 aria-describedby="button-addon1" required>
109 <div class="input-group-append">
110 <button class="btn btn-outline-light searchSubmitBtn" type="submit" value="Search">
111 <i data-feather="search"></i>
112 </button>
113 </div>
114 </div>
115 </form>
116 </div>
117 </div>
118 @if(!Request::query('id'))
119 <h4>Folders</h4><br/>
120 @else
121 <h4> {{ $deptName }} - {{$deptCode}} </h4>
122 <br/>
123 @endif
124
125 <div class="row">
126 @forelse($folders as $folder)
127 <div class="col-xl-4 col-lg-6">
128 <div class="card">
129 <div class="card-body">
130 <i class="fa fa-folder fa-2x pr-2" aria-hidden="true"></i>
131 <span class="card-title" style="font-size: 1.5rem;">{{$folder->name}}</span>
132
133 <div class="d-flex align-items-center">
134 <div class="dropdown ml-auto">
135 <a href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
136 <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
137 </a>
138 <div class="dropdown-menu dropdown-menu-right">
139 <a href="{{ route("dashboard.folders.files", ["id" => $folder->id]) }}" class="dropdown-item">View files</a>
140 @if(auth()->user()->hasPermission('download_data'))
141 <a href="{{ route("dashboard.folders.downloadFolder", ['id' => $folder->id]) }}" class="dropdown-item">Download</a>
142 @endif
143 @if(auth()->user()->hasPermission('manage_all_folders'))
144 <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#deleteModal_{{$folder->id}}">Delete</a>
145 @endif
146 </div>
147 </div>
148 </div>
149 <div class="text-muted small mt-1 mb-3">Number of files: {{$folder->files->count()}}</div>
150 <p class="badge bg-success-bright text-success">Version: {{$folder->version}}</p>
151 <p>Archive ID: {{$folder->arch_id}}</p>
152 <p>Note: {{$folder->note}}</p>
153 <div class="row">
154 <div class="col">
155 <div class="text-muted mb-1 small">Created</div>
156 <div> {{ $folder->created_at->diffForHumans() }}, {{ date('d.m.Y', strtotime($folder->created_at))}}</div>
157 </div>
158 </div>
159 </div>
160 <div class="card-footer">
161 <small class="text-muted">Last updated: {{ date('d.m.Y H:i', strtotime($folder->updated_at)) }}</small>
162
163 </div>
164 </div>
165 </div>
166
167 <div class="modal fade" id="deleteModal_{{$folder->id}}" tabindex="-1" role="dialog" aria-hidden="true">
168 <div class="modal-dialog modal-dialog-centered" role="document">
169 <div class="modal-content">
170 <div class="modal-header">
171 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
172 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
173 <i class="ti-close"></i>
174 </button>
175 </div>
176 <div class="modal-body">
177 <form action="{{ route("dashboard.folders.destroy", $folder->id) }}" method="POST">
178 @csrf
179 @method('DELETE')
180 <p>Are you sure you want to delete folder {{$folder->name}} with Archive ID: {{ $folder->arch_id }}?</p>
181 <div class="modal-footer">
182 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
183 </button>
184 <button type="submit" class="btn btn-primary">Save changes</button>
185 </div>
186 </form>
187 </div>
188 </div>
189 </div>
190 </div>
191 @empty
192 <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>
193 @endforelse
194
195 <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-hidden="true">
196 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
197 <div class="modal-content">
198 <div class="modal-header">
199 <h5 class="modal-title" id="exampleModalCenterTitle">Create folder</h5>
200 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
201 <i class="ti-close"></i>
202 </button>
203 </div>
204 <div class="modal-body">
205 <form action="{{ route("dashboard.folders.store") }}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
206 @csrf
207 <div class="row">
208 <div class="col-md-6">
209 <div class="form-group">
210 <label for="exampleFormControlSelect1">Department</label>
211 @if($departments->count())
212 <select class="form-control new_folder_deparment" name="department" required>
213 @foreach ($departments as $department)
214 <option value="{{ $department->id }}" data-dept-code="{{ $department->code }}" {{ (old("department") == $department->id ? "selected" : "") }}>{{ $department->name }}</option>
215 @endforeach
216 @else
217 <p>You haven't created any departments yet. <a class="text-primary" href="{{ route("dashboard.departments.create") }}">Create now.</a></p>
218 @endif
219 </select>
220 </div>
221 </div>
222 <div class="col-md-6">
223 <div class="form-group">
224 <label>Archive ID</label>
225 <input type="text" name="arch_id" value="" class="form-control" placeholder="Archive ID" required>
226 </div>
227 </div>
228 </div>
229 <div class="row">
230 <div class="col-md-6">
231 <div class="form-group">
232 <label>Name</label>
233 <input type="text" name="name" value="{{ old('name') }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
234 </div>
235 </div>
236 <div class="col-md-6">
237 <div class="form-group">
238 <label>Note</label>
239 <textarea class="form-control" name="note" maxlength="80">{{ old('note') }}</textarea>
240 </div>
241 </div>
242 </div>
243 <div class="row">
244 <div class="col-md-6">
245 <input type="file" class="form-control" id="file-item" name="file_item[]" accept="{{ $fileTypes }}" multiple>
246 </div>
247 </div>
248 <br/>
249 <div class="modal-footer">
250 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
251 </button>
252 <button type="submit" class="btn btn-primary">Save changes</button>
253 </div>
254 </form>
255 </div>
256
257 </div>
258 </div>
259 </div>
260
261 </div>
262 @if(!Request::query('search'))
263 {{$folders->appends($_GET)->links('layouts.pagination') }}
264 @endif
265 </div>
266
267 @endsection
268
269 @section('script')
270
271 @yield('script')
272
273@endsection
Note: See TracBrowser for help on using the repository browser.