-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b624898
commit dd55ebf
Showing
11 changed files
with
495 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@extends(config('role-creator.layout_name')) | ||
|
||
@section(config('role-creator.section_name')) | ||
<section class="{{ $cssClass['container'] }}"> | ||
<div class="{{ $cssClass['card'] }}"> | ||
<div class="card-header"> | ||
<div class="d-flex justify-content-between"> | ||
<h4 class="m-0">{{ trans('role-creator::sp_role_creator.role_create') }}</h4> | ||
<a class="btn {{ $cssClass['btn'] }}" href="{{ route($routeName . '.index') }}">{{ trans('role-creator::sp_role_creator.back_to_list') }}</a> | ||
</div> | ||
</div> | ||
|
||
<div class="card-body"> | ||
<form method="POST" action="{{ route($routeName . '.store') }}"> | ||
@csrf | ||
|
||
@include('role-creator::bootstrap4.form') | ||
|
||
<hr> | ||
<button type="submit" id="submit" class="btn {{ $cssClass['btn'] }} float-right">{{ trans('role-creator::sp_role_creator.save') }}</button> | ||
</form> | ||
</div> | ||
</div> | ||
</section> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@extends(config('role-creator.layout_name')) | ||
|
||
@section(config('role-creator.section_name')) | ||
<section class="{{ $cssClass['container'] }}"> | ||
<div class="{{ $cssClass['card'] }}"> | ||
<div class="card-header"> | ||
<div class="d-flex justify-content-between"> | ||
<h4 class="m-0">{{ trans('role-creator::sp_role_creator.role_edit') }}</h4> | ||
<a class="btn {{ $cssClass['btn'] }}" href="{{ route($routeName . '.index') }}">{{ trans('role-creator::sp_role_creator.back_to_list') }}</a> | ||
</div> | ||
</div> | ||
|
||
<div class="card-body"> | ||
<form method="POST" action="{{ route($routeName . '.update', $data->id) }}"> | ||
@csrf | ||
@method('PUT') | ||
|
||
@include('role-creator::bootstrap4.form') | ||
|
||
<hr> | ||
<button type="submit" id="submit" class="btn {{ $cssClass['btn'] }} float-right">{{ trans('role-creator::sp_role_creator.update') }}</button> | ||
</form> | ||
</div> | ||
</div> | ||
</section> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<div class="form-group"> | ||
<label>{{ trans('role-creator::sp_role_creator.name') }} <span class="text-danger">*</span></label> | ||
<input type="text" class="form-control" name="name" value="{{ old('name', isset($data) ? $data->name : '') }}" required> | ||
|
||
@if ($errors->has('name')) | ||
<span class="invalid-feedback d-block">{{ $errors->first('name') }}</span> | ||
@endif | ||
</div> | ||
|
||
<div class="form-group"> | ||
<h6>{{ trans('role-creator::sp_role_creator.assign_role_permission') }}</h6> | ||
<table class="table table-striped mb-0"> | ||
<thead> | ||
<tr> | ||
<th>{{ trans('role-creator::sp_role_creator.module') }}</th> | ||
<th>{{ trans('role-creator::sp_role_creator.permissions') }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@if (!empty($permissionArr)) | ||
@php($i = 1) | ||
@foreach($permissionArr as $module => $moduleArr) | ||
<tr> | ||
<td> | ||
<div class="custom-control custom-switch"> | ||
<input type="checkbox" class="custom-control-input" id="module{{ $i }}" onclick="moduleCheck({{ $i }})"{{ (array_key_exists($module, $permissioDone)) ? ' checked' : '' }}> | ||
<label class="custom-control-label" for="module{{ $i }}">{{ $moduleArr[0]->module }}</label> | ||
</div> | ||
</td> | ||
<td> | ||
<div class="row" id="moduleContent{{ $i }}"> | ||
@foreach($moduleArr as $md) | ||
<div class="col-sm-2 custom-control custom-checkbox"> | ||
<input type="checkbox" class="custom-control-input" id="permission{{ $md->id }}" name="permissions[]" value="{{ $md->name }}"{{ (isset($permissioDone[$module]) && in_array($md->name, $permissioDone[$module])) ? ' checked' : '' }}> | ||
<label class="custom-control-label" for="permission{{ $md->id }}">{{ $md->label }}</label><br> | ||
</div> | ||
@endforeach | ||
</div> | ||
</td> | ||
</tr> | ||
@php($i++) | ||
@endforeach | ||
@else | ||
<tr> | ||
<td colspan="2" class="text-center">{{ trans('role-creator::sp_role_creator.permission_not_found') }}</td> | ||
</tr> | ||
@endif | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<script> | ||
function moduleCheck(k) { | ||
if (document.getElementById('module'+k).checked == true) { | ||
$('#moduleContent'+k+' input').prop('checked', true); | ||
} else { | ||
$('#moduleContent'+k+' input').prop('checked', false); | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@extends(config('role-creator.layout_name')) | ||
|
||
@section(config('role-creator.section_name')) | ||
<section class="{{ $cssClass['container'] }}"> | ||
<div class="{{ $cssClass['card'] }}"> | ||
<div class="card-header"> | ||
<div class="d-flex justify-content-between"> | ||
<h4 class="m-0">{{ trans('role-creator::sp_role_creator.role') }}</h4> | ||
<a class="btn {{ $cssClass['btn'] }}" href="{{ route($routeName . '.create') }}">{{ trans('role-creator::sp_role_creator.create') }}</a> | ||
</div> | ||
</div> | ||
|
||
<div class="card-body"> | ||
<div class="table-responsive"> | ||
<table class="table {{ $cssClass['table'] }}"> | ||
<thead> | ||
<tr> | ||
<th>{{ trans('role-creator::sp_role_creator.id') }}</th> | ||
<th>{{ trans('role-creator::sp_role_creator.name') }}</th> | ||
<th>{{ trans('role-creator::sp_role_creator.guard') }}</th> | ||
<th>{{ trans('role-creator::sp_role_creator.created_at') }}</th> | ||
<th class="{{ $cssClass['table_action_col_width'] }}"></th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
@if($records->count() > 0) | ||
@foreach($records as $val) | ||
<tr> | ||
<td>{{ $val->id }}</td> | ||
<td>{{ $val->name }}</td> | ||
<td>{{ $val->guard_name }}</td> | ||
<td>{{ $val->created_at }}</td> | ||
<td> | ||
<div class="btn-group"> | ||
<button type="button" class="btn {{ $cssClass['table_action_btn'] }} btn-sm dropdown-toggle" data-toggle="dropdown" data-display="static">{{ trans('role-creator::sp_role_creator.action') }}</button> | ||
<div class="dropdown-menu dropdown-menu-sm dropdown-menu-lg-right"> | ||
<a class="dropdown-item" href="{{ route($routeName . '.show', $val->id) }}">{{ trans('role-creator::sp_role_creator.show') }}</a> | ||
<a class="dropdown-item" href="{{ route($routeName . '.edit', $val->id) }}">{{ trans('role-creator::sp_role_creator.edit') }}</a> | ||
<a class="dropdown-item" href="javascript:void(0)" onclick="if (confirm('Are you sure to delete this role?')) { event.preventDefault(); document.getElementById('role-delete-form{{ $val->id }}').submit(); } else { event.stopPropagation(); event.preventDefault(); };">{{ trans('role-creator::sp_role_creator.destroy') }}</a> | ||
</div> | ||
</div> | ||
|
||
<form id="role-delete-form{{ $val->id }}" action="{{ route($routeName . '.destroy', $val->id) }}" method="POST" style="display: none;"> | ||
@csrf | ||
@method('DELETE') | ||
</form> | ||
</td> | ||
</tr> | ||
@endforeach | ||
@else | ||
<tr> | ||
<td colspan="5" class="text-center">{{ trans('role-creator::sp_role_creator.row_not_found') }}</td> | ||
</tr> | ||
@endif | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
@extends(config('role-creator.layout_name')) | ||
|
||
@section(config('role-creator.section_name')) | ||
<section class="{{ $cssClass['container'] }}"> | ||
<div class="{{ $cssClass['card'] }}"> | ||
<div class="card-header"> | ||
<div class="d-flex justify-content-between"> | ||
<h4 class="m-0">{{ trans('role-creator::sp_role_creator.role_show') }}</h4> | ||
<a class="btn {{ $cssClass['btn'] }}" href="{{ route($routeName . '.index') }}">{{ trans('role-creator::sp_role_creator.back_to_list') }}</a> | ||
</div> | ||
</div> | ||
|
||
<div class="card-body"> | ||
<table class="table browser mt-4 no-border"> | ||
<tbody> | ||
<tr> | ||
<td>{{ trans('role-creator::sp_role_creator.name') }}</td> | ||
<td align="right">{{ $data->name }}</td> | ||
</tr> | ||
<tr> | ||
<td>{{ trans('role-creator::sp_role_creator.guard') }}</td> | ||
<td align="right">{{ $data->guard_name }}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<div class="form-group"> | ||
<h6>{{ trans('role-creator::sp_role_creator.assign_role_permission') }}</h6> | ||
<table class="table table-striped mb-0"> | ||
<thead> | ||
<tr> | ||
<th>{{ trans('role-creator::sp_role_creator.module') }}</th> | ||
<th>{{ trans('role-creator::sp_role_creator.permissions') }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach($permissioDone as $module => $moduleArr) | ||
<tr> | ||
<td> | ||
<div class="custom-control custom-switch"> | ||
<input type="checkbox" class="custom-control-input" checked disabled> | ||
<label class="custom-control-label">{{ ucfirst($module) }}</label> | ||
</div> | ||
</td> | ||
<td> | ||
<div class="row"> | ||
@foreach($moduleArr as $md) | ||
<div class="col-sm-2 custom-control custom-checkbox"> | ||
<input class="custom-control-input" type="checkbox" checked disabled> | ||
<label class="custom-control-label">{{ $md }}</label><br> | ||
</div> | ||
@endforeach | ||
</div> | ||
</td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@extends(config('role-creator.layout_name')) | ||
|
||
@section(config('role-creator.section_name')) | ||
<section class="{{ $cssClass['container'] }}"> | ||
<div class="{{ $cssClass['card'] }}"> | ||
<div class="card-header"> | ||
<div class="d-flex justify-content-between"> | ||
<h4 class="m-0">{{ trans('role-creator::sp_role_creator.role_create') }}</h4> | ||
<a class="btn {{ $cssClass['btn'] }}" href="{{ route($routeName . '.index') }}">{{ trans('role-creator::sp_role_creator.back_to_list') }}</a> | ||
</div> | ||
</div> | ||
|
||
<div class="card-body"> | ||
<form method="POST" action="{{ route($routeName . '.store') }}"> | ||
@csrf | ||
|
||
@include('role-creator::bootstrap5.form') | ||
|
||
<hr> | ||
<button type="submit" id="submit" class="btn {{ $cssClass['btn'] }} float-end">{{ trans('role-creator::sp_role_creator.save') }}</button> | ||
</form> | ||
</div> | ||
</div> | ||
</section> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@extends(config('role-creator.layout_name')) | ||
|
||
@section(config('role-creator.section_name')) | ||
<section class="{{ $cssClass['container'] }}"> | ||
<div class="{{ $cssClass['card'] }}"> | ||
<div class="card-header"> | ||
<div class="d-flex justify-content-between"> | ||
<h4 class="m-0">{{ trans('role-creator::sp_role_creator.role_edit') }}</h4> | ||
<a class="btn {{ $cssClass['btn'] }}" href="{{ route($routeName . '.index') }}">{{ trans('role-creator::sp_role_creator.back_to_list') }}</a> | ||
</div> | ||
</div> | ||
|
||
<div class="card-body"> | ||
<form method="POST" action="{{ route($routeName . '.update', $data->id) }}"> | ||
@csrf | ||
@method('PUT') | ||
|
||
@include('role-creator::bootstrap5.form') | ||
|
||
<hr> | ||
<button type="submit" id="submit" class="btn {{ $cssClass['btn'] }} float-end">{{ trans('role-creator::sp_role_creator.update') }}</button> | ||
</form> | ||
</div> | ||
</div> | ||
</section> | ||
@endsection |
Oops, something went wrong.