@model UniversityDirectionsViewModel

@{
    ViewData["Title"] = "Выбор направления";
}

<section class="navigation" id="second">
    <div class="container container_flex flex_column">
        <div class="row" id="navigation_row_block">
            <div class="navigation_fixed_background"></div>
            <div class="navigation_banks col-md-12" id="navigation">
                <div class="navigation_banks_univer" id="universe">@Model.University.Name</div>
                <form id="navigation_row_block" class="navigation_input_block">
                    <input type="hidden" name="universityId" value="@Model.University.Id" /> 
                    <input type="text" name="searchString" class="navigation_input" placeholder="Введите код или название направления" value="@Model.SearchString">
                    <input type="image" src="/img/logo/search.svg" alt="search" class="navigation_search">
                </form>
            </div>

        </div>
        <div id="listDirections" class="row row-cols-lg-1 g-5 g-lg-3">
            @{
                foreach (var direction in Model.Directions)
                {
                    <div class="col-md-12">
                        <div class="navigation_info navigation_info_text p-3">@direction.Code - @direction.Name<span class="navigation_cost">От @float.Round(direction.PlaceCost/12) т в мес.</span> @direction.PlaceCost т в год</div>
                    </div>
                }
            }
        </div>
        <script>
                var element = document.getElementById("listDirections");
                var numberOfChildren = element.childElementCount;
                if (numberOfChildren <= 0) {
                    Swal.fire(
                            'Ничего не найдено!',
                            "По вашему запросу ничего не найдено",
                            'warning'
                          ).then((result) => {
                              window.location.replace("/Directions?universityId=@Model.University.Id");
                            })
                    }
            </script>
    </div>
    <div class="navigation_choise">
        <div class="navigation_slid">
            <a href="/" class="navigation_slid_disable">
            <span class="navigation_slid_disable"></span>
            </a>
            <span class="navigation_slid_active"></span>
            <span class="navigation_slid_disable"></span>
            <span class="navigation_slid_disable"></span>
        </div>
    </div>
</section>