Changeset d795fa6 for resources/views/dashboard/departments/index.blade.php
- Timestamp:
- 10/17/21 18:39:50 (3 years ago)
- Branches:
- develop, master
- Children:
- bd9e8e3
- Parents:
- 120759b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
resources/views/dashboard/departments/index.blade.php
r120759b rd795fa6 1 1 @extends('layouts.app') 2 2 3 @section("title", " Departments")3 @section("title", "SaveSpace - Departments") 4 4 5 @section('pageTitle', 'Department List')5 @section('pageTitle', 'Departments') 6 6 7 7 @section('head') … … 77 77 <i class="ti-pencil"></i> 78 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">79 <a href="javascript:void(0)" class="text-danger ml-2" data-toggle="modal" data-target="#deleteModal_{{$department->id}}" title="Delete"> 80 80 <i class="ti-trash"></i> 81 81 </a> 82 82 </td> 83 83 </tr> 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> 84 110 @endforeach 85 111 </tbody> 86 112 </table> 87 113 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 @csrf100 @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">Close105 </button>106 <button type="submit" class="btn btn-danger">Save changes</button>107 </div>108 </form>109 </div>110 114 111 </div>112 </div>113 </div>114 115 115 116 </div> … … 127 128 128 129 <script> 129 $(document).on('click','.delete',function(){ 130 let id = $(this).attr('data-action'); 131 $('#id').val(id); 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); 132 136 }); 133 137 </script>
Note:
See TracChangeset
for help on using the changeset viewer.