#? stdtmpl(subsChar = '$', metaChar = '#')
#import "../helpers/global", "../helpers/form"
#import "main_template_top.nimf", "main_template_bottom.nimf"
#proc loginTemplate*(csrfToken: string, fr: FormResult): string  =
# result = ""
${mainTemplateTop("Log In", csrfToken)}
      <div class="pjax-me">
          <div class="flex flex-row">
            <div class="basis-1/5">&nbsp;</div>
            <div class="basis-3/5">
                <h1 class="mt-4 text-2xl">Log In</h1> 
                #if fr.message.len > 0:
                  <h2 id="form_message" class="${fr.messageClass}">${fr.message}</h2>
                #end if
                <form method="POST" action="${APP_URL}/login" accept-charset="utf-8" class="ml-8">
                <input type="hidden" name="csrf_token" value="${csrfToken}">
                <span class="text-2xl text-red-500">*</span><label for="email" class="inline-block mt-8">Email Address:</label>
                #if fErrorMsg(fr, "email").len > 0:
                  <span class="text-red-500">${fErrorMsg(fr, "email")}</span>
                #end if
                <br>
                <input type="email" name="email" id="email" class="lg:w-2/5 bg-slate-400 text-slate-950" value="${fOldInput(fr, "email")}" required><br>
                <span class="text-2xl text-red-500">*</span><label for="password" class="inline-block mt-8">Password:</label>
                #if fErrorMsg(fr, "password").len > 0:
                  <span class="text-red-500">${fErrorMsg(fr, "password")}</span>
                #end if
                <br>
                <input type="password" name="password" id="password" class="lg:w-2/5 bg-slate-400 text-slate-950 focus:ring-yellow-300" required><br>
                <br>
                <br>
                <div class="lg:flex lg:flex-row">
                    <div class="lg:basis-2/3"></div>
                    <div class="lg:basis-1/3">
                        <button class="mt-4 p-1 font-semibold rounded-lg shadow-md text-white hover:text-white bg-green-800 hover:bg-green-700" type="submit">Login</button>
                    </div>
                </div>
                </form>
            </div>
            <div class="basis-1/5">&nbsp;</div>
          </div>
      </div>
  ${mainTemplateBottom()} 
  ##leave this even when empty.  
  <div class="page-js"></div>
#end proc
