{%- from "admin/_macros.html" import menus_tree with context -%}
<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Flask_Backstage</title>
	<!-- Tell the browser to be responsive to screen width -->
	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<!-- Bootstrap 3.3.6 -->
	<link rel="stylesheet" href="{{ url_for('admin.static', filename='css/bootstrap.min.css') }}">

	<!-- Font Awesome -->
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
	<!-- Ionicons -->
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
	<!-- Theme style -->
	<link rel="stylesheet" href="{{ url_for('admin.static', filename='css/AdminLTE.min.css') }}">

	<link rel="stylesheet" href="{{ url_for('admin.static', filename='css/skin-blue.min.css') }}">

    <link rel="stylesheet" href="{{ url_for('admin.static', filename='css/backstage.css') }}">

	{%- block css -%}{% endblock %}
</head>

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
	{% block header %}
		<!-- 顶部标题栏开始 -->
		<header class="main-header">
			<!-- Logo -->
			<a href="#" class="logo">
				<span class="logo-mini"><b>B</b>S</span>
				<span class="logo-lg"><b>Back</b>Stage</span>
			</a>
			<!-- Header Navbar: style can be found in header.less -->
			<nav class="navbar navbar-static-top">
				<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
					<span class="sr-only">Toggle navigation</span>
				</a>
				<div class="navbar-custom-menu">
					<ul class="nav navbar-nav">
						<!-- User Account: style can be found in dropdown.less -->
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown">
								<span class="hidden-xs">{{ current_user.username }}</span>
							</a>
							<ul class="dropdown-menu" style="min-width: inherit">
								<li>
									<a href="{{ url_for('admin.login_out') }}">退出</a>
								</li>
							</ul>
						</li>
					</ul>
				</div>
			</nav>
		</header>
		<!-- 顶部标题栏结束 -->
	{% endblock %}

	<!-- 侧边栏 -->
	{% block aside %}
	<aside class="main-sidebar">
		<section class="sidebar">
			<ul class="sidebar-menu">
				{% if current_user.role == 300 %}
					<li class="treeview">
						<a href="{{ url_for('admin.menu_list') }}">
							<i class="fa fa-dashboard"></i> <span>菜单管理</span>
							<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
						</a>
					</li>
					<li class="treeview">
						<a href="{{ url_for('admin.role_list') }}">
							<i class="fa fa-dashboard"></i> <span>角色管理</span>
							<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
						</a>
					</li>
                    <li class="treeview">
						<a href="{{ url_for('admin.user_list') }}">
							<i class="fa fa-dashboard"></i> <span>用户管理</span>
							<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
						</a>
					</li>
				{% endif %}
				{% for m in menus_list %}
				<li class="active treeview">
					<a href="{% if m.child %}#{% else %}{{ m.my.url | safe }}{% endif %}">
						<i class="fa fa-dashboard"></i> <span>{{ m.my.name }}</span>
						<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
					</a>
					{% if m.child %}
						<ul class="treeview-menu">
							{{ menus_tree(m.child) }}
						</ul>
					{% endif %}
				</li>
				{% endfor %}
			</ul>
		</section>
	</aside>
	<!-- 侧边栏结束 -->
	{% endblock %}


	{#中间自定义内容区域#}
	{% block content %}{% endblock %}
</div>

<!-- 主体内容结束 -->

<script src="{{ url_for('admin.static', filename='js/jquery-2.2.3.min.js') }}"></script>
<!-- Bootstrap 3.3.6 -->
<script src="{{ url_for('admin.static', filename='js/bootstrap.min.js') }}"></script>
<script src="{{ url_for('admin.static', filename='js/app.min.js') }}"></script>
{%- block js -%}{%- endblock -%}
</body>

</html>
