@Master['master.html']
@Model['IndexViewModel']
@Section['Content']
<form class="mt-3" method="post">
    <div class="row mt-2">
        <div class="control-group mb-3">
            <div class="controls">
                <button type="submit" class="btn btn-primary"><img src="/static/iconic/svg/reload.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="reload">&nbsp;Aktualisieren</button>
                <a href="/Orders/Create" class="btn btn-success"><img src="/static/iconic/svg/plus.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="plus">&nbsp;Neuen Auftrag erstellen</a>
            </div>
        </div>
    </div>
    <div class="row mt-2">
        <h3>
            Auftragsübersicht
            <small class="text-muted">Erstellen oder Bearbeiten von Aufträgen</small>
        </h3>
    </div>

    <!--<nav class="navbar navbar-expand-lg navbar-light bg-light">
        <div class="collapse navbar-collapse w-auto col-lg-12" id="navbarSupportedContent">-->
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <span class="form-inline col-lg-12">
            <input class="form-control mr-sm-2 col-lg-10" type="search" placeholder="" id="SearchText" name="SearchText" value="@!Model.SearchText" aria-label="Search">
            <span class="d-flex justify-content-end">
                <button id="ResetSearch" name="ResetSearch" value="True" class="btn btn-outline-success my-2 my-sm-0" type="submit"><img src="/static/iconic/svg/circle-x.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="circle-x"></button>
                &nbsp;
                <button name="search" class="btn btn-outline-success my-2 my-sm-0" type="submit"><img src="/static/iconic/svg/magnifying-glass.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="magnifying class"></button>
            </span>
        </span>
        <p></p>
    </nav>
    <!--</div>
    </nav>-->

    <div class="list-group">
        @Each.Orders
        <div class="list-group-item list-group-item-action">
            <div class="d-flex w-100 justify-content-between">
                <div class="d-flex w-75 flex-grow-1 justify-content-between" style="margin-right:10px;">
                    <div class="d-flex align-items-start flex-column">
                        <h5 class="mb-2">@Current.Name</h5>
                        <div class="mb-2">@Current.Remark</div>
                        <div class="mb-2">@Current.OrderStatusHumanReadable<small>@If.IsScheduled Wiederkehrender Auftrag, @!Current.SchedulerHumanReadable @EndIf@IfNot.IsScheduled Einmaliger Auftrag.@EndIf</small></div>
                    </div>
                    <div class="d-flex align-items-end flex-column">
                        <small>@Current.CreatedByHumanReadable, @Current.CreatedAtHumanReadable <span style="font-weight:bolder">E</span></small>
                        <small>@Current.ModifiedByHumanReadable, @Current.ModifiedAtHumanReadable <span style="font-weight:bolder">G</span></small>
                        <small>@Current.OwnerHumanReadable <span style="font-weight:bolder">B</span></small>
                    </div>
                </div>

                <div class="d-flex align-items-end flex-column">
                    <button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        Aktionen
                    </button>
                    <span class="dropdown-menu" aria-labelledby="btnGroupDrop1">
                        <a href="/Orders/Create?Id=@Current.Id" class="dropdown-item btn btn-secondary"><img class="iconic" src="/static/iconic/svg/wrench.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="wrench">&nbsp;Bearbeiten</a>
                        <a href="/Orders/Execute?Id=@Current.Id" class="dropdown-item btn btn-secondary"><img src="/static/iconic/svg/pulse.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="pulse">&nbsp;Ausführen</a>
                        <a href="/Orders/Test?Id=@Current.Id" class="dropdown-item btn btn-secondary"><img src="/static/iconic/svg/puzzle-piece.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="puzzle-piece">&nbsp;Testen</a>
                        <a href="/OrderLog?OrderId=@Current.Id" class="dropdown-item btn btn-secondary"><img src="/static/iconic/svg/excerpt.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="puzzle-piece">&nbsp;OrderLog</a>
                        <a href="/Orders/ChangeOwner?Id=@Current.Id" class="dropdown-item btn btn-secondary"><img src="/static/iconic/svg/wrench.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="puzzle-piece">&nbsp;Besitzer ändern</a>
                        <a href="/Orders/Delete?Id=@Current.Id" class="dropdown-item btn btn-secondary"><img src="/static/iconic/svg/trash.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="trash">&nbsp;Löschen</a>
                    </span>
                </div>
            </div>
        </div>
        @EndEach
    </div>

    <div class="row mt-2">
        <nav aria-label="Page navigation example">
            <ul class="pagination">
                <!--<li class="page-item @IfNot.IsPrevPageEnabled disabled @EndIf"><a class="page-link" href="#">Vorherige Seite</a></li>-->
                <li class="page-item @IfNot.IsPrevPageEnabled disabled @EndIf"><button class="page-link" type="submit" id="PrevPage" name="PrevPage" value="True">Vorherige Seite</button></li>
                @Each.AvailablePages
                <li class="page-item @If.IsActive active @EndIf"><button class="page-link" type="submit" id="Page" name="Page" value="@Current.PageNo">@Current.PageNo</button></li>
                @EndEach
                <!--<li class="page-item @IfNot.IsNextPageEnabled disabled @EndIf"><a class="page-link" href="#">Nächste Seite</a></li>-->
                <li class="page-item @IfNot.IsNextPageEnabled disabled @EndIf"><button class="page-link" type="submit" id="NextPage" name="NextPage" value="True">Nächste Seite</button></li>
            </ul>
        <input type="hidden" id="CurrentPage" name="CurrentPage" value="@!Model.CurrentPage" />
        </nav>
    </div>
</form>
@EndSection
