@model AmusingPageModel

@{
   @using CommonHelpers; <!-- H…-types from DotNetHelpers library -->
   //AmusingPageModel M() => NN._(Model);
   ViewData["Title"] = "Amusing things";
   string[]? errorMessages = Model?.Data.ErrorMessages;
   var monthList = Model?.MonthList;
}

<form method="post">
   <p>
      <input type="hidden" value="true" name="GetMonthList" />
      <input type="submit" value="Obtain month list" class="cursor_pointer"
             title="Obtain month list from database" />&nbsp;
      <font class="faint_text">// Home/Amusing?GetMonthList=true</font>
   </p>
</form>
@if (monthList != null)
{
   <span class="slim_title">Months of year (data from DB):</span>
   <table id="monthTable">
      <thead>
         <tr>
            <th class="listTH">NO</th>
            <th class="listTH">Name</th>
            <th class="listTH">In genitive case</th>
         </tr>
      </thead>
      <tbody>
         @foreach (var mi in monthList)
         {
            <tr>
               <td class="rightAlignedBoldTD">@mi.NO</td>
               <td>@mi.Name</td>
               <td>@mi.NameGen</td>
            </tr>
         }
      </tbody>
   </table>
   <p>
      <label class="cursor_pointer">
         <input type="checkbox" id="checkBoxColorInterleaved" onchange="ColorMonthTable()" />
         Colored list (line interleaving)
      </label>
   </p>
   <p></p>
}

@if (errorMessages != null)
{
   @if (errorMessages.Length > 0)
   {
      <p>
         @for (int i=0; i<errorMessages.Length; i++)
         {
            @if (errorMessages.Length > 1 && i > 0)
            {<br>}
            <span class="errorSPAN">@errorMessages[i]</span>
         }
      </p>
   }
   else
   {
      <p class="error_text">
         There are errors.
      </p>
   }
}

<br>
<h3>
   API (AJAX+REST)
</h3>
<p>
   <text class="slim_title">Roman numbers (data from DB):</text>
</p>
<form onsubmit="event.preventDefault()">
   <font class="faint_text"
   >// GET api/roman_numbers?count=...&amp;withDelay=...</font><br>
   <p>
      <button type="submit" id="buttonRomanNumbers"
              class="cursor_pointer"
              onclick="buttonRomanNumbers_Click()"
              title="Obtain roman number list">
         Obtain
      </button>
      <label>
         (Numbers selection &gt;= 50 (count) {0} is only for logged user.)
      </label><br>
      <input class="editINPUT" type="text" id="textRomanNumbersCount"
             onfocus="this.select()" onblur="ExcludeErrorClass(this)"
             style="margin-top: 3px; width: 100px" />
      (count)&nbsp;&nbsp;
      <abbr title="Emulate request delay on server">
         <label class="cursor_pointer">
            <input type="checkbox" id="checkboxRomanNumbersDelay" />
            With server-side delay (3 sec.)
         </label>
      </abbr>
   </p>
</form>
<table>
   <thead id="romanNumbersTableHead">
   </thead>
   <tbody id="romanNumbersTableBody"></tbody>
</table>

<script src="~/ts/Amusing.page.js?@DateTime.Now.Ticks"></script>
