<?php
namespace JetApplicationModule\Admin\EventViewer\REST;

use Jet\UI_button;
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();

$filter_form->renderer()->setDefaultLabelWidth([]);
$filter_form->renderer()->setDefaultFieldWidth([]);

$grid->getColumn( Listing_Column_ID::KEY )->addCustomCssStyle( 'width:120px;' );

?>
<?=$filter_form->start()?>
<div class="row toolbar">

	<div class="col-md-3 col-sm-12">
		<?php require 'list/export.phtml'; ?>
	</div>
	<div class="col-md-9 col-sm-12" style="display: grid;grid-template-columns: 130px 300px 10px 130px 300px;align-items: center;gap: 10px;">
		<div style="grid-column: span 5;">
			<?=$listing->filter(Listing_Filter_Search::KEY)->renderForm()?>
		</div>
		
		<?=$listing->filter(Listing_Filter_DateTime::KEY)->renderForm()?>
		<?=$listing->filter(Listing_Filter_EventClass::KEY)->renderForm()?>
		<div></div>
		<?=$listing->filter(Listing_Filter_Event::KEY)->renderForm()?>
		<?=$listing->filter(Listing_Filter_User::KEY)->renderForm()?>
		<div></div>
		<?=$listing->filter(Listing_Filter_ContextObject::KEY)->renderForm()?>
		<div style="grid-column: span 5;text-align: right">
			<?=UI::button(Tr::_('Filter'))->setClass( UI_button::CLASS_PRIMARY )->setType( UI_button::TYPE_SUBMIT )?>
		</div>

	</div>

</div>
<?=$filter_form->end()?>

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