﻿@model IEnumerable<LearningPlus.Web.ViewModels.Home.ClassesLoggedInViewModel>

@{
    Layout = null;
}

<div class="col col-md-4 ">
    <div class="text-center pt-2">
        <h3 class="mb-0">Моите уроци</h3>
    </div>
    <div class="border border-success">
        @if (Model.Count() == 0)
        {
            <h4 class="text-center text-warning mt-3">Нямате уроци</h4>
        }
        else
        {
            <ul>
                @foreach (var course in Model)
                {
                    <li>
                        <span>@course.DayOfWeek @course.TimeOfDay</span>
                        @if (User.IsInRole("Parent") || User.IsInRole("Child"))
                        {
                            <a asp-controller="Homeworks" asp-action="UploadHomework" asp-route-id="@course.Id.ToString()">@course.Discipline</a>
                        }
                        else if (User.IsInRole("Teacher"))
                        {
                            <a asp-controller="Classes" asp-action="Details" asp-route-id="@course.Id.ToString()">@course.Discipline</a>
                        }
                    </li>
                }
            </ul>
        }
    </div>
</div>
