source: resources/views/dashboard/documents/index.blade.php@ e6c1f87

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

added pagination, is_important

  • Property mode set to 100644
File size: 12.2 KB
RevLine 
[24a616f]1@extends('layouts.app')
2
[d795fa6]3@section("title", "SaveSpace - Documents")
4
5@section('pageTitle', 'SaveSpace - Documents')
[24a616f]6
7@section('content')
8
9 <div class="row app-block mb-4">
[d795fa6]10 <div class="col-md-3 app-sidebar">
11 <div class="card">
12 <div class="card-body">
13 <a href="{{ route("dashboard.documents.create") }}" class="btn btn-secondary btn-block file-upload-btn text-white" data-action="{{ route("dashboard.documents.create") }}">
14 Add document
15 </a>
16 <form class="d-none" id="file-upload">
17 <input type="file" multiple>
18 </form>
19 </div>
20 <div class="app-sidebar-menu">
21 <div class="list-group list-group-flush">
22 <a href="{{route("dashboard.documents.index")}}" class="list-group-item d-flex align-items-center">
23 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
24 Documents
25{{-- <span class="small ml-auto">{{$totalDocs}}</span>--}}
26 </a>
27 @foreach($departments as $department)
28 <a href="{{ route("dashboard.documents.index", ["id" => $department->id]) }}" class="list-group-item d-flex align-items-center">
29 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
30 {{$department->name}}
31 <span class="small ml-auto">{{$department->document->count()}}</span>
32 </a>
33 @endforeach
[e6c1f87]34 <a href="{{ URL::current()."?sort=recent" }}" class="list-group-item">
[d795fa6]35 <i data-feather="upload-cloud" class="width-15 height-15 mr-2"></i>
36 Recents
37 </a>
[e6c1f87]38 <a href="{{ URL::current()."?sort=important" }}" class="list-group-item d-flex align-items-center">
[d795fa6]39 <i data-feather="star" class="width-15 height-15 mr-2"></i>
40 Important
[e6c1f87]41 <span class="small ml-auto">{{ $countImportant }}</span>
[d795fa6]42 </a>
43 </div>
44 <div class="card-body">
45 <h6 class="mb-4">Storage Status</h6>
46 <div class="d-flex align-items-center">
47 <div class="mr-3">
48 <i data-feather="database" class="width-30 height-30"></i>
49 </div>
50 <div class="flex-grow-1">
51 <div class="progress" style="height: 10px">
52 <div class="progress-bar progress-bar-striped" role="progressbar"
[e6c1f87]53 style="width: {{$diskUse}}" aria-valuenow="10" aria-valuemin="0"
[d795fa6]54 aria-valuemax="100"></div>
[e6c1f87]55 <span class="sr-only">{{$diskUse}}</span>
[d795fa6]56 </div>
[e6c1f87]57 <div class="line-height-12 small text-muted mt-2">{{round($diskUsedSize,2)}} GB /
58 {{round($diskTotalSize,2)}} GB ({{$diskUse}})</div>
[d795fa6]59 </div>
60 </div>
61 </div>
62 </div>
63 </div>
64 </div>
65
[24a616f]66
67 <div class="col-md-9 app-content">
68 <div class="app-content-overlay"></div>
[d795fa6]69 <div class="app-action">
70 <div class="action-left">
71 <ul class="list-inline">
72 <li class="list-inline-item mb-0">
73 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">
74 <i data-feather="plus" class="mr-1"></i>
75 Add
76 </a>
77 <div class="dropdown-menu">
78 <a class="dropdown-item" href="{{route("dashboard.departments.create")}}">Department</a>
79 <a class="dropdown-item" href="{{route("dashboard.documents.create")}}">Document</a>
80 </div>
81 </li>
82 <li class="list-inline-item mb-0">
83 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">Departments</a>
84 <div class="dropdown-menu">
85 @foreach($departments as $department)
86 <a class="dropdown-item d-flex justify-content-between m-5" href="{{ route("dashboard.documents.index", ["id" => $department->id]) }}">
87 {{$department->name}}
88 <span class="text-muted">{{$department->document->count()}}</span>
89 </a>
90 @endforeach
91 </div>
92 </li>
93 <li class="list-inline-item mb-0">
94 <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">
95 Order by
96 </a>
97 <div class="dropdown-menu">
[e6c1f87]98 @if(Request::get('id'))
99 <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=newest" }}">Date</a>
100 <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=name" }}">Name</a>
101 <a class="dropdown-item" href="#">Size</a>
102 @else
103 <a class="dropdown-item" href="{{ URL::current()."?sort=newest" }}">Date</a>
104 <a class="dropdown-item" href="{{ URL::current()."?sort=name" }}">Name</a>
105 <a class="dropdown-item" href="#">Size - not done</a>
106 @endif
[d795fa6]107 </div>
108 </li>
109 </ul>
110 </div>
111 <div class="action-right">
[e6c1f87]112 <form action="{{ route("dashboard.documents.index") }}" method="get" class="d-flex mr-3">
[d795fa6]113 <div class="input-group">
[e6c1f87]114 <input type="text" name="search" class="form-control" placeholder="Search file"
115 aria-describedby="button-addon1" required>
[d795fa6]116 <div class="input-group-append">
[e6c1f87]117 <button class="btn btn-outline-light searchSubmitBtn" type="submit" value="Search">
[d795fa6]118 <i data-feather="search"></i>
119 </button>
120 </div>
121 </div>
122 </form>
123 </div>
124 </div>
[24a616f]125 <p>Documents</p>
126 <div class="row">
[d795fa6]127 @forelse($documents as $document)
[24a616f]128 <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">
129 <div class="card app-file-list">
130 <div class="app-file-icon">
131 <i class="fa fa-file-text-o text-primary"></i>
132 <div class="dropdown position-absolute top-0 right-0 mr-3">
133 <a href="#" class="btn btn-outline-light btn-sm" data-toggle="dropdown">
134 <i class="fa fa-ellipsis-h"></i>
135 </a>
136 <div class="dropdown-menu dropdown-menu-right">
137 <a href="{{ route("dashboard.documents.edit", ["id" => $document->id]) }}" class="dropdown-item">View Details</a>
138 <a href="#" class="dropdown-item">Share</a>
139 <a href="#" class="dropdown-item">Download</a>
[e6c1f87]140 <button class="dropdown-item action-dropdown-item"
141 href="javascript:void(0)" onclick="toggleImportant({{$document->id}})">
142 @if($document->is_important)
143 Mark as not important
144 @else
145 Mark as important
146 @endif
147 </button>
148 <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#deleteModal_{{$document->id}}">Delete</a>
[24a616f]149 </div>
150 </div>
151 </div>
152 <div class="p-2 small">
[e6c1f87]153 @if($document->is_important)
154 <div>{{$document->name}} - {{$document->arch_id}} <i class="fa fa-star" style="color:orange"></i></div>
155 @else
156 <div>{{$document->name}} - {{$document->arch_id}} </div>
157 @endif
158 <div>{{$document->created_at}}</div>
[24a616f]159 <div class="text-muted">{{$document->description}}</div>
160 <div class="text-muted">1.2MB</div>
161 </div>
162 </div>
163 </div>
[e6c1f87]164 <form id="toggleImportant_{{ $document->id }}"
165 action="{{ route("dashboard.documents.toggleImportant", ["id" => $document->id]) }}"
166 method="post">
167 @csrf
168 @method("patch")
169 </form>
170 <div class="modal fade" id="deleteModal_{{$document->id}}" tabindex="-1" role="dialog" aria-hidden="true">
171 <div class="modal-dialog modal-dialog-centered" role="document">
172 <div class="modal-content">
173 <div class="modal-header">
174 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
175 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
176 <i class="ti-close"></i>
177 </button>
178 </div>
179 <div class="modal-body">
180 <form action="{{ route("dashboard.documents.destroy", $document->id) }}" method="POST">
181 @csrf
182 @method('DELETE')
183 <p>Are you sure you want to delete document {{$document->name}} with Archive ID: {{ $document->arch_id }}?</p>
184 <div class="modal-footer">
185 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
186 </button>
187 <button type="submit" class="btn btn-primary">Save changes</button>
188 </div>
189 </form>
190 </div>
191
192 </div>
193 </div>
194 </div>
[d795fa6]195 @empty
[e6c1f87]196 <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>
[d795fa6]197 @endforelse
[24a616f]198
199 </div>
[e6c1f87]200 @if(!Request::query('search'))
201 {{$documents->appends($_GET)->links('layouts.pagination') }}
202 @endif
[24a616f]203 </div>
204
205@endsection
206
207@section('script')
208
[e6c1f87]209<script>
210 function toggleImportant(id) {
211 document.getElementById('toggleImportant_' + id).submit();
212 }
213</script>
[24a616f]214
215@endsection
Note: See TracBrowser for help on using the repository browser.