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

    const headers = ['Name', 'Project', 'Description'];
    const cellTemplates = ['<a href="/plate/{{id}}">{{name}}</a>', [Project.getLink,'name'], '{{description}}'];
    ui.grid().box({
		classes:'r1 c1 h3 w3',
		url:'/api/plate?sortby=id&sortdescending=yes',
		headers:headers,
        showFilters:[true,true,true],
        sortOrders:['name','project.name','description'],
		cellTemplates:cellTemplates
	});

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