login.html 3.67 KB
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>小程序管理平台 | 登录</title>
    {% load staticfiles %}
    <!-- 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.5 -->
    <link rel="stylesheet" href="{% static "bootstrap/css/bootstrap.min.css"%}" >
    <!-- Font Awesome -->
    <link rel="stylesheet" href="{% static "css/font-awesome.min.css"%}">
    <!-- Ionicons -->
    <link rel="stylesheet" href="{% static "css/ionicons.min.css"%}">
    <!-- Theme style -->
    <link rel="stylesheet" href="{% static "css/AdminLTE.min.css"%}">
    <!-- iCheck -->
    <link rel="stylesheet" href="{% static "plugins/iCheck/square/blue.css"%}">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="{% static "js/html5shiv.min.js"%}"></script>
        <script src="{% static "js/respond.min.js"%}"></script>
    <![endif]-->
  </head>
  <body class="hold-transition login-page">
    <div class="login-box">
      <div class="login-logo">
        <a href="/"><b>系统管理平台</b></a>
      </div><!-- /.login-logo -->
      <div class="login-box-body">
        <form name="loginform" action="/login/" method="post" onsubmit="return checkempty();" class="margin-bottom-0" autocomplete="off">
        {% csrf_token %}
          <div class="form-group has-feedback">
            <input type="text" id='username' name='username' class="form-control input-lg" placeholder="用户名" />
            <span class="glyphicon glyphicon-user form-control-feedback"></span>
          </div>
          <div class="form-group has-feedback">
            <input type="password" id='password' name='password' class="form-control input-lg" placeholder="密码" />
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
          </div>
          <div class="row">
            <div class="col-xs-8">
              <div class="checkbox icheck">
                <label>
                {% comment %}
                  <input type="checkbox"> Remember Me
                {% endcomment %}
                </label>
              </div>
            </div><!-- /.col -->
            <div class="col-xs-4">
              <button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
            </div><!-- /.col -->
          </div>
        </form>
        <p style="color:red">注意:本平台不支持IE,请使用chrome或者safari</p>
      </div><!-- /.login-box-body -->
    </div><!-- /.login-box -->


    <script>
        var alert_msg = {{ alert_msg }}
        if (alert_msg == 1){
            alert ('用户名或密码不能为空')};
        if (alert_msg == 2){
            alert ('账号或密码错误')};
    </script>

    <script>
        function checkempty(){
            if ($("#username").val() ==""){
                alert('用户名不能为空');
                 $("#username").focus();
                return false;
            }
            if ($("#password").val() ==""){
                alert('用户名不能为空');
                 $("#password").focus();
                return false;
            }
            return true;
        }
    </script>

    <!-- jQuery 2.1.4 -->
    <script src="{%static "js/jQuery-2.1.4.min.js"%}"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="{%static "js/bootstrap.min.js" %}"></script>
    <!-- iCheck -->
    <script src="{%static "js/icheck.min.js"%}"></script>

  </body>
</html>