hiroaki-yamamoto/WTF-OTP

View on GitHub
example/templates/index_postload.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example App for WTF-OTP</title>
</head>
<body data-ng-app="OTPApp">
  <section data-ng-controller="OTPController">
    <header>
      <h1>Secret Key Generation</h1>
    </header>
    <form action="/" method="post" name="OTPForm">
      {% for field in form -%}
        {% if field.name != 'csrf_token' -%}
          {{ field.label() }} {{ field() }}
        {%- endif %}
      {%- endfor %}
    </form>
    <div>
      <h2>Result</h2>
      {{"{{ toJson(model) }}"}}
    </div>
  </section>
  <section data-ng-controller="OTPAuthController">
    <header><h1>Authentication Section</h1></header>
    <form name="OTPAuthForm" data-ng-submit="submit()">
      {% for field in auth_form -%}
        {% if field.name != 'csrf_token' -%}
          {{ field.label() }} {{ field() }}
        {%- endif %}
      {%- endfor %}
      <button type="submit">Submit</button>
      <h2>Result</h2>
      {{"{{ toJson(result) }}"}}
    </form>
  </section>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
  <script src="{{ url_for('.static', filename='angular_script.js') }}" defer></script>
</body>
</html>