<?php $pageTitle='Create a usergroup';
include realpath(__DIR__).'/../_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/usergroup/',
        classes: 'create',
        method: 'post'
    });
    frm.textField({ label:"Name", name:'name' });
	frm.textField({ label:"Description", name:'description' });

	frm.dropdown({ label:'Group visibility', name:'groupvisibility',
		options:[{ label:'Hidden',value:'hidden'}, {label:'Members only',value:'membersonly'}, {label:'Visible',value:'visible'}],
		value:'visible'
	 });

	frm.dropdown({ label:'Membership visibility', name:'membershipvisibility', 
		options:[{ label:'Hidden',value:'hidden'}, {label:'Members only',value:'membersonly'}, {label:'Visible',value:'visible'}] });

	//	frm.dropdown({ label:'Joining the group', name:'joining',
	//		options:[{ label:'Closed',value:'closed'}, {label:'Request',value:'request'}, {label:'Open',value:'open'}] });

	frm.createButton();

	frm.hiddenField({ name:'joining', value:'closed' });

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