<?php $pageTitle='Crystals';
$showCreateLink=false;
include realpath(__DIR__).'/../../core/_common/header.php'; ?>
<script type="text/javascript">
window.addEventListener('DOMContentLoaded',function(){

    const sortOrders = ['', 'plate.name', '', 'project.name'];
    const headers = ['Image', 'Plate', 'Crystal', 'Project'];
    const cellTemplates = [
        [Crystal.getThumbnailLink, 'id'],
        '<a href="/plate/{{plateid}}">{{platename}}</a>',
        [Crystal.getTextLink, 'id'],
        [Project.getLink,'name']
    ];

    ui.grid().box({
		classes:'r1 c1 h3 w3',
		url:'/api/crystal',
		headers:headers,
		cellTemplates:cellTemplates,
		sortOrders:sortOrders
	});


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