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.
 
 
 
 
 

85 lines
4.6 KiB

<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('lang.roles_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.roles') }}</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', 'Name') !!}
{!! Form::text('name', null, ['class' => 'form-control', 'placeholder' => 'Role 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', 'Guard name') !!}
{!! Form::text('guard_name', null, ['class' => 'form-control', 'placeholder' => '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">Close</button>
<!-- Submit Form Button -->
{!! Form::submit('Submit', ['class' => 'btn btn-primary']) !!}
</div>
{!! Form::close() !!}
</div>
</div>
</div>
<div class="row">
<div class="col-md-5">
<h3>{{ __('lang.roles') }}</h3>
</div>
<div class="col-md-7 page-action text-right">
@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.new_user") }}</button>
@endcan
</div>
</div>
@forelse ($roles as $role)
{!! Form::model($role, ['method' => 'PUT', 'route' => ['roles.update', $role->id ], 'class' => 'm-b']) !!}
@if($role->name === 'Super Admin')
@include('shared._permissions', [
'title' => $role->name .' Permissions - for ' . $role->guard_name,
'options' => ['disabled'] ])
@else
@include('shared._permissions', [
'title' => $role->name .' Permissions - for ' . $role->guard_name,
'model' => $role ])
@can('edit_roles')
{!! Form::submit(__("lang.save"), ['class' => 'btn btn-primary']) !!}
@endcan
@endif
{!! Form::close() !!}
@empty
<p>No Roles defined, please run <code>php artisan db:seed</code> to seed some dummy data.</p>
@endforelse
</div>
</div>
</div>
</div>
</x-app-layout>