<commit_before>﻿@using TeachersDiary.Clients.Mvc.Infrastructure.Constants
@model ClassViewModel

@{
    Layout = LayoutConstants.Layout;
}

@section styles{
    <link href='https://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css' rel='stylesheet' type='text/css'>
}

<div class="row border-bottom white-bg dashboard-header">
    <h2 class="text-center">@Model.Name клас</h2>
    
    <a href="@(Url.Action<ClassController>(x => x.All()))">
        Обратно
    </a>

    @using (Html.BeginForm<AbsenseController>(c => c.CalculateAbsenses(null, string.Empty), FormMethod.Post, null, new {id= "student-form"}))
    {
        @Html.AntiForgeryToken()
        @Html.HiddenFor(x => Model.Id)
        @Html.HiddenFor(x => Model.Name)
        @Html.ValidationSummary(true, null, new { @class = "text-danger" })

        <table id="student-grid">
            <thead>
            <tr>
                <th class="text-center" colspan="2">Ученик</th>
                <th class="text-center" colspan="2">Септември</th>
                <th class="text-center" colspan="2">Октомври</th>
                <th class="text-center" colspan="2">Ноември</th>
                <th class="text-center" colspan="2">Декември</th>
                <th class="text-center" colspan="2">Януари</th>
                <th class="text-center" colspan="2">Февруари</th>
                <th class="text-center" colspan="2">Март</th>
                <th class="text-center" colspan="2">Април</th>
                <th class="text-center" colspan="2">Май</th>
                <th class="text-center" colspan="2">Юни</th>
                <th class="text-center" colspan="2">Общо</th>
            </tr>
            <tr>
                <th class="text-center">№</th>
                <th class="text-center">Име</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
            </tr>
            </thead>
            <tbody>
            @for (var studentIndex = 0; studentIndex < Model.Students.Count; studentIndex++)
            {
                <tr>
                    <td class="text-center">
                        @Html.HiddenFor(x => x.Students[studentIndex].Number)
                        @Model.Students[studentIndex].Number
                    </td>
                    <td class="text-center">
                        @Html.HiddenFor(x => x.Students[studentIndex].FirstName)
                        @Html.HiddenFor(x => x.Students[studentIndex].LastName)
                        @Html.HiddenFor(x => x.Students[studentIndex].Id)

                        @Model.Students[studentIndex].FirstName @Model.Students[studentIndex].LastName
                    </td>

                    @{ int mounthIndex = 0; }


                    @for (var absenceIndex = 0; absenceIndex < Model.Students[studentIndex].Absences.Count; absenceIndex++)
                    {
                       mounthIndex += 1;

                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].Id)
                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].MonthId)
                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].StudentId)
                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].Excused)
                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].NotExcused)

                        <td class="text-center">
                            @Html.Raw(Model.Students[studentIndex].Absences[absenceIndex].Excused.ToFractionNumber())
                        </td>

                        <td class="text-center"><commit_msg>fixed displaying of students in absence view<commit_after>﻿@using TeachersDiary.Clients.Mvc.Infrastructure.Constants
@model ClassViewModel

@{
    Layout = LayoutConstants.Layout;
}

@section styles{
    <link href='https://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css' rel='stylesheet' type='text/css'>
}

<div class="row border-bottom white-bg dashboard-header">
    <h2 class="text-center">@Model.Name клас</h2>
    
    <a href="@(Url.Action<ClassController>(x => x.All()))">
        Обратно
    </a>

    @using (Html.BeginForm<AbsenseController>(c => c.CalculateAbsenses(null, string.Empty), FormMethod.Post, null, new {id= "student-form"}))
    {
        @Html.AntiForgeryToken()
        @Html.HiddenFor(x => Model.Id)
        @Html.HiddenFor(x => Model.Name)
        @Html.ValidationSummary(true, null, new { @class = "text-danger" })

        <table id="student-grid">
            <thead>
            <tr>
                <th class="text-center" colspan="2">Ученик</th>
                <th class="text-center" colspan="2">Септември</th>
                <th class="text-center" colspan="2">Октомври</th>
                <th class="text-center" colspan="2">Ноември</th>
                <th class="text-center" colspan="2">Декември</th>
                <th class="text-center" colspan="2">Януари</th>
                <th class="text-center" colspan="2">Февруари</th>
                <th class="text-center" colspan="2">Март</th>
                <th class="text-center" colspan="2">Април</th>
                <th class="text-center" colspan="2">Май</th>
                <th class="text-center" colspan="2">Юни</th>
                <th class="text-center" colspan="2">Общо</th>
            </tr>
            <tr>
                <th class="text-center">№</th>
                <th class="text-center">Име</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
                <th class="text-center">Изв</th>
                <th class="text-center">Неизв</th>
            </tr>
            </thead>
            <tbody>
            @for (var studentIndex = 0; studentIndex < Model.Students.Count; studentIndex++)
            {
                <tr>
                    <td class="text-center">
                        @Html.HiddenFor(x => x.Students[studentIndex].Number)
                        @Model.Students[studentIndex].Number
                    </td>
                    <td class="text-center">
                        @Html.HiddenFor(x => x.Students[studentIndex].FirstName)
                        @Html.HiddenFor(x => x.Students[studentIndex].LastName)
                        @Html.HiddenFor(x => x.Students[studentIndex].Id)

                        @Model.Students[studentIndex].FirstName @Model.Students[studentIndex].LastName
                    </td>

                    @{ int mounthIndex = 0; }

                    @*TODO order students in the back end (sql query)*@
                    @{ Model.Students = Model.Students.OrderBy(x => x.Number).ToList(); }

                    @for (var absenceIndex = 0; absenceIndex < Model.Students[studentIndex].Absences.Count; absenceIndex++)
                    {
                       mounthIndex += 1;

                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].Id)
                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].MonthId)
                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].StudentId)
                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].Excused)
                        @Html.HiddenFor(x => x.Students[studentIndex].Absences[absenceIndex].NotExcused)

                        <td class="text-center">
                            @Html.Raw(Model.Students[studentIndex].Absences[absenceIndex].Excused.ToFractionNumber())
                        </td>

                        <td class="text-center">
{'fraction_non_alphanumeric': 0.15444015444015444, 'fraction_numerical': 0.004800166962329124, 'mean_word_length': 1.7477064220183487, 'pattern_counts': {'":': 0, '<': 199, '<?xml version=': 0, '>': 222, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2369454', 'n_tokens_mistral': 3029, 'n_tokens_neox': 2830, 'n_words': 397}