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

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

bug fixes

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