<!doctype html>
<html dir="{-:*_LD_-}">
<head>
<meta charset="utf-8" />
<title>{-:@MANAGE-}</title>
{-include:../meta-}
<script>
var GV = {
	_LD_ : '{-:*_LD_-}',
	LANG_NAME : '{-:*LANG_NAME-}',
	URL : {
		SORT_SINGLE_PAGE : '{-url:-url:admin@single_page/_sort_single_page_do?timeKey={$_TK['timeKey']}&token={$_TK['token']}-}'
	}
};
</script>
</head>

<body>
<div class="container margin">

<form id="formSearch" action="" method="post">
<div class="alert">
	{-foreach:$_SPGL,$spg-}
		<a class="btn{-if:$spg['sp_group'] == ARequest::get('sp_group')-} active{-:/if-}" href="{-url:admin@single_page/list_single_page?sp_group={$spg['sp_group']}-}">{-:$spg['sp_group']-}</a>
	{-:/foreach-}
</div>
</form>

<form id="formList" action="" method="post">
<ul class="subnav subnav-tab">
	<li class="active"><a href="#">{-:@SINGLE_PAGE_LIST-}</a></li>
</ul>
<div id="tabContent">
	{-if:empty($_SPL)-}
		<div class="placeholder text-center margin">{-:@SINGLE_PAGE_LIST_EMPTY_TIP-}</div>
	{-else:-}
		<div id="tree-menu" class="margin">
			<span class="btn btn-sm" data-tree-nestable-action="expand-all">{-:@EXPAND_ALL-}</span>
			<span class="btn btn-sm" data-tree-nestable-action="collapse-all">{-:@COLLAPSE_ALL-}</span>
		</div>
		<div class="tree">
{-function:list_page|$spl,$_TK-}
<ul class="tree-list">
{-foreach:$spl,$sp-}
	<li class="tree-item" data-id="{-:$sp['single_page_id']-}" data-sp-group="{-:$sp['sp_group']-}">
		<input type="checkbox" name="single_page_id[{-:$sp['single_page_id']-}]" value="{-:$sp['single_page_id']-}" class="select_sub" />
		<span class="tree-sortable-handle">
			<strong>{-:$sp['sp_title']-} [ID:{-:$sp['single_page_id']-}]</strong>
			<span class="badge badge-info">{-:$sp['sp_group']-}</span>
			<span class="badge{-if:1 == $sp['sp_is_html']-} badge-success{-else:-} badge-muted{-:/if-}" title="{-:$sp['sp_html_naming']-}">{-:$sp['sp_html_naming']|AString::msubstr~30-}</span>
		</span>
		<span class="text-muted text-sm">
			<a href="{-url:home@single_page/show_single_page?single_page_id={$sp['single_page_id']}-}" target="_blank">{-:@PREVIEW-}</a>
			| <a href="{-url:admin@single_page/add_single_page?sp_parent_id={$sp['single_page_id']}-}">{-:@ADD_SUB_SINGLE_PAGE-}</a>
			| <a href="{-url:admin@single_page/edit_single_page?single_page_id={$sp['single_page_id']}-}">{-:@EDIT-}</a>
			| <a href="{-url:admin@single_page/delete_single_page_do?single_page_id={$sp['single_page_id']}&sp_group={$sp['sp_group']}&timeKey={$_TK['timeKey']}&token={$_TK['token']}-}" class="delete_confirm">{-:@DELETE-}</a>
			<a class="btn btn-sm" href="{-url:admin@single_page/build_url_do?single_page_id={$sp['single_page_id']}&sp_group={$sp['sp_group']}&timeKey={$_TK['timeKey']}&token={$_TK['token']}-}">{-:@BUILD_URL-}</a>
			<a class="btn btn-sm" href="{-url:admin@single_page/build_html_do?single_page_id={$sp['single_page_id']}&sp_group={$sp['sp_group']}&timeKey={$_TK['timeKey']}&token={$_TK['token']}-}">{-:@BUILD_HTML-}</a>
		</span>
		{-if:isset($sp['sp_sub_page']) and !empty($sp['sp_sub_page'])-}
			{-call:list_page|$sp['sp_sub_page'],$_TK-}
		{-:/if-}
	</li>
{-:/foreach-}
</ul>
{-:/function-}
		{-call:list_page|$_SPL,$_TK-}
		</div>
	{-:/if-}
</div>
<div id="operation" class="margin">
	<input name="timeKey" type="hidden" value="{-:$_TK['timeKey']-}">
	<input name="token" type="hidden" value="{-:$_TK['token']-}">
	<input name="sp_group" type="hidden" value="{-:%sp_group-}">
	<label class="text-mi"><input type="checkbox" class="select_all" to="single_page_id"> {-:@SELECT_ALL-}</label>
	<a class="btn" href="{-url:admin@single_page/add_single_page-}">{-:@ADD_SINGLE_PAGE-}</a>
	<span class="btn submit" action="{-url:admin@single_page/delete_single_page_do-}" to="#formList">{-:@DELETE_SELECTED-}</span>
	<input class="btn" type="reset" value="{-:@RESET-}">
	<span class="btn submit" action="{-url:admin@single_page/build_url_do-}" to="#formList">{-:@BUILD_URL-}</span>
	<span class="btn submit" action="{-url:admin@single_page/build_html_do-}" to="#formList">{-:@BUILD_HTML-}</span>
</div><!--/#operation-->
</form>

</div>
<script src="{-:*__RES__-}js/loga.js"></script>
<script src="{-:*__RES__-}js/jquery.js"></script>
<script src="{-:*__RES__-}fea/js/fea.min.js"></script>
<script src="{-:*__STYLE__-}js/common.js"></script>
<script src="{-:*__STYLE__-}js/admin.js"></script>
<script src="{-:*__STYLE__-}js/list_single_page.js"></script>
</body>
</html>