{{ $PreviousPage := .Data.PreviousPage }}
{{ $NextPage := .Data.NextPage }}
{{ $View := .Data.View }}
<div class="row">
    <div class="col text-right">
        <ul class="list-inline">
        {{ if $PreviousPage }}
            <li class="list-inline-item"><a href="?page={{ $PreviousPage }}">Earlier</a></li>
        {{ end }}
        {{ if $NextPage }}
            <li class="list-inline-item"><a href="?page={{ $NextPage }}">Older</a></li>
        {{ end }}
    </div>
</div>

{{ $r := .Request }}

{{ range $View }}
    {{ $p := .Post }}
    {{ RenderPost $r $p true .NumComments }}

    {{ if and $.LoggedIn $.CurrentUser.Admin }}
    <div class="mb-4">
        <small>
            <strong>Admin Actions:</strong>
            [
            <a href="/blog/edit?id={{ $p.ID }}">Edit</a> |
            <a href="/blog/delete?id={{ $p.ID }}">Delete</a>
            ]
        </small>
    </div>
    {{ end }}
    <hr>
{{ end }}

<div class="row">
    <div class="col text-right">
        <ul class="list-inline">
        {{ if $PreviousPage }}
            <li class="list-inline-item"><a href="?page={{ $PreviousPage }}">Earlier</a></li>
        {{ end }}
        {{ if $NextPage }}
            <li class="list-inline-item"><a href="?page={{ $NextPage }}">Older</a></li>
        {{ end }}
    </div>
</div>
