<?php

    /**
	 * @var \App\View\AppView $this
	 * @var Icing\Model\Entity\Role|\Cake\Collection\CollectionInterface $role
	 */
	$this->assign('title', 'Edit Role');

	$this->Breadcrumbs->add('Roles', ['action' => 'index']);

	$this->PageActions->group('top-right')->delete($role);

?>


<?= $this->Form->create($role) ?>

<div class="row">
    <div class="col-md-6 col-lg-4">
        <div class="card">
            <div class="card-header">
                <h2 class="card-title h4 m-0">Role Details</h2>
            </div>
            <div class="card-body">
				<?= $this->Form->control('id'); ?>
				<?= $this->Form->control('name'); ?>
				<?= $this->Form->control('description'); ?>

            </div>
        </div>
    </div>
    <div class="col">
        <div class="card">
            <div class="card-header">
                <h3 class="card-title">Permissions</h3>
            </div>
            <div class="card-body">
				<?= $this->Form->control('permissions._ids', [
					'multiple' => 'checkbox',
					'label' => false,
                    'switch' => true,
                    'container' => ['class' => 'row'],
                    'templateVars' => [
                        'variant' => ' col-6 col-sm-12 col-md-6 col-lg-4'
                    ]
				]) ?>
            </div>
        </div>
    </div>
</div>


<?php
	$this->PageActions
		->group('bottom-right')->submit()
		->group('bottom-left')->cancel();
?>
<?= $this->Form->end() ?>

<?php

	$this->PageActions->appendLink(
		'Cancel',
		['action' => 'index'],
		['class' => 'btn btn-secondary'],
		'left'
	);
?>

