<?php $pageTitle='Screens';
/** @noinspection PhpUnhandledExceptionInspection */
$showCreateLink=session::isAdmin() || screen::canCreate();
include realpath(__DIR__).'/../../core/_common/header.php'; ?>
<script type="text/javascript">
window.addEventListener('DOMContentLoaded',function(){


    const headers = ['Name', 'Manufacturer', 'Catalogue number', 'Standard screen', 'Available for use'];
    const cellTemplates = [
        '<a href="/screen/{{id}}">{{name}}</a>', '{{manufacturer}}', '{{catalognumber}}',
        [ui.checkmark, 'isstandard'], [ui.checkmark, 'isavailable']
    ];

    const grid = ui.grid();

    grid.box({
		classes:'r1 c1 h3 w3',
		url:'/api/screen',
		headers:headers,
        showFilters:[true,true,true,false],
        sortOrders:['name','manufacturer','catalognumber','-isstandard',''],
		cellTemplates:cellTemplates
	});


});
</script>
<?php include realpath(__DIR__).'/../../core/_common/footer.php';