<commit_before>[[/*
  Copyright (c) 2016, <NAME> <<EMAIL>>
  All rights reserved.
  Use of this source code is governed by a BSD-style
  license that can be found in the LICENSE file.
*/]]


[[ define "title" ]]Login - GopherPit[[ end ]]

[[ define "main" ]]
[[ template "login-form" . ]]
[[ end ]]

[[ define "script" ]]
[[ template "login-form-script" . ]]
[[ end ]]

[[ define "login-form" ]]
<div class="column is-4 is-offset-4">
  <h1 class="title is-1 has-text-centered"><img src="[[ "gopherpit.png" | asset ]]" alt="GopherPit" /></h1>
  <form id="login-form" mehtod="post" v-on:submit.prevent="submit" v-bind:class="{'is-disabled': isLoading}">
    <div class="notification is-danger" v-for="err in errors" v-cloak v-html="err"></div>
    <p class="control has-icon">
      <input class="input" type="text" placeholder="Email or username" autofocus v-model="fields.username">
      <i class="fa fa-envelope"></i>
      <p class="control help is-danger" v-for="err in fieldErrors.username" v-cloak v-html="err"></p>
    </p>
    <p class="control has-icon">
      <input class="input" type="password" placeholder="Password" v-model="fields.password">
      <i class="fa fa-lock"></i>
      <p class="control help is-danger" v-for="err in fieldErrors.password" v-cloak v-html="err"></p>
    </p>
    <p class="control">
      <label class="checkbox"><input type="checkbox" v-model="fields.rememberMe">Remember me</label>
    </p>
    <p class="control">
      <nav class="level">
        <div class="level-left">
          <div class="level-item">
            <a class="link" href="/password-reset">Forgot password?</a>
          </div>
        </div>
        <div class="level-right">
          <div class="level-item">
            <a class="button" href="/registration">Register new accunt</a>
            <button type="submit" class="button is-primary" v-bind:class="{'is-loading': isLoading}">Login</button>
          </div>
        </div>
      </nav>
    </p>
  </form>
</div>
[[ end ]]

[[ define "login-form-script" ]]
<script>
  new Vue({
    el: "#login-form",
    data: {
      fields: {
        username: "",
        password: "",
        rememberMe: false
      },
      errors: [],
      fieldErrors: {},
      isLoading: false
    },
    methods: {
      submit: _.throttle(function() {
        httpPost(this, '/i/auth', function(response) {
          window.location.reload()
        })
      }, 500)
    }
  })
</script>
[[ end ]]<commit_msg>Adjust text spacing in login form<commit_after>[[/*
  Copyright (c) 2016, <NAME> <<EMAIL>>
  All rights reserved.
  Use of this source code is governed by a BSD-style
  license that can be found in the LICENSE file.
*/]]


[[ define "title" ]]Login - GopherPit[[ end ]]

[[ define "main" ]]
[[ template "login-form" . ]]
[[ end ]]

[[ define "script" ]]
[[ template "login-form-script" . ]]
[[ end ]]

[[ define "login-form" ]]
<div class="column is-4 is-offset-4">
  <h1 class="title is-1 has-text-centered"><img src="[[ "gopherpit.png" | asset ]]" alt="GopherPit" /></h1>
  <form id="login-form" mehtod="post" v-on:submit.prevent="submit" v-bind:class="{'is-disabled': isLoading}">
    <div class="notification is-danger" v-for="err in errors" v-cloak v-html="err"></div>
    <p class="control has-icon">
      <input class="input" type="text" placeholder="Email or username" autofocus v-model="fields.username">
      <i class="fa fa-envelope"></i>
      <p class="control help is-danger" v-for="err in fieldErrors.username" v-cloak v-html="err"></p>
    </p>
    <p class="control has-icon">
      <input class="input" type="password" placeholder="Password" v-model="fields.password">
      <i class="fa fa-lock"></i>
      <p class="control help is-danger" v-for="err in fieldErrors.password" v-cloak v-html="err"></p>
    </p>
    <p class="control">
      <label class="checkbox">
        <input type="checkbox" v-model="fields.rememberMe">
        Remember me
      </label>
    </p>
    <p class="control">
      <nav class="level">
        <div class="level-left">
          <div class="level-item">
            <a class="link" href="/password-reset">Forgot password?</a>
          </div>
        </div>
        <div class="level-right">
          <div class="level-item">
            <a class="button" href="/registration">Register new accunt</a>
            <button type="submit" class="button is-primary" v-bind:class="{'is-loading': isLoading}">Login</button>
          </div>
        </div>
      </nav>
    </p>
  </form>
</div>
[[ end ]]

[[ define "login-form-script" ]]
<script>
  new Vue({
    el: "#login-form",
    data: {
      fields: {
        username: "",
        password: "",
        rememberMe: false
      },
      errors: [],
      fieldErrors: {},
      isLoading: false
    },
    methods: {
      submit: _.throttle(function() {
        httpPost(this, '/i/auth', function(response) {
          window.location.reload()
        })
      }, 500)
    }
  })
</script>
[[ end ]]
{'fraction_non_alphanumeric': 0.1938467725718882, 'fraction_numerical': 0.004826060727930827, 'mean_word_length': 2.720269259536275, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 105, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3997401', 'n_tokens_mistral': 1682, 'n_tokens_neox': 1639, 'n_words': 384}