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

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

edited file upload, seeding and departments controller

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