@Master['master.html']
@Model['TemplatesViewModel']
@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="/Templates/AddExamples" class="btn btn-success"><img src="/static/iconic/svg/plus.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="plus">&nbsp;Beispiel-Template(s) erstellen</a>
                <a href="/Templates/Edit" class="btn btn-success"><img src="/static/iconic/svg/plus.svg" style="width:16px;height:16px;fill:white;stroke:white" alt="plus">&nbsp;Neues Template erstellen</a>
            </div>
        </div>
    </div>
    <div class="row mt-2">
        <h3>
            Templateübersicht
            <small class="text-muted">Erstellen, Bearbeiten und Löschen</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.Templates
        <div class="list-group-item list-group-item-action">
            <div class="d-flex w-100 justify-content-between">
                <h5 class="mb-1">@Current.TranslatedFileName</h5>
            </div>
            <div class="d-flex w-100 justify-content-between">
                <p class="mb-1">Erstellt am: @Current.CreatedAt Geändert am: @Current.ModifiedAt;</p>
                <small>
                    <button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        Aktionen
                    </button>
                    <div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
                        @IfNot.CanBeEdited <a href="/Templates/Edit?Id=@Current.FileNameBase64&ShowOnly=true" 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;Anzeigen</a> @EndIf
                        @If.CanBeEdited <a href="/Templates/Edit?Id=@Current.FileNameBase64" 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> @EndIf
                        @If.CanBeEdited <a href="/Templates/Delete?Id=@Current.FileNameBase64" 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;Löschen</a> @EndIf
                    </div>
                </small>
            </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
