<?php
/** @var array $data The object we are going to view */
$pageTitle='Crystal score: '.$data['name'];
include realpath(__DIR__).'/../../core/_common/header.php'; ?>
<script type="text/javascript">
window.addEventListener('DOMContentLoaded',function(){

    ui.grid();

    const detailsBox=grid.box({
        classes:'r1 c1 h3 w1',
        title:'Details'
    });
    const frm=detailsBox.form({
        action:'/api/crystalscore/'+data['id'],
        method:'post'
    });
    frm.formField({
        label:"Scoring system",
        content:'<a href="/crystalscoringsystem/'+data["crystalscoringsystemid"]+'">'+data["crystalscoringsystemname"]+'<a>'
    });
    frm.textField({ label:"Name", name:'label' }); //Human-friendly name, not database name
    frm.colorField();
    frm.textField({ label:'Score index', name:'scoreindex' });
    frm.textField({ label:'Hotkey', name:'hotkey' });
});

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