<header class="main-header">
    <!-- Logo -->
    <a href="/front/index" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><b>ValidationPlatform</b></span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><b>Validation Platform</b></span>
    </a>
    <!-- Header Navbar -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>
      <!-- Navbar Right Menu -->
      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- User Account Menu -->
          	<li class="dropdown user user-menu">
            <!-- Menu Toggle Button -->
            <a href="#" class="dropdown-toggle" data-toggle="modal" data-target="#modal-topuserinfo">
              <!-- The user image in the navbar-->
              <img src="/dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
              <!-- hidden-xs hides the username on small devices so only the image appears. -->
           		<span class="hidden-xs">{{(session "user").s_login}}</span>
			</a>
          	</li>
			<li><a href="/front/logout"><span class="hidden-xs">注销</span></a></li>
        </ul>
      </div>
    </nav>
</header>

<!-- common modal -->  
<div id="com-alert" class="modal" style="z-index:9999;display: none;" >  
    <div class="modal-dialog modal-sm">  
      <div class="modal-content">  
        <div class="modal-header">  
          <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>  
          <h5 class="modal-title"><i class="fa fa-exclamation-circle"></i> [Title]</h5>  
        </div>  
        <div class="modal-body small">  
          <p>[Message]</p>  
        </div>  
        <div class="modal-footer" >  
          <button type="button" class="btn btn-default cancel" data-dismiss="modal">[BtnCancel]</button>  
          <button type="button" class="btn btn-primary ok" data-dismiss="modal">[BtnOk]</button>  
        </div>  
      </div>  
    </div>  
</div>

<div id="modal-topuserinfo" class="modal fade">
  	<div class="modal-dialog">
	    <form id="topuserform" class="form-horizontal" role="form">
		<div class="modal-content">
		    <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
		          <span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title">用户信息</h4>
		    </div>
		    <div class="modal-body">
		     	<div class="form-group">
				    <label class="col-sm-2 control-label">账号:</label>
				    <div class="col-sm-10">
						<input id="t_email" type="email" value={{(session "user").s_login}} class="form-control" disabled>
				    </div>
				</div>
				<div class="form-group">
				    <label class="col-sm-2 control-label">密码:</label>
				    <div class="col-sm-10">
						<input id="t_pwd" type="password" value={{(session "user").s_password}} class="form-control" placeholder="请输入密码">
				    </div>
				</div>
				<div class="form-group">
				    <label class="col-sm-2 control-label">姓名:</label>
				    <div class="col-sm-10">
						<input id="t_name" type="text" value={{(session "user").s_name}} class="form-control" disabled>
				    </div>
				</div>
				<div class="form-group">
				    <label class="col-sm-2 control-label">角色:</label>
				    <div class="col-sm-10">
				     	<select id="t_role" class="form-control" disabled>
							<option value={{(session "user").role}}>
							<script>
								role={{(session "user").role}};
								if(role===2){
									document.write("开发员")
								}else if(role=="1"){
									document.write("管理员")
								}else{
									document.write("系统管理员")
								}
							</script>
							</option>
						</select>
				    </div>
				</div>
				<div class="modal-footer">
			        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			        <button type="button" class="btn btn-primary" onclick="t_save()">保存</button>
	    		</div>	
		    </div>
		</div>
	    <!-- /.modal-content -->
	    </form>
  	</div>
  <!-- /.modal-dialog -->
</div>
<style>.btn-center{ margin:0 auto; height:100px;text-align:center; }</style>
<!-- /.modal -->
<script>
function t_save(){
	pwd=$("#t_pwd").val()
	showConfirm("确定修改？", function() {
		$.ajax({
			url:"/front/updatepwd",
			type:"post",
			data:{"id":{{(session "user").id}},"pwd":pwd},
			success:function(r){
				$("#modal-topuserinfo").modal("hide");
			}
		})
	});
}
</script>