<?php $__env->startSection("content"); ?>
<div>
    <ol class="breadcrumb">
      <li><a href="<?php echo e(URL::route('user.index')); ?>">Users</a></li>
				<li><a href="<?php echo e(URL::route('role.assign')); ?>">Assign Roles</a></li>
			<li><a href="<?php echo e(URL::route('permission.index')); ?>"> Permissions</a></li>
      <li class="active"><?php echo Lang::choice('messages.role', 2); ?></li>
    </ol>
</div>
<?php if(Session::has('message')): ?>
    <div class="alert alert-info"><?php echo Session::get('message'); ?></div>
<?php endif; ?>
<div class="col-md-8 col-md-offset-1">
  <div  class="panel panel-default row" style="width:118%">
    <div class="panel-heading ">
        <span class="glyphicon glyphicon-user"></span>
        <?php echo Lang::choice('messages.role', 2); ?>

        <div class="panel-btn">
            <a class="btn btn-sm btn-info" href="<?php echo URL::to("role/create"); ?>" >
                <span class="glyphicon glyphicon-plus-sign"></span>
                <?php echo trans('messages.new-role'); ?>

            </a>
        </div>
    </div>
    <div class="panel-body">
        <table class="table table-striped table-hover table-condensed">
            <thead>
                <tr>
                    <th><?php echo Lang::choice('messages.name', 1 ); ?></th>
                    <th><?php echo trans('messages.description'); ?></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
            <?php $__empty_1 = true; foreach($roles as $role): $__empty_1 = false; ?>
                <tr <?php if(Session::has('activerole')): ?>
                            <?php echo (Session::get('activerole') == $role->id)?"class='info'":""; ?>

                        <?php endif; ?>>
                    <td><?php echo $role->name; ?></td>
                    <td><?php echo $role->description; ?></td>
                    <td>
                        <a class="btn btn-sm btn-info <?php echo ($role == Role::getAdminRole()) ? 'disabled': ''; ?>"
                            href="<?php echo URL::to("role/" . $role->id . "/edit"); ?>" >
                            <span class="glyphicon glyphicon-edit"></span>
                            <?php echo trans('messages.edit'); ?>

                        </a>
                        <button class="btn btn-sm btn-danger delete-item-link <?php echo ($role == Role::getAdminRole()) ? 'disabled': ''; ?>"
                            data-toggle="modal" data-target=".confirm-delete-modal"
                            data-id='<?php echo URL::to("role/" . $role->id . "/delete"); ?>'>
                            <span class="glyphicon glyphicon-trash"></span>
                            <?php echo trans('messages.delete'); ?>

                        </button>
                    </td>
                </tr>
            <?php endforeach; if ($__empty_1): ?>
                <tr><td colspan="2"><?php echo trans('messages.no-roles-found'); ?></td></tr>
            <?php endif; ?>
            </tbody>
        </table>
        <?php echo $roles->links();
        Session::put('SOURCE_URL', URL::full());?>
    </div>
</div>
	<footer class="text-center"> <?php echo HTML::link('http://www.cphl.go.ug', '&copy; UNHLS  ' . date("Y")); ?></footer>
<?php $__env->stopSection(); ?>

<?php echo $__env->make("layout", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>