<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>{$CONFIG.site_title}</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="/templates/css/all.css" />
		<!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="screen" href="/templates/css/ie.css" /><![endif]-->
		<link rel="icon" href="/templates/img/favicon.ico" type="image/x-icon" />
		<script src="/js/jquery-1.2.6.pack.js" type="text/javascript"></script>
		<script src="/js/jquery.jeditable.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/jquery.tablesorter.min.js"></script>
		<script type="text/javascript" charset="utf-8">
		jQuery(document).ready(function() {ldelim}
		     jQuery(".edit").editable("{$_SERVER.REQUEST_URI}", {ldelim}
			 indicator : "Saving...",
			 tooltip   : 'Click to edit...',
			 onblur    : 'submit'
		 {rdelim});
		jQuery("#sortable").tablesorter(); 
		{rdelim});
		</script>
	</head>
	<body id="activity">
		<div id="pagebody">
			<div id="content_container">
				{include file="$TEMPLATES/includes/header.tpl"}
				<div id="content">
					{include file="$TEMPLATES/includes/admin_side_menu.tpl"}
					<div class="main">
					<table id="sortable">
					<thead>
					<tr>
						<th>Album&nbsp;Category</th>
						<th>Total Albums</th>
						<th>Total Photos</th>
						<th>Delete</th>
					</tr>
					</thead>
					<tbody>
					{section name=row loop=$category_list}
					<tr>
						<td><div class="edit" id="{$category_list[row].type}">{$category_list[row].title}</div></td>
                                                <td>{$category_list[row].num_albums}</td>
						<td>{$category_list[row].num_photos}</td>
						<td>
						{if $category_list[row].num_albums == 0 AND $category_list[row].num_photos == 0}
						<form method="post" action="{$_SERVER.REQUEST_URI}">
						<input type="hidden" name="type" value="{$category_list[row].type}" />
						<input type="submit" value="X" class="input_button" name="delete" />
						</form>
						{else}
						(Cannot delete until there are no associated photos and albums)
						</td>
						{/if}
					</tr>
					{/section}
					</tbody>
					</table>

					<table>
					<thead>
					<tr>
                                                <form method="post" action="{$_SERVER.REQUEST_URI}">
                                                <th><input name="title" class="input_text" /></th>
                                                <th colspan="5"><input type="submit" value="Add New Category" class="input_text" /></th>
                                                </form>
                                        </tr>
					</thead>
					</table>
					</div>
				</div>
			{include file="$TEMPLATES/includes/footer.tpl"}
			</div>
		</div>
	</body>
</html>
