Changeset d795fa6 for resources/views/dashboard/departments
- Timestamp:
- 10/17/21 18:39:50 (3 years ago)
- Branches:
- develop, master
- Children:
- bd9e8e3
- Parents:
- 120759b
- Location:
- resources/views/dashboard/departments
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
resources/views/dashboard/departments/create.blade.php
r120759b rd795fa6 1 1 @extends('layouts.app') 2 2 3 @section("title", "Departments - Create new")3 @section("title", "Departments - Create department") 4 4 5 5 @section('pageTitle', 'Create department') … … 28 28 <div class="card-body"> 29 29 <h6 class="card-title">New department</h6> 30 <form action="{{ route("dashboard.departments.store") }}" method="post" accept-charset="utf-8" >30 <form action="{{ route("dashboard.departments.store") }}" method="post" accept-charset="utf-8" class="needs-validation" novalidate> 31 31 @csrf 32 32 <div class="row"> … … 34 34 <div class="form-group"> 35 35 <label>Name</label> 36 <input type="text" name="name" value="{{ old('name') }}" class="form-control" placeholder="Name" required> 36 <input type="text" name="name" value="{{ old('name') }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required> 37 <div class="invalid-feedback"> 38 Please enter characters with length between [2, 30] 39 </div> 37 40 </div> 38 41 </div> … … 40 43 <div class="form-group"> 41 44 <label>Code</label> 42 <input type="text" name="code" value="{{ old('code') }}" class="form-control" placeholder="Code" required> 45 <input type="text" name="code" value="{{ old('code') }}" minlength="2" maxlength="30" class="form-control" placeholder="Code" required> 46 <div class="invalid-feedback"> 47 Please enter characters with length between [2, 30] 48 </div> 43 49 </div> 44 50 </div> -
resources/views/dashboard/departments/edit.blade.php
r120759b rd795fa6 28 28 <div class="card-body"> 29 29 <h6 class="card-title">Departmnets</h6> 30 <form action="{{ route("dashboard.departments.edit", ["id" =>$department->id]) }}" method="post" accept-charset="utf-8" >30 <form action="{{ route("dashboard.departments.edit", ["id" =>$department->id]) }}" method="post" accept-charset="utf-8" class="needs-validation" novalidate> 31 31 @method("patch") 32 32 @csrf … … 35 35 <div class="form-group"> 36 36 <label class="form-label">Name</label> 37 <input type="text" name="name" value="{{ $department->name }}" class="form-control" placeholder="Name" required> 37 <input type="text" name="name" value="{{ $department->name }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required> 38 <div class="invalid-feedback"> 39 Please enter characters with length between [2, 30] 40 </div> 38 41 </div> 39 42 </div> … … 41 44 <div class="form-group"> 42 45 <label class="form-label">Code</label> 43 <input type="text" name="code" value="{{ $department->code }}" class="form-control" placeholder="Code" required> 46 <input type="text" name="code" value="{{ $department->code }}" minlength="2" maxlength="30" class="form-control" placeholder="Code" required> 47 <div class="invalid-feedback"> 48 Please enter characters with length between [2, 30] 49 </div> 44 50 </div> 45 51 </div> -
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.