<!--{include file="<!--{$oapath}-->public/ins_popup.tpl"}-->
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<div class="popup-fixed">
		<div class="popup-header clearfix">
			<div class="pull-left">
				<h1>添加菜单</h1>
			</div>
			<div class="pull-right">
				<a onclick="save();" class="btn btn-sm btn-primary">确定</a>
				<a onclick="myclose();" class="btn btn-sm btn-default">关闭</a>
			</div>
		</div>
		<div class="popup-body" style="height: 420px;overflow-y: auto;">
			<form id="form_data" name="form_data" method="post" class="form-horizontal clearfix">
				<input type="hidden" name="ajax" id="ajax" value="1">
				<input type="hidden" name="opmode" id="opmode" value="add">
				<select name="node_list" id="node_list" class="hidden">
					{:fill_option($node_list)}
				</select>
				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="name">名称*：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="name" name="name" check="require" msg="请输入名称">
					</div>
				</div>

				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="url">地址：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="url" name="url">
					</div>
				</div>

				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="url">父节点：</label>
					<div class="col-xs-9">
						<div class="input-group">
							<input name="node_name" class="form-control val" id="node_name" type="text"  readonly="readonly"/>
							<input name="pid"  id="pid" type="hidden" msg="请选择父节点" check="require"  />
							<span class="input-group-btn">
								<button class="btn btn-sm btn-primary" onclick="select_pid()" type="button">
									选择
								</button> </span>
						</div>
					</div>
				</div>
				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="icon">图标：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="icon" name="icon" >
					 <span style="color: gray;">此处为矢量图标,从<a href='http://fontawesome.dashgame.com/' target='_black' style="color: orange;">图标库</a>选择合适的图标,标准格式:fa fa-选择的图标</span>

                                        </div>
				</div>
				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="badge_function">统计函数：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="badge_function" name="badge_function" >
					</div>
				</div>
				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="sort">排序：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="sort" name="sort" >
					</div>
				</div>

				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="is_del">状态*：</label>
					<div class="col-xs-9">
						<select   name="is_del" id="is_del" class="form-control">
							<option  value="0">启用</option>
							<option value="1">禁用</option>
						</select>
					</div>
				</div>
			</form>
		</div>
	</div>
</block>

                                		</div>
		<!-- Mainly scripts -->
		<script src="<!--{$oapath}-->Ins/js/jquery-2.1.1.js"></script>
		<script src="<!--{$oapath}-->Ins/js/bootstrap.min.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<!-- Custom and plugin javascript -->
		<script src="<!--{$oapath}-->Ins/js/inspinia.js"></script>
		<script src="<!--{$oapath}-->Ins/js/common.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/pace/pace.min.js"></script>
                
		<script src="<!--{$oapath}-->Ins/js/plugins/toastr/toastr.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/gritter/jquery.gritter.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/bootbox/bootbox.min.js"></script>
		<block name="js"></block>
		<script>
			$(document).ready(function() {
				$(".popup-container").width($("#dialog", parent.document).width());
				if (is_mobile()) {
					$(".popup-container").height(window.screen.height - 40);
					$(".popup-container").css('overflow', 'auto');
				}
			});
		</script>
 <block name="js">
	<script type="text/javascript">
		function select_pid() {
			winopen("oa.php?c=Node&a=winpop", 560, 470);
		}

		function save() {
			if (check_form("form_data")) {
				var vars = $("#form_data").serialize();
				sendAjax("oa.php?c=Node&a=save", vars, function(data) {
					if (data.status) {
						ui_alert(data.info, function() {
							parent.location.reload(true);
							myclose();
						});
					} else {
						ui_error(data.info);
					}
				});
			}
		}
	</script>

</block>
	</body>
</html>