<?php $__env->startSection('style'); ?>
    <link href="<?php echo e(asset('js/advanced-datatable/css/demo_page.css')); ?>" rel="stylesheet" />
    <link href="<?php echo e(asset('js/advanced-datatable/css/demo_table.css')); ?>" rel="stylesheet" />
    <link rel="stylesheet" href="<?php echo e(asset('js/data-tables/DT_bootstrap.css')); ?>" />
    <?php $__env->stopSection(); ?>

    <?php $__env->startSection('content'); ?>

            <!--body wrapper start-->
    <div class="wrapper">
        <?php echo $__env->make('partials.message', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <div class="row">
            <div class="col-sm-12">
                <section class="panel">
                    <header class="panel-heading">
                        <?php echo e(trans('ui.role.names')); ?>

                        <span class="tools pull-right">
                <a href="javascript:;" class="fa fa-chevron-down"></a>
             </span>
                    </header>
                    <div class="panel-body">
                        <div class="adv-table">
                            <?php if(Auth::user()->can('create-roles')): ?>
                                <a href="<?php echo e(url('auth/role/create')); ?>"><button class="btn btn-primary pull-right" type="button"><i class="fa fa-plus-circle"></i> <?php echo e(trans("ui.role.button_add")); ?></button></a>
                            <?php endif; ?>
                            <table  class="display table table-bordered table-striped" id="dynamic-table">
                                <thead>
                                <tr>
                                    <th><?php echo e(trans('ui.role.name_label')); ?></th>
                                    <th><?php echo e(trans('ui.role.display')); ?></th>
                                    <th><?php echo e(trans('ui.role.description')); ?></th>
                                    <th><?php echo e(trans('ui.permission.names')); ?></th>
                                    <?php if(Auth::user()->can(['update-roles', 'delete-roles'])): ?>
                                        <th><?php echo e(trans('ui.role.operation_label')); ?></th>
                                    <?php endif; ?>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach($roles as $role): ?>

                                    <tr class="gradeX">
                                        <td><?php echo e($role->name); ?></td>
                                        <td><?php echo e($role->display_name); ?></td>
                                        <td><?php echo e($role->description); ?></td>
                                        <td><ul>
                                                <?php foreach($role->permissions as $permission): ?>
                                                    <li>
                                                        <?php echo e($permission->display_name); ?>

                                                    </li>
                                                <?php endforeach; ?>
                                            </ul></td>
                                        <?php if(Auth::user()->can(['update-roles', 'delete-roles'])): ?>
                                            <td>
                                                    <?php if(Auth::user()->can('update-roles')): ?>
                                                        <a href="<?php echo e(url('auth/role/' . $role->id . '/edit')); ?>">
                                                            <i class="fa fa-refresh"></i>
                                                        </a>
                                                    <?php endif; ?>
                                                    <?php if(Auth::user()->can('delete-roles')): ?>
                                                            <?php echo Form::open(['url' => 'auth/role/'. $role->id, 'method' => 'delete','style'=>'display:inline-block;']); ?>

                                                            <button class="delete-button" type="submit"><i class="fa fa-times-circle"></i></button>
                                                            <?php echo Form::close(); ?>

                                                    <?php endif; ?>
                                            </td>
                                        <?php endif; ?>
                                    </tr>
                                <?php endforeach; ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </section>
            </div>
        </div>
    </div>
    <?php $__env->stopSection(); ?>

    <?php $__env->startSection('script'); ?>
            <!--dynamic table-->
    <script type="text/javascript" language="javascript" src="<?php echo e(asset('js/advanced-datatable/js/jquery.dataTables.js')); ?>"></script>
    <script type="text/javascript" src="<?php echo e(asset('js/data-tables/DT_bootstrap.js')); ?>"></script>
    <!--dynamic table initialization -->
    <script src="<?php echo e(asset('js/dynamic_table_init.js')); ?>"></script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>