@model IEnumerable<PantheonRA.BackOffice.Models.SideMenuModel>
@using PantheonRA.BackOffice.Models
@using PantheonRA.BackOffice.Enums

@{
    Layout = null;
    var navigation = Model.FirstOrDefault(q => q.IsNavigation);
}

<div class="tab-content no-padding">
    <div id="home" class="tab-pane fade in active">
        @if (navigation != null && navigation.IsNavigation && !string.IsNullOrEmpty(navigation.Id))
        {
            <h4 class="control-label m-tb-0 p-sm bg-grey side-menu-item">
                @{
                    Html.RenderPartial("~/Views/Shared/Components/_PrevNextKeyDisplay.cshtml",
                    new PrevNextKeyDisplayViewModel
                    {
                        KeyDisplayValue = string.IsNullOrEmpty(navigation.Description) ?
                            navigation.Title : navigation.Title + " - " + navigation.Description,
                        KeyDisplayHint = navigation.Tooltip,
                        NextNavigation = Url.Action("Next", navigation.Controller, new
                        {
                            Id = navigation.Id,
                            RedirectUrl = Url.Action("Edit", navigation.Controller, new { id = "{id}" })
                        }),
                        PrevNavigation = Url.Action("Prev", navigation.Controller, new
                        {
                            Id = navigation.Id,
                            RedirectUrl = Url.Action("Edit", navigation.Controller, new { id = "{id}" })
                        }),
                        KeyNavigation = Url.Action("Index", navigation.Controller, new { acKey = navigation.Id })
                    });
                }
            </h4>
        }
        <div class="form-horizontal form-md form-right p-b-xl">
            @foreach (var item in Model.Where(q => !q.IsNavigation && !q.IsHidden))
            {
                var itemClass = item.IsActive ? "side-menu-item-active" : "";

                <div class="side-menu-item @itemClass p-l-sm p-r-md" onclick="window.location = '@Url.Action(item.Action, item.Controller, new { type = item.Type, id = item.Id })'">
                    <div class="row list-row">
                        <div class="col-md-12 list-padding"><b>@item.Title</b></div>
                        @if (!string.IsNullOrWhiteSpace(item.Description))
                        {
                            <div class="col-md-12 list-padding bank-acc-trn">@item.Description</div>
                        }
                        else
                        {
                            <div class="col-md-12 list-padding bank-acc-trn">&nbsp;</div>
                        }
                    </div>
                </div>
            }
        </div>
    </div>
</div>