Edit File: edit.blade.php
@extends('admin.layout.master') @section('css') <link rel="stylesheet" type="text/css" href="{{asset('admin/app-assets/css-rtl/plugins/forms/validation/form-validation.css')}}"> <link rel="stylesheet" type="text/css" href="{{asset('admin/app-assets/vendors/css/extensions/sweetalert2.min.css')}}"> <style> .permissionCard{ border: 0; margin-bottom: 13px; } .role-title{ background: #5d54d4; padding: 12px; border-radius: 7px; /* margin-bottom: 10px; */ } .list-unstyled{ padding: 10px; height: 300px; /* scroll-behavior: smooth; */ overflow: auto; } .selectP{ margin-right: 10px; margin-top: 11px; } </style> @endsection @section('content') <section id="multiple-column-form"> <div class="row match-height"> <div class="col-12"> <div class="card"> <div class="card-header"> <h4 class="card-title">{{awtTrans('تعديل صلاحية ')}}</h4> </div> <div class="card-content"> <div class="card-body"> <form action="{{route('admin.roles.update',$role->id)}}" class="store" method="post"> @method('put') @csrf <div class="container mt-2"> <div style="display: flex; flex-direction: row-reverse;align-items:center"> <p style="margin-right: 10px;margin-bottom: 0">{{awtTrans('تحديد الكل')}}</p> <input type="checkbox" id="checkedAll"> </div> </div> <div class="container mt-2"> <div class="row"> <div class="col-sm-6"> <div class="form-group"> <label>{{awtTrans('الاسم بالعربيه')}}</label> <input type="text" name="name_ar" class="form-control" value="{{$role->getTranslations('name')['ar']}}" placeholder="{{awtTrans('هذا الحقل مطلوب')}}" data-validation-required-message="{{awtTrans('هذا الحقل مطلوب')}}"> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label>{{awtTrans('الاسم بالانجليزيه')}}</label> <input type="text" name="name_en" class="form-control" value="{{$role->getTranslations('name')['en']}}" placeholder="{{awtTrans('هذا الحقل مطلوب')}}" data-validation-required-message="{{awtTrans('هذا الحقل مطلوب')}}"> </div> </div> </div> </div> <div class="container mt-2"> <div class="row"> {!! $html !!} </div> </div> <div class="col-12 d-flex justify-content-center mt-3"> <button type="submit" class="btn btn-primary mr-1 mb-1 submit_button">{{awtTrans('تعديل')}}</button> <a href="{{ url()->previous() }}" type="reset" class="btn btn-outline-warning mr-1 mb-1">{{awtTrans(' رجوع ')}}</a> </div> </form> </div> </div> </div> </div> </div> </section> @endsection @section('js') <script src="{{asset('admin/app-assets/vendors/js/extensions/sweetalert2.all.min.js')}}"></script> <script src="{{asset('admin/app-assets/js/scripts/extensions/sweet-alerts.js')}}"></script> @include('admin.shared.submitEditForm') <script> var countCheckBox = $("input[type=checkbox]").not('#checkedAll').length; var checkAll = $('#checkedAll'); if(countCheckBox == '{{ $countAllPermissions }}'){ checkAll.prop("checked", true); }else { checkAll.prop("checked", false); } $(function () { $('.roles-parent').change(function () { var childClass = '.' + $(this).attr('id'); if (this.checked) { $(childClass).prop("checked", true); } else { $(childClass).prop("checked", false); } }); }); $("#checkedAll").change(function () { if (this.checked) { $("input[type=checkbox]").each(function () { this.checked = true }) } else { $("input[type=checkbox]").each(function () { this.checked = false; }) } }); </script> @endsection
Back to File Manager