<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html metal:use-macro="container/page_macro/macros/master_page">

<span tal:omit-tag="" metal:fill-slot="main_content_slot">
	<span tal:define="global qcat string:" />
	<span tal:omit-tag="" tal:condition="exists:request/qcat">
		<span tal:omit-tag="" tal:define="global qcat request/qcat" />
	</span>
	<form action="manageCategories_handler" method="post">
		<table tal:define="catalog python:context.getCatForCat(qcat)">
			<p>
			</p>
			<tr>
				<td i18n:translate="">Title of the new category:</td>
				<td>
					<input type="text" value="" name="newCat" />
				</td>
			</tr>
			<tr>
				<td i18n:translate="">Create it as a sub-category under:</td>
				<td>
					<select name="underCat" tal:condition="python:len(context.getAllCategories())>0">
						<option value="" selected="selected" i18n:translate="">None</option>
						<span tal:omit-tag="" tal:repeat="x context/treePrinter">
							<option tal:attributes="value python:x[1]" tal:content="python:x[0]+' '+context.getNameForID(x[1])"></option>
						</span>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" name="saveB" value="Save" i18n:attributes="value"/></td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td tal:define="grandparent python:context.getParentForID(context.getParentForID(catalog[0]))">
					<a href="" i18n:translate="" tal:condition="qcat" tal:attributes="href python:'?qcat='+grandparent">Up</a>
				</td>
			</tr>
			<tr>
				<td colspan="2"><label tal:omit-tag="" i18n:translate="">Current category:</label> <input type="text" cols="80" name="newname" tal:attributes="value python:context.getNameForID(context.getParentForID(catalog[0]))" />
					<input type="hidden" name="renaming" value="" tal:attributes="value python:context.getParentForID(catalog[0])" />
					<input type="submit" name="renameB" value="Rename" i18n:attributes="value" />
				</td>
			</tr>
			<tr tal:repeat="x catalog">
				<td colspan="2">
					<input type="checkbox" value="" tal:attributes="value x" name="deletec" />
					<a href="" tal:attributes="href string:?qcat=$x" tal:content="python:context.getNameForID(x)" />
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<input type="submit" name="deleteB:list" value="Delete" i18n:attributes="value" />
				</td>
			</tr>
		</table>
	</form>
</span>

</html>
