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

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

added UserFactory, edited html, added delete to departments

  • Property mode set to 100644
File size: 7.3 KB
Line 
1@extends('layouts.app')
2
3@section("title", "Departments")
4
5@section('pageTitle', 'Department List')
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>
38 <th>
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>--}}
43 </th>
44 <th>ID</th>
45 <th>Name</th>
46 <th>Code</th>
47 <th>Created by</th>
48 <th>Created at</th>
49 <th>Updated at</th>
50 <th>Directory</th>
51 <th>Actions</th>
52 </tr>
53 </thead>
54 <tbody>
55 @foreach($departments as $department)
56 <tr>
57 <td></td>
58 <td>{{$department->id }}</td>
59 <td>{{ $department->name }}</td>
60 <td>{{ $department->code }}</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 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>
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>
79 <a href="javascript:void(0)" class="text-danger ml-2" data-action="{{ route("dashboard.categories.destroy", ["id" => $category->id]) }}" data-target="#deleteModal" data-toggle="modal" title="Delete">
80 <i class="ti-trash"></i>
81 </a>
82 </td>
83 </tr>
84 @endforeach
85 </tbody>
86 </table>
87
88 <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-hidden="true">
89 <div class="modal-dialog modal-dialog-centered" role="document">
90 <div class="modal-content">
91 <div class="modal-header">
92 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
93 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
94 <i class="ti-close"></i>
95 </button>
96 </div>
97 <div class="modal-body">
98 <form action="{{ route('dashboard.departments.destroy', 'id') }}" method="post">
99 @csrf
100 @method('DELETE')
101 <input id="id" name="id" hidden value="">
102 <p>Are you sure you want to delete department <b>{{$department->name}}</b> with code <b>{{$department->code}}?</b></p>
103 <div class="modal-footer">
104 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
105 </button>
106 <button type="submit" class="btn btn-danger">Save changes</button>
107 </div>
108 </form>
109 </div>
110
111 </div>
112 </div>
113 </div>
114
115 </div>
116 </div>
117 </div>
118 </div>
119 </div>
120
121@endsection
122
123@section('script')
124 <script src="{{ url('assets/js/examples/pages/user-list.js') }}"></script>
125 <!-- Datatable -->
126 <script src="{{ url('vendors/dataTable/dataTables.min.js') }}"></script>
127
128 <script>
129 $(document).on('click','.delete',function(){
130 let id = $(this).attr('data-action');
131 $('#id').val(id);
132 });
133 </script>
134@endsection
Note: See TracBrowser for help on using the repository browser.