nclick="return confirm ('{"Are you sure you want to cancel and lose any changes?"}')">{"Cancel"}</a>
</p>

</form>

</div>

<script>
$(function () {
	// re-check on re-render
	var resources = {{resources|json_encode}};
	for (var resource in resources) {
		$('#resources-' + resource.replace (/\//g, '-'))[0].checked = true;
	}
	
	// check all if default is checked because
	// then you can subtract resources to deny
	$('#resources-default').change (function () {
		if ($('#resources-default').is (':checked')) {