[194a359] | 1 | @extends('layouts.app')
|
---|
| 2 |
|
---|
[d795fa6] | 3 | @section("title", "SaveSpace - Departments")
|
---|
[194a359] | 4 |
|
---|
[d795fa6] | 5 | @section('pageTitle', 'Departments')
|
---|
[194a359] | 6 |
|
---|
| 7 | @section('head')
|
---|
| 8 | <!-- Datatable -->
|
---|
| 9 | <link rel="stylesheet" href="{{ url('vendors/dataTable/dataTables.min.css') }}" type="text/css">
|
---|
| 10 | @endsection
|
---|
| 11 |
|
---|
| 12 | @section('content')
|
---|
| 13 |
|
---|
| 14 | <div class="page-header justify-content-between">
|
---|
| 15 | <nav aria-label="breadcrumb" class="d-flex align-items-start">
|
---|
| 16 | <ol class="breadcrumb">
|
---|
| 17 | <li class="breadcrumb-item">
|
---|
| 18 | <a href="{{ url('dashboard/departments') }}">Departments</a>
|
---|
| 19 | </li>
|
---|
| 20 | <li class="breadcrumb-item active" aria-current="page">Departments</li>
|
---|
| 21 | </ol>
|
---|
| 22 | </nav>
|
---|
| 23 | <div class="dropdown">
|
---|
| 24 | <a href="{{ route("dashboard.departments.create") }}" class="btn btn-primary text-white">
|
---|
| 25 | Add department
|
---|
| 26 | </a>
|
---|
| 27 | </div>
|
---|
| 28 | </div>
|
---|
| 29 |
|
---|
| 30 | <div class="row">
|
---|
| 31 | <div class="col-md-12">
|
---|
| 32 | <div class="card">
|
---|
| 33 | <div class="card-body">
|
---|
| 34 | <div class="table-responsive">
|
---|
| 35 | <table id="user-list" class="table table-lg">
|
---|
| 36 | <thead>
|
---|
| 37 | <tr>
|
---|
[24a616f] | 38 | <th>
|
---|
[120759b] | 39 | {{-- <div class="custom-control custom-checkbox">--}}
|
---|
| 40 | {{-- <input type="checkbox" class="custom-control-input" id="user-list-select-all">--}}
|
---|
| 41 | {{-- <label class="custom-control-label" for="user-list-select-all"></label>--}}
|
---|
| 42 | {{-- </div>--}}
|
---|
[24a616f] | 43 | </th>
|
---|
[194a359] | 44 | <th>ID</th>
|
---|
| 45 | <th>Name</th>
|
---|
| 46 | <th>Code</th>
|
---|
| 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>
|
---|
| 59 | <td>{{ $department->name }}</td>
|
---|
| 60 | <td>{{ $department->code }}</td>
|
---|
| 61 | <td>{{ $department->getCreatedByName() }}</td>
|
---|
[24a616f] | 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 id="copy_{{ $department->id }}" value="{{$department->location}}">{{$department->location}}
|
---|
| 70 | <button class="btn btn-sm btn-primary text-white" data-clipboard-target="#copy_{{ $department->id }}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16">
|
---|
| 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>
|
---|
| 76 | <a href="{{ route("dashboard.departments.edit", ["id" => $department->id]) }}" class="text-secondary" data-toggle="tooltip" title="Edit">
|
---|
| 77 | <i class="ti-pencil"></i>
|
---|
| 78 | </a>
|
---|
[d795fa6] | 79 | <a href="javascript:void(0)" class="text-danger ml-2" data-toggle="modal" data-target="#deleteModal_{{$department->id}}" title="Delete">
|
---|
[194a359] | 80 | <i class="ti-trash"></i>
|
---|
| 81 | </a>
|
---|
| 82 | </td>
|
---|
| 83 | </tr>
|
---|
[d795fa6] | 84 | <div class="modal fade" id="deleteModal_{{$department->id}}" tabindex="-1" role="dialog" aria-hidden="true">
|
---|
| 85 | <div class="modal-dialog modal-dialog-centered" role="document">
|
---|
| 86 | <div class="modal-content">
|
---|
| 87 | <div class="modal-header">
|
---|
| 88 | <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
|
---|
| 89 | <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
---|
| 90 | <i class="ti-close"></i>
|
---|
| 91 | </button>
|
---|
| 92 | </div>
|
---|
| 93 | <div class="modal-body">
|
---|
| 94 | <form action="{{ route("dashboard.departments.destroy", $department->id) }}" method="POST">
|
---|
| 95 | @csrf
|
---|
| 96 | @method('DELETE')
|
---|
| 97 | <p>Are you sure you want to delete department {{$department->name}} with code: {{$department->code}}?</p>
|
---|
| 98 | <p>Number of documents associated: {{$department->document()->count()}}</p>
|
---|
| 99 | <div class="modal-footer">
|
---|
| 100 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
|
---|
| 101 | </button>
|
---|
| 102 | <button type="submit" class="btn btn-primary">Save changes</button>
|
---|
| 103 | </div>
|
---|
| 104 | </form>
|
---|
| 105 | </div>
|
---|
| 106 |
|
---|
| 107 | </div>
|
---|
| 108 | </div>
|
---|
| 109 | </div>
|
---|
[194a359] | 110 | @endforeach
|
---|
| 111 | </tbody>
|
---|
| 112 | </table>
|
---|
[120759b] | 113 |
|
---|
| 114 |
|
---|
| 115 |
|
---|
[194a359] | 116 | </div>
|
---|
| 117 | </div>
|
---|
| 118 | </div>
|
---|
| 119 | </div>
|
---|
| 120 | </div>
|
---|
| 121 |
|
---|
| 122 | @endsection
|
---|
| 123 |
|
---|
| 124 | @section('script')
|
---|
[120759b] | 125 | <script src="{{ url('assets/js/examples/pages/user-list.js') }}"></script>
|
---|
[194a359] | 126 | <!-- Datatable -->
|
---|
| 127 | <script src="{{ url('vendors/dataTable/dataTables.min.js') }}"></script>
|
---|
| 128 |
|
---|
[120759b] | 129 | <script>
|
---|
[d795fa6] | 130 | $('#deleteModal').on('show.bs.modal', function (event) {
|
---|
| 131 | var button = $(event.relatedTarget)
|
---|
| 132 | var dep_id = button.data('deptId')
|
---|
| 133 | var modal = $(this)
|
---|
| 134 |
|
---|
| 135 | modal.find('.modal-body #dept_id').val(dep_id);
|
---|
[120759b] | 136 | });
|
---|
| 137 | </script>
|
---|
[194a359] | 138 | @endsection
|
---|