{{ define "pagination" }}
<div class="pagination">
    <div class="pagination-backward">
        <div class="pagination-first {{ if not .ShowFirst }}disabled{{end}}">
            {{ if .ShowFirst }}
                <a href="{{ .Route }}{{ if gt .FirstOffset 0 }}?offset={{ .FirstOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}{{ else }}{{ if .SearchQuery }}?q={{ .SearchQuery }}{{ end }}{{ end }}" data-page="first">{{ t "pagination.first" }}</a>
            {{ else }}
                {{ t "pagination.first" }}
            {{ end }}
        </div>

        <div class="pagination-prev {{ if not .ShowPrev }}disabled{{end}}">
            {{ if .ShowPrev }}
                <a href="{{ .Route }}{{ if gt .PrevOffset 0 }}?offset={{ .PrevOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}{{ else }}{{ if .SearchQuery }}?q={{ .SearchQuery }}{{ end }}{{ end }}" data-page="previous" rel="prev">{{ t "pagination.previous" }}</a>
            {{ else }}
                {{ t "pagination.previous" }}
            {{ end }}
        </div>
    </div>

    <div class="pagination-forward">
        <div class="pagination-next {{ if not .ShowNext }}disabled{{end}}">
            {{ if .ShowNext }}
                <a href="{{ .Route }}?offset={{ .NextOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}" data-page="next" rel="next">{{ t "pagination.next" }}</a>
            {{ else }}
                {{ t "pagination.next" }}
            {{ end }}
        </div>

        <div class="pagination-last {{ if not .ShowLast }}disabled{{end}}">
            {{ if .ShowLast }}
                <a href="{{ .Route }}?offset={{ .LastOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}" data-page="last" >{{ t "pagination.last" }}</a>
            {{ else }}
                {{ t "pagination.last" }}
            {{ end }}
        </div>
    </div>
</div>
{{ end }}
