github.com/kotovmak/go-admin@v1.1.1/template/login/template.go (about)

     1  package login
     2  
     3  const loginTmpl = `{{define "login_theme1"}}
     4      <!DOCTYPE html>
     5      <!--[if lt IE 7]>
     6      <html class="no-js lt-ie9 lt-ie8 lt-ie7">
     7      <![endif]-->
     8      <!--[if IE 7]>
     9      <html class="no-js lt-ie9 lt-ie8">
    10      <![endif]-->
    11      <!--[if IE 8]>
    12      <html class="no-js lt-ie9">
    13      <![endif]-->
    14      <!--[if gt IE 8]><!-->
    15      <html class="no-js">
    16      <!--<![endif]-->
    17      <head>
    18          <meta charset="utf-8">
    19          <meta http-equiv="X-UA-Compatible" content="IE=edge">
    20          <title>{{.Title}}</title>
    21          <meta name="viewport" content="width=device-width, initial-scale=1">
    22  
    23          <link rel="stylesheet" href="{{link .CdnUrl .UrlPrefix "/assets/login/dist/all.min.css"}}">
    24  
    25          <!--[if lt IE 9]>
    26          <script src="{{link .CdnUrl .UrlPrefix "/assets/login/dist/respond.min.js"}}"></script>
    27          <![endif]-->
    28  
    29      </head>
    30      <body>
    31  
    32      <div class="container">
    33          <div class="row" style="margin-top: 80px;">
    34              <div class="col-md-4 col-md-offset-4">
    35                  <form action="##" onsubmit="return false" method="post" id="sign-up-form" class="fh5co-form animate-box"
    36                        data-animate-effect="fadeIn">
    37                      <h2>{{.Title}}</h2>
    38                      <div class="form-group">
    39                          <label for="username" class="sr-only">Username</label>
    40                          <input type="text" class="form-control" id="username" placeholder="{{lang "username"}}"
    41                                 autocomplete="off">
    42                      </div>
    43                      <div class="form-group">
    44                          <label for="password" class="sr-only">Password</label>
    45                          <input type="password" class="form-control" id="password" placeholder="{{lang "password"}}"
    46                                 autocomplete="off">
    47                      </div>
    48                      <div class="form-group">
    49                          <button class="btn btn-primary" onclick="submitData()">{{lang "login"}}</button>
    50                      </div>
    51                  </form>
    52              </div>
    53          </div>
    54          <div class="row" style="padding-top: 60px; clear: both;">
    55              <div class="col-md-12 text-center">
    56                  <p>
    57                      <small>&copy; All Rights Reserved. GoAdmin</small>
    58                  </p>
    59              </div>
    60          </div>
    61      </div>
    62  
    63      <div id="particles-js">
    64          <canvas class="particles-js-canvas-el" width="1606" height="1862" style="width: 100%; height: 100%;"></canvas>
    65      </div>
    66  
    67      <script src="{{link .CdnUrl .UrlPrefix "/assets/login/dist/all.min.js"}}"></script>
    68  
    69      <script>
    70          function submitData() {
    71              $.ajax({
    72                  dataType: 'json',
    73                  type: 'POST',
    74                  url: '{{.UrlPrefix}}/signin',
    75                  async: 'true',
    76                  data: {
    77                      'username': $("#username").val(),
    78                      'password': $("#password").val()
    79                  },
    80                  success: function (data) {
    81                      location.href = data.data.url
    82                  },
    83                  error: function (data) {
    84                      alert('{{lang "login fail"}}');
    85                  }
    86              });
    87          }
    88      </script>
    89  
    90      </body>
    91      </html>
    92  {{end}}`