@Master['master.html']
@Model['OrderLogsViewModel']
@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>
            </div>
        </div>
    </div>
    <div class="row mt-2">
        <h3>
            OrderLog
            <small class="text-muted">Auftrag "@Model.OrderName"</small>
        </h3>
    </div>

    <!--<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 class="list-group">
        @Each.OrderLogs
        <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-1">Auftragsstart am @Current.OrderStartedAt, Auftragsende am @Current.OrderFinishedAt@If.IsTestMode (Testlauf) @EndIf</h5>
                        <p class="mb-1">Laufzeit: @Current.RunTimeInMins min, gesendete E-Mails: @Current.SentMails, Dauer per E-Mail: @Current.RunTimePerMailInMins min</p>
                        <p class="mb-1">Status: @Current.OrderStatusHumanReadable</p>
                    </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="/OrderLog/OrderLogContent?OrderId=@Current.OrderId&Id=@Current.Id" class="dropdown-item btn btn-secondary"><img class="iconic" src="/static/iconic/svg/book.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="wrench">&nbsp;Logfile anzeigen</a>
                        <a href="/OrderLog/OrderLogMails?OrderId=@Current.OrderId&OrderLogId=@Current.Id" class="dropdown-item btn btn-secondary" disabled><img class="iconic" src="/static/iconic/svg/wrench.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="wrench">&nbsp;Mailübersicht</a>
                        <a href="/OrderLog/OrderLogBouncesStatus?OrderId=@Current.OrderId&OrderLogId=@Current.Id" class="dropdown-item btn btn-secondary" disabled><img class="iconic" src="/static/iconic/svg/wrench.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="wrench">&nbsp;Bounces anzeigen</a>
                        <a href="/OrderLog/OrderLogBounces?OrderId=@Current.OrderId&OrderLogId=@Current.Id" class="dropdown-item btn btn-secondary" disabled><img class="iconic" src="/static/iconic/svg/wrench.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="wrench">&nbsp;Bounce-Erkennung starten</a>
                    </span>
                </div>
            </div>
        </div>
        @EndEach
    </div>

    <div class="row mt-2">
        <nav aria-label="Page navigation">
            <ul class="pagination">
                <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 @If.IsDisabled disabled @EndIf"><button class="page-link" type="submit" id="Page" name="Page" value="@Current.PageNo">@Current.Description</button></li>
                @EndEach
                <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
