<!-- INCLUDE overall_header.html -->

<a id="maincontent"></a>

<!-- IF S_EDIT -->

	<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>

	<h1>{L_ACP_GROUPS_MANAGE}</h1>

	<p>{L_GROUP_EDIT_EXPLAIN}</p>

	<!-- IF S_ERROR -->
		<div class="errorbox">
			<h3>{L_WARNING}</h3>
			<p>{ERROR_MSG}</p>
		</div>
	<!-- ENDIF -->

	<form id="settings" method="post" action="{U_ACTION}" enctype="multipart/form-data">

	<fieldset>
		<legend>{L_GROUP_DETAILS}</legend>
	<dl>
		<dt><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}{L_COLON}</label></dt>
		<dd><!-- IF S_SPECIAL_GROUP --><strong>{GROUP_NAME}</strong><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></dd>
	</dl>
	<dl>
		<dt><label for="group_desc">{L_GROUP_DESC}{L_COLON}</label></dt>
		<dd><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea></dd>
		<dd><label><input type="checkbox" class="radio" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE}</label>
			<label><input type="checkbox" class="radio" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label>
			<label><input type="checkbox" class="radio" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</label></dd>
	</dl>
	<!-- IF not S_SPECIAL_GROUP -->
		<dl>
			<dt><label for="group_type">{L_GROUP_TYPE}{L_COLON}</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt>
			<dd>
				{% EVENT acp_group_types_prepend %}
				<label><input name="group_type" type="radio" class="radio" id="group_type" value="{GROUP_TYPE_FREE}"{GROUP_FREE} /> {L_GROUP_OPEN}</label>
				<label><input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_OPEN}"{GROUP_OPEN} /> {L_GROUP_REQUEST}</label>
				<label><input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_CLOSED}"{GROUP_CLOSED} /> {L_GROUP_CLOSED}</label>
				<label><input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_HIDDEN}"{GROUP_HIDDEN} /> {L_GROUP_HIDDEN}</label>
				{% EVENT acp_group_types_append %}
			</dd>
		</dl>
	<!-- ELSE -->
		<input name="group_type" type="hidden" value="{GROUP_TYPE_SPECIAL}" />
	<!-- ENDIF -->

	<!-- IF S_ADD_GROUP and S_GROUP_PERM -->
		<dl>
			<dt><label for="group_perm_from">{L_COPY_PERMISSIONS}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
			<dd><select id="group_perm_from" name="group_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_GROUP_OPTIONS}</select></dd>
		</dl>
	<!-- ENDIF -->
	</fieldset>

	<fieldset>
		<legend>{L_GROUP_OPTIONS_SAVE}</legend>
	<!-- EVENT acp_group_options_before -->
	<!-- IF S_USER_FOUNDER -->
	<dl>
		<dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}{L_COLON}</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt>
		<dd><input name="group_founder_manage" type="checkbox" value="1" class="radio" id="group_founder_manage"{GROUP_FOUNDER_MANAGE} /></dd>
	</dl>
	<!-- ENDIF -->
	<dl>
		<dt><label for="group_skip_auth">{L_GROUP_SKIP_AUTH}{L_COLON}</label><br /><span>{L_GROUP_SKIP_AUTH_EXPLAIN}</span></dt>
		<dd><input name="group_skip_auth" type="checkbox" value="1" class="radio" id="group_skip_auth"{GROUP_SKIP_AUTH} /></dd>
	</dl>
	<dl>
		<dt><label for="group_legend">{L_GROUP_LEGEND}{L_COLON}</label></dt>
		<dd><input name="group_legend" type="checkbox" value="1" class="radio" id="group_legend"{GROUP_LEGEND} /></dd>
	</dl>
	<dl>
		<dt><label for="group_teampage">{L_GROUP_TEAMPAGE}{L_COLON}</label></dt>
		<dd><input name="group_teampage" type="checkbox" value="1" class="radio" id="group_teampage"{GROUP_TEAMPAGE} /></dd>
	</dl>
	<dl>
		<dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}{L_COLON}</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt>
		<dd><input name="group_receive_pm" type="checkbox" value="1" class="radio" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd>
	</dl>
	<!-- EVENT acp_group_options_after -->
	</fieldset>

	<fieldset>
		<legend>{L_GROUP_SETTINGS_SAVE}</legend>
	<dl>
		<dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}{L_COLON}</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt>
		<dd><input name="group_message_limit" type="number" id="group_message_limit" min="0" max="9999" value="{GROUP_MESSAGE_LIMIT}" /></dd>
	</dl>
	<dl>
		<dt><label for="group_max_recipients">{L_GROUP_MAX_RECIPIENTS}{L_COLON}</label><br /><span>{L_GROUP_MAX_RECIPIENTS_EXPLAIN}</span></dt>
		<dd><input name="group_max_recipients" type="number" id="group_max_recipients" min="0" max="9999" value="{GROUP_MAX_RECIPIENTS}" /></dd>
	</dl>
	<dl>
		<dt><label for="group_colour">{L_GROUP_COLOR}{L_COLON}</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
		<dd>
			<input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" />
			<!-- IF GROUP_COLOUR -->&nbsp;<span style="background-color: #{GROUP_COLOUR}">&nbsp; &nbsp;</span><!-- ENDIF -->&nbsp;&nbsp;<span>
			[ <a href="#" id="color_palette_toggle">{L_COLOUR_SWATCH}</a> ]</span>
			<div id="color_palette_placeholder" style="display: none;" data-color-palette="h" data-height="12" data-width="15" data-target="#group_colour"></div>
		</dd>
	</dl>
	<dl>
		<dt><label for="group_rank">{L_GROUP_RANK}{L_COLON}</label></dt>
		<dd><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></dd>
	</dl>
	</fieldset>

	<fieldset>
		<legend>{L_GROUP_AVATAR}</legend>
	<dl>
		<dt><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt>
		<dd class="c-avatar-box">{% if AVATAR_HTML %}{{ AVATAR_HTML }}{% else %}<img src="{{ ADMIN_ROOT_PATH ~ 'images/no_avatar.gif' }}" alt="">{% endif %}</dd>
		<dd><label for="avatar_delete"><input type="checkbox" name="avatar_delete" id="avatar_delete" /> {L_DELETE_AVATAR}</label></dd>
	</dl>
	<dl>
		<dt><label>{L_AVATAR_TYPE}{L_COLON}</label></dt>
		<dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
			<!-- BEGIN avatar_drivers -->
			<option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
			<!-- END avatar_drivers -->
		</select></dd>
	</dl>
	<div id="avatar_options">
	<!-- BEGIN avatar_drivers -->
	<div id="avatar_option_{avatar_drivers.DRIVER}">
		<p>{avatar_drivers.L_EXPLAIN}</p>
		{avatar_drivers.OUTPUT}
	</div>
	<!-- END avatar_drivers -->
	</div>
	</fieldset>

	<fieldset class="submit-buttons">
		<legend>{L_SUBMIT}</legend>
		<input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
		<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
		{S_FORM_TOKEN}
	</fieldset>
	</form>

<!-- ELSEIF S_LIST -->

	<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>

	<h1>{L_GROUP_MEMBERS} :: {GROUP_NAME}</h1>

	<p>{L_GROUP_MEMBERS_EXPLAIN}</p>

	<form id="list" method="post" action="{U_ACTION}">

	<fieldset class="quick">
		<a href="{U_DEFAULT_ALL}">&raquo; {L_MAKE_DEFAULT_FOR_ALL}</a>
	</fieldset>

	<table class="table1 zebra-table">
	<thead>
	<tr>
		<th>{L_USERNAME}</th>
		<th>{L_GROUP_DEFAULT}</th>
		<th>{L_JOINED}</th>
		<th>{L_POSTS}</th>
		<th>{L_MARK}</th>
	</tr>
	</thead>
	<tbody>
	<tr>
		<td class="row3" colspan="5"><strong>{L_GROUP_LEAD}</strong></td>
	</tr>
	<!-- BEGIN leader -->
		<tr>
			<td><!-- IF leader.USERNAME_COLOUR --><a href="{leader.U_USER_EDIT}" style="color: #{leader.USERNAME_COLOUR};" class="username-coloured">{leader.USERNAME}</a><!-- ELSE --><a href="{leader.U_USER_EDIT}">{leader.USERNAME}</a><!-- ENDIF --></td>
			<td style="text-align: center;"><!-- IF leader.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
			<td style="text-align: center;">{leader.JOINED}</td>
			<td style="text-align: center;">{leader.USER_POSTS}</td>
			<td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{leader.USER_ID}" /></td>
		</tr>
	<!-- BEGINELSE -->
		<tr>
			<td colspan="5" style="text-align: center;">{L_GROUPS_NO_MODS}</td>
		</tr>
	<!-- END leader -->
	<tr>
		<td class="row3" colspan="5"><strong>{L_GROUP_APPROVED}</strong></td>
	</tr>
	<!-- BEGIN member -->
		<!-- IF member.S_PENDING -->
		<tr>
			<td class="row3" colspan="5"><strong>{L_GROUP_PENDING}</strong></td>
		</tr>
		<!-- ELSE -->
		<tr>
			<td><!-- IF member.USERNAME_COLOUR --><a href="{member.U_USER_EDIT}" style="color: #{member.USERNAME_COLOUR};" class="username-coloured">{member.USERNAME}</a><!-- ELSE --><a href="{member.U_USER_EDIT}">{member.USERNAME}</a><!-- ENDIF --></td>
			<td style="text-align: center;"><!-- IF member.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
			<td style="text-align: center;">{member.JOINED}</td>
			<td style="text-align: center;">{member.USER_POSTS}</td>
			<td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{member.USER_ID}" /></td>
		</tr>
		<!-- ENDIF -->
	<!-- BEGINELSE -->
		<tr>
			<td colspan="5" style="text-align: center;">{L_GROUPS_NO_MEMBERS}</td>
		</tr>
	<!-- END member -->
	</tbody>
	</table>
	<div class="pagination">
	<!-- IF .pagination -->
		<!-- INCLUDE pagination.html -->
	<!-- ENDIF -->
	</div>

	<fieldset class="quick">
		<select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select>
		<input class="button2" type="submit" name="update" value="{L_SUBMIT}" />
		<p class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>
	</fieldset>

	<h1>{L_ADD_USERS}</h1>

	<p>{L_ADD_USERS_EXPLAIN}</p>

	<fieldset>
		<legend>{L_ADD_USERS}</legend>
	{% EVENT acp_groups_add_user_options_before %}
	<dl>
		<dt><label for="leader">{L_USER_GROUP_LEADER}{L_COLON}</label></dt>
		<dd><label><input name="leader" type="radio" class="radio" value="1" /> {L_YES}</label>
			<label><input name="leader" type="radio" class="radio" id="leader" value="0" checked="checked" /> {L_NO}</label></dd>
	</dl>
	<dl>
		<dt><label for="default">{L_USER_GROUP_DEFAULT}{L_COLON}</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></dt>
		<dd><label><input name="default" type="radio" class="radio" value="1" /> {L_YES}</label>
			<label><input name="default" type="radio" class="radio" id="default" value="0" checked="checked" /> {L_NO}</label></dd>
	</dl>
	{% EVENT acp_groups_add_user_usernames_before %}
	<dl>
		<dt><label for="usernames">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt>
		<dd><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea></dd>
		<dd><!-- EVENT acp_groups_find_username_prepend -->[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]<!-- EVENT acp_groups_find_username_append --></dd>
	</dl>
	{% EVENT acp_groups_add_user_options_after %}

	<p class="quick">
		<input class="button2" type="submit" name="addusers" value="{L_SUBMIT}" />
	</p>
	{S_FORM_TOKEN}
	</fieldset>
	</form>

<!-- ELSE -->

	<h1>{L_ACP_GROUPS_MANAGE}</h1>

	<p>{L_ACP_GROUPS_MANAGE_EXPLAIN}</p>

	<!-- IF S_ERROR -->
		<div class="errorbox">
			<h3>{L_WARNING}</h3>
			<p>{ERROR_MSG}</p>
		</div>
	<!-- ENDIF -->

	<h1>{L_USER_DEF_GROUPS}</h1>

	<p>{L_USER_DEF_GROUPS_EXPLAIN}</p>

	<form id="acp_groups" method="post" action="{U_ACTION}">

	<!-- EVENT acp_groups_manage_before -->
	<table class="table1">
		<col class="col1" /><col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" />
	<thead>
	<tr>
		<th style="width: 50%">{L_GROUP}</th>
		<th>{L_TOTAL_MEMBERS}</th>
		<th>{L_PENDING_MEMBERS}</th>
		<th colspan="2">{L_OPTIONS}</th>
		<th>{L_ACTION}</th>
	</tr>
	</thead>
	<tbody>
	<!-- BEGIN groups -->
		<!-- IF groups.S_SPECIAL -->
		<!-- IF groups.S_FIRST_ROW -->
			<tr>
				<td colspan="6" class="row3">{L_NO_GROUPS_CREATED}</td>
			</tr>
		<!-- ENDIF -->
	</tbody>
	</table>
	<!-- EVENT acp_groups_manage_after -->

	<fieldset class="quick">
		<!-- IF S_GROUP_ADD -->
			{L_CREATE_GROUP}{L_COLON} <input type="text" name="group_name" value="" /> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
			<input type="hidden" name="add" value="1" />
		<!-- ENDIF -->
		{S_FORM_TOKEN}
	</fieldset>
	</form>

	<h1>{L_SPECIAL_GROUPS}</h1>

	<p>{L_SPECIAL_GROUPS_EXPLAIN}</p>

	<table class="table1">
		<col class="col1" /><col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" />
	<thead>
	<tr>
		<th style="width: 50%">{L_GROUP}</th>
		<th>{L_TOTAL_MEMBERS}</th>
		<th>{L_PENDING_MEMBERS}</th>
		<th colspan="2">{L_OPTIONS}</th>
		<th>{L_ACTION}</th>
	</tr>
	</thead>
	<tbody>
		<!-- ELSE -->
		<tr>
			<td><strong<!-- IF groups.GROUP_COLOR --> style="color: #{groups.GROUP_COLOR}"<!-- ENDIF -->>{groups.GROUP_NAME}</strong></td>
			<td style="text-align: center;">{groups.TOTAL_MEMBERS}</td>
			<td style="text-align: center;">{groups.PENDING_MEMBERS}</td>
			<td style="text-align: center;"><a href="{groups.U_EDIT}">{L_SETTINGS}</a></td>
			<td style="text-align: center;"><a href="{groups.U_LIST}">{L_MEMBERS}</a></td>
			<td style="text-align: center;"><!-- IF not groups.S_GROUP_SPECIAL and groups.U_DELETE --><a href="{groups.U_DELETE}" data-ajax="row_delete">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
		</tr>
		<!-- ENDIF -->
	<!-- END groups -->
	</tbody>
	</table>

<!-- ENDIF -->

<!-- INCLUDE overall_footer.html -->
