source: resources/views/dashboard/departments/index.blade.php@ 4b7e2d3

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

bug fixes, edited export, added fileSeeder for DB testing

  • Property mode set to 100644
File size: 13.7 KB
Line 
1@extends('layouts.app')
2
3@section("title", "SaveSpace - Departments")
4
5@section('head')
6 <!-- Datatable -->
7 <link rel="stylesheet" href="{{ url('vendors/dataTable/dataTables.min.css') }}" type="text/css">
8@endsection
9
10@section('content')
11
12 <div class="page-header justify-content-between">
13 <nav aria-label="breadcrumb" class="d-flex align-items-start">
14 <ol class="breadcrumb">
15 <li class="breadcrumb-item">
16 <a href="{{ url('/') }}">Dashboard</a>
17 </li>
18 <li class="breadcrumb-item active" aria-current="page">Departments</li>
19 </ol>
20 </nav>
21 <div class="dropdown">
22 <a href="javascript:void(0)" data-toggle="modal" data-target="#createModal" class="btn btn-primary text-white">
23 Add department
24 </a>
25 <a href="{{ route("dashboard.departments.downloadAll") }}" class="btn btn-danger text-white">
26 <i class="fa fa-download pr-1"></i> Download files
27 </a>
28 <a href="{{ route('dashboard.departments.export') }}" class="btn btn-success text-white">Export table</a>
29 </div>
30 </div>
31
32 <div class="row">
33 <div class="col-md-12">
34 <div class="card">
35 <div class="card-body">
36 <div class="table-responsive">
37 <table id="user-list" class="table table-lg">
38 <thead>
39 <tr>
40 <th>
41 </th>
42 <th>ID</th>
43 <th>Name</th>
44 <th>Code</th>
45 <th>Folders</th>
46 <th>Created by</th>
47 <th>Created at</th>
48 <th>Updated at</th>
49 <th>Directory</th>
50 <th>Actions</th>
51 </tr>
52 </thead>
53 <tbody>
54 @foreach($departments as $department)
55 <tr>
56 <td></td>
57 <td>{{$department->id }}</td>
58 <td><a href="{{ route("dashboard.folders.index", ['id' => $department->id]) }}" class="text-linkedin">{{ $department->name }}</a></td>
59 <td>{{ $department->code }}</td>
60 <td>{{ $department->no_of_folders }}</td>
61 <td>{{ $department->getCreatedByName() }}</td>
62 <td>{{ date('d.m.Y - H:i', strtotime($department->created_at)) }}</td>
63 @if($department->updated_at==NULL)
64 <td>/</td>
65 @else
66 <td>{{ date('d.m.Y - H:i', strtotime($department->updated_at)) }}</td>
67 @endif
68 <!-- Trigger -->
69 <td><button data-clipboard-text="{{$department->location}}" class="btn btn-sm btn-primary text-white" data-toggle="tooltip" data-placement="right" title="{{$department->location}}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16">
70 <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"/>
71 <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"/>
72 </svg></button>
73 </td>
74 <td>
75 <a href="javascript:void(0)" class="text-secondary" data-toggle="modal" data-target="#editModal_{{$department->id}}" title="Edit">
76 <i class="ti-pencil"></i>
77 </a>
78 <a href="{{ route("dashboard.departments.downloadDepartment", ['id' => $department->id]) }}" class="text-danger ml-2"title="Delete">
79 <i class="ti-download"></i>
80 </a>
81 <a href="javascript:void(0)" class="text-danger ml-2" data-toggle="modal" data-target="#deleteModal_{{$department->id}}" title="Delete">
82 <i class="ti-trash"></i>
83 </a>
84 </td>
85 </tr>
86 <div class="modal fade" id="deleteModal_{{$department->id}}" tabindex="-1" role="dialog" aria-hidden="true">
87 <div class="modal-dialog modal-dialog-centered" role="document">
88 <div class="modal-content">
89 <div class="modal-header">
90 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
91 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
92 <i class="ti-close"></i>
93 </button>
94 </div>
95 <div class="modal-body">
96 <form action="{{ route("dashboard.departments.destroy", $department->id) }}" method="POST">
97 @csrf
98 @method('DELETE')
99 <p>Are you sure you want to delete department {{$department->name}} with code: {{$department->code}}?</p>
100 <p>Number of documents associated: <a href="{{ route("dashboard.folders.index", ['id' => $department->id]) }}" class="text-linkedin">{{$department->folder()->count()}}</a></p>
101 <div class="modal-footer">
102 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
103 </button>
104 <button type="submit" class="btn btn-primary">Save changes</button>
105 </div>
106 </form>
107 </div>
108
109 </div>
110 </div>
111 </div>
112
113 <div class="modal fade" id="editModal_{{$department->id}}" tabindex="-1" role="dialog" aria-hidden="true">
114 <div class="modal-dialog modal-dialog-centered" role="document">
115 <div class="modal-content">
116 <div class="modal-header">
117 <h5 class="modal-title" id="exampleModalCenterTitle">Edit department</h5>
118 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
119 <i class="ti-close"></i>
120 </button>
121 </div>
122 <div class="modal-body">
123 <form action="{{ route("dashboard.departments.edit", ["id" =>$department->id]) }}" method="post" accept-charset="utf-8">
124 @method("patch")
125 @csrf
126 <div class="row">
127 <div class="col-md-6">
128 <div class="form-group">
129 <label class="form-label">Name</label>
130 <input type="text" name="name" value="{{ $department->name }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
131 </div>
132 </div>
133 <div class="col-md-6">
134 <div class="form-group">
135 <label class="form-label">Code</label>
136 <input type="text" name="code" value="{{ $department->code }}" minlength="2" maxlength="30" class="form-control" placeholder="Code" required>
137 </div>
138 </div>
139 </div>
140 <br/>
141 <div class="modal-footer">
142 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
143 </button>
144 <button type="submit" class="btn btn-primary">Save changes</button>
145 </div>
146 </form>
147 </div>
148
149 </div>
150 </div>
151 </div>
152 @endforeach
153
154 <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-hidden="true">
155 <div class="modal-dialog modal-dialog-centered" role="document">
156 <div class="modal-content">
157 <div class="modal-header">
158 <h5 class="modal-title" id="exampleModalCenterTitle">Create department</h5>
159 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
160 <i class="ti-close"></i>
161 </button>
162 </div>
163 <div class="modal-body">
164 <form action="{{ route("dashboard.departments.store") }}" method="post" accept-charset="utf-8">
165 @csrf
166 <div class="row">
167 <div class="col-md-6">
168 <div class="form-group">
169 <label>Name</label>
170 <input type="text" name="name" value="{{ old('name') }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
171 </div>
172 </div>
173 <div class="col-md-6">
174 <div class="form-group">
175 <label>Code</label>
176 <input type="text" name="code" value="{{ old('code') }}" minlength="2" maxlength="30" class="form-control" placeholder="Code" required>
177 </div>
178 </div>
179 </div>
180 <br/>
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
189 </div>
190 </div>
191 </div>
192
193 </tbody>
194 </table>
195 </div>
196 </div>
197 </div>
198 </div>
199 </div>
200
201@endsection
202
203@section('script')
204
205 @yield('script')
206
207 <script src="{{ url('assets/js/examples/pages/user-list.js') }}"></script>
208 <!-- Datatable -->
209 <script src="{{ url('vendors/dataTable/dataTables.min.js') }}"></script>
210@endsection
Note: See TracBrowser for help on using the repository browser.