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

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

edited pagination

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