@model SummaryViewModel
@{
    ViewData["Title"] = "Home Page";

    var busRoutes = Model.Routes.OrderBy(r => r.BusNumber).ToList();
    var hasDelays = busRoutes.Any();

    var userBusRouteList = string.Join(", ", Model.User.Routes
        .Select(r => r.BusNumber)
        .OrderBy(r => r));
}

@if (hasDelays)
{
    <div class="alert alert-danger">
        <h3 class="alert-heading">Uh oh</h3>
        We have @busRoutes.Count delays
    </div>
}
else
{
    <div class="alert alert-success">
        <h3 class="alert-heading">Good news!</h3>
        No delays today!
    </div>
}

<strong>My Buses: @userBusRouteList</strong>

<ul id="route-list">
    @foreach (var busRoute in busRoutes)
    {
        <li>
            <strong>@busRoute.BusNumber - @busRoute.Schools</strong>
            <p>@busRoute.Impact @busRoute.Schedules</p>
        </li>
    }
</ul>
