@model HomePageModel

@{
   @using CommonHelpers; <!-- H…-types from DotNetHelpers library -->
   HomePageModel M() => HNN._(Model);
   string[]? errorMessages = Model?.DataNN.ErrorMessages;
   var inputPreserve = Model?.InputPreserve;
   string? accountCodeValue = inputPreserve?.AccountCode;
   string? accessCodeValue = inputPreserve?.AccessCode;
   string loginCheckingChecked =
      HString.Equals( inputPreserve?.LoginChecking, "ON", true ) ?
      "checked" : "";
}

<div class="loginDIV">

   <p class="slim_title">
      User authorization (login to <b>MyFlat</b>-service)
   </p>
   <form method="post">
      <input type="hidden" value="true" name="OpenSession" />
      <table>
         <tbody>
            <tr>
               <td>Owner account:</td>
               <td>
                  <input class="loginINPUT" type="text" name="AccountCode"
                         value="@accountCodeValue"
                         placeholder="identifier (10 digits)" id="accountCodeBox"
                         onfocus="this.select()" />
               </td>
            </tr>
            <tr>
               <td>Access code:</td>
               <td>
                  <input class="loginINPUT" type="password" name="AccessCode"
                         value="@accessCodeValue"
                         placeholder="secret digits" id="accessCodeBox"
                         onfocus="this.select()" />
               </td>
            </tr>
         </tbody>
      </table>
      <br>
      <table>
         <tbody>
            <tr>
               <td>
                  <input type="submit" value="Login" id="submitLoginForm"
                         title="Login to the service" class="cursor_pointer"
                         style="margin-right: 5px; width: 80px; height: 30px" />
               </td>
               <td valign="top" style="padding-top: 3px">
                  <abbr title="User input will be checked before sending to the server.">
                     <label class="cursor_pointer">
                        <input type="checkbox" name="LoginChecking" @loginCheckingChecked
                               id="checkBoxLoginChecking" />
                        Preliminary input checking (by page script)
                     </label>
                  </abbr>
               </td>
            </tr>
         <tbody>
      </table>
   </form>

   @if (errorMessages!=null && @M().AreLoginInputErrors)
   {
      @if (errorMessages.Length > 0)
      {
         <div>
            @for (int i = 0; i < errorMessages.Length; i++)
            {
               @if (errorMessages.Length > 1 && i > 0)
               {<br>}
               <span class="errorSPAN">@errorMessages[i]</span>
            }
         </div>
      }
      else
      {
         <div class="error_text">
            Input data are incorrect.
         </div>
      }
   }

   <div class="faint_text">
      /*<br>
      1) Account: <b>1000000021</b>; access-code: <b>12345</b><br>
      2) Account: <b>1000000022</b>; access-code: <b>67890</b><br>
      */
   </div>

</div>
