%PDF- %PDF-
Direktori : /home/silvzytp/crm-dub-code/resources/views/backend/member/pages/roles/ |
Current File : //home/silvzytp/crm-dub-code/resources/views/backend/member/pages/roles/form.blade.php |
@extends('layouts.backend') @section('title', $siteTitle) @section('action') <button type="submit" class="btn btn-sm btn-primary submit-form-btn">Save Change</button> @endsection @push('styles') @endpush @section('content') <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h4 class="mb-0 card-title">New Role</h4> </div> <div class="card-body"> <form action="{{ isset($role) ? route('app.roles.update', $role->id) : route('app.roles.store') }}" id="form" method="POST"> @csrf @isset($role) @method('PUT') @endisset <x-form.selectbox name="role_name" labelName="Role name" required="required"> <option value="">Select Role</option> @forelse ($roles as $value) <option value="{{ $value->name }}" @isset($role) {{ $role->name == $value->name ? 'selected' : '' }} @endisset>{{ $value->name }}</option> @empty @endforelse </x-form.selectbox> <div class="permissions mb-5"> <h6 class="mb-0 text-center">Manage permissions for role</h6> </div> <div class="row"> <div class="col-12"> <div class="form-group ml-3"> <label class="ui-checkbox"> <input type="checkbox" class="select-all"> <span class="input-span"></span>Select All </label> </div> </div> @forelse ($modules->chunk(3) as $module) @foreach ($module as $value) <div class="col-md-4 mb-3"> <h6 class="mb-0">{{ $value->name }}</h6> <div class="ml-3 mt-3"> @foreach ($value->permissions as $permission) <div class="form-group"> <label class="ui-checkbox"> <input type="checkbox" name="permission[]" value="{{ $permission->id }}" @isset($role) @foreach ($role->permissions as $r_permission) {{ $r_permission->id == $permission->id ? 'checked' : '' }} @endforeach @endisset > <span class="input-span"></span>{!! $permission->name !!} </label> </div> @endforeach </div> </div> @endforeach @empty @endforelse </div> </form> </div> </div> </div> </div> @endsection @push('scripts') <script> $(document).on('click', 'input.select-all', function(){ if (this.checked) { $(':checkbox').each(function(){ this.checked = true; }) }else{ $(':checkbox').each(function(){ this.checked = false; }) } }) </script> @endpush