<%!
    from kaithem.src.util import url
%>

<%include file="/pageheader.html"/>

<title>Editing Group: ${name}</title>

<h2> Group ${name}</h2>
<div class="window paper">

<form action="/auth/updategroup/${url(name)}" method="POST" name="user">

<h3>Basic</h3>
Group Name: <input required="required" name="name" type="text" value="${name}"></input><br>


	<h3>Permissions</h3>

<details class="help"><summary><i class="mdi mdi-help-circle-outline"></i></summary>
All members of this group are entitled to all checked permissions.
</details>
%for i in sorted(auth.Permissions.keys()):
	<br><h4

%if i.startswith('__'):
class="specialentry"\
%endif
>${i}</h4> <input type="checkbox" name="Permission${i}" value="true"\
	%if i in auth.Groups[name]['permissions']:
		checked="yes"\
	%endif
	></input>
	%if isinstance(auth.Permissions[i], str):
	***${auth.Permissions[i]}
	%else:
	${auth.Permissions[i].get('description','No description')}
	%endif
%endfor

<h3>Limits</h3>
<details class="help"><summary><i class="mdi mdi-help-circle-outline"></i></summary>A user has access to the highest value from any of their groups</details>
<table border="1">
	<tr>
		<th>Name</th><th>Value</th>
	</tr>
	<tr>
		<td title="The maximum number of bytes a user can include in an HTTP request body. There is a small default applied even if this is 0">web.maxbytes</td>
		<td><input type=numeric name="maxbytes" value="${auth.Groups[name].get('limits',{}).get('web.maxbytes',0)}">
		</td>
	</tr>
</table>



<br><input value="Save Changes" type="submit">
</form>
</div>

<%include file="/pagefooter.html"/>
