You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

110 lines
6.0 KiB

<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
@lang('lang.role_management')
</h2>
</x-slot>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<!-- Modal -->
<div class="modal fade" id="roleModal" tabindex="-1" role="dialog" aria-labelledby="roleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
{!! Form::open(['method' => 'post']) !!}
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="roleModalLabel">@lang('lang.permission_create')</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<!-- name Form Input -->
<div class="form-group @if ($errors->has('name')) has-error @endif">
{!! Form::label('name', __('lang.name')) !!}
{!! Form::text('name', null, ['class' => 'form-control', 'placeholder' => __('lang.permission_name')]) !!}
@if ($errors->has('name')) <p class="help-block">{{ $errors->first('name') }}</p> @endif
</div>
<div class="form-group @if ($errors->has('guard_name')) has-error @endif">
{!! Form::label('guard_name', __('lang.guard_name')) !!}
{!! Form::text('guard_name', null, ['class' => 'form-control', 'placeholder' => __('lang.guard_name')]) !!}
@if ($errors->has('guard_name')) <p class="help-block">{{ $errors->first('guard_name') }}</p> @endif
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@lang('lang.close')</button>
<!-- Submit Form Button -->
{!! Form::submit(__('lang.submit'), ['class' => 'btn btn-primary']) !!}
</div>
{!! Form::close() !!}
</div>
</div>
</div>
<div class="row">
<div class="col-md-5">
<h3>@lang('lang.roles')</h3>
</div>
<div class="col-md-7 page-action text-right">
<div class="search-form float-right ml-3">
<form class="input-group " action="{{ route('permissions.index') }}" method="get">
<div class="form-outline">
<input type="search" id="form1" class="form-control" placeholder="@lang('lang.name')" name='name'/>
<!-- <label class="form-label" for="form1">Search</label> -->
</div>
<button type="submit" class="btn btn-info btn-sm">@lang('lang.search')</button>
</form>
</div>
@can('add_roles')
<button type="button" class="btn btn-sm btn-success pull-right" data-toggle="modal" data-target="#roleModal"> <i class="glyphicon glyphicon-plus"></i> @lang('lang.new')</button>
@endcan
</div>
</div>
<div class="result-set">
<table class="table table-bordered table-striped table-hover" id="data-table">
<thead>
<tr>
<th>ID</th>
<th>@lang('lang.name')</th>
<th>@lang('lang.guard')</th>
<th>@lang('lang.created_at')</th>
@can('edit_permission', 'delete_permission')
<th class="text-center">@lang('lang.action')</th>
@endcan
</tr>
</thead>
<tbody>
@foreach($result as $item)
<tr>
<td>{{ $item->id }}</td>
<td>{{ $item->name }}</td>
<td><a href="{{route('permissions.index')}}?guard_name={{ $item->guard_name }}">{{ $item->guard_name }}</a></td>
<td>{{ $item->created_at->toFormattedDateString() }}</td>
@can('edit_permission')
<td class="text-center">
@include('shared._permissions_actions', [
'entity' => 'permissions',
'id' => $item->id
])
</td>
@endcan
</tr>
@endforeach
</tbody>
</table>
<div class="text-center">
{{ $result->links() }}
</div>
</div>
</div>
</div>
</div>
</div>
</x-app-layout>