<?php
namespace JetApplicationModule\Admin\ManageAccess\Administrators\Roles;

use Jet\UI;

use Jet\Tr;
use Jet\MVC_View;

/**
 * @var MVC_View $this
 * @var Listing $listing
 */
$listing = $this->getRaw( 'listing' );
$grid = $listing->getGrid();
$filter_form = $listing->getFilterForm();

$router = $this->getController()->getControllerRouter();

$grid->getColumn( 'id' )->addCustomCssStyle( 'width:120px;' );
$grid->getColumn( '_edit_' )->addCustomCssStyle( 'width:180px;' );
?>

<?= $filter_form->start() ?>
<div class="row toolbar">
	<div class="col-xs-5 col-md-2">
		<?php if( ($add_uri = $router->action( 'add' )->URI()) ): ?>
			<?= UI::button_create( Tr::_( 'Create a new Role' ) )->setUrl( $add_uri ) ?>
		<?php endif; ?>
	</div>
	<div class="col-xs-7 col-md-3">
		<?=$listing->filter(Listing_Filter_Search::KEY)->renderForm()?>
	</div>
</div>
<?= $filter_form->end() ?>

<div class="row">
	<div class="col-md-12">
		<?= $grid->render(); ?>
	</div>
</div>
