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

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

bug fixes

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