<!--admin login page validated by wtforms -->
{% extends "layout.html" %}
{% block content %}
{# a macro to show fields error #}
{% macro show_error(input_name) %}
         {% if input_name in form.errors %}
         <span class="my_data_error">{{ ' , '.join(form.errors[input_name]) }} </span>
          {% endif %}
{% endmacro %}
<div class="row">

   <form  action="" method="POST" class="col s12 m6 offset-m3 card-panel brown lighten-5 black-text">
	<div class="row">
        <div class="col s12 card-panel teal white-text my_header_strip">Admin Login</div></div>
      <div class="row">
        <div class="input-field col s12">
          {{ form.username(class_='validate') }}
          <label for="username" class="active">User Name</label>
        </div>
          {{show_error('username')}}
      </div>

      <div class="row">
        <div class="input-field col s12">
          {{ form.password(class_='validate') }}
          <label for="password" class="active">Password</label>
        </div>
          {{show_error('password')}}
            {{ form.csrf_token }}
      </div>
	  <div class="row">
          <div class="col s12 l6">
	  <button id="btnReg" class="waves-effect waves-light btn" type="submit" />Login
	    <i class="material-icons right">home</i> </button>
	  </div>
	  </div>
    </form>

{% endblock %}