46 lines
1.4 KiB
Handlebars
46 lines
1.4 KiB
Handlebars
{{#if (gt this.totalPages 1)}}
|
|
<nav class="flex justify-center relative z-0 my-4" aria-label="Pagination">
|
|
{{#let "inline-flex items-center justify-center px-2 mx-1 font-display text-lg" as |commonClasses|}}
|
|
{{#if this.previousPage}}
|
|
<LinkTo
|
|
@route={{this.router.currentRouteName}}
|
|
@models={{if @model (array @model) (array)}}
|
|
@query={{hash page=this.previousPage}}
|
|
class={{commonClasses}}
|
|
title="Previous page"
|
|
>
|
|
<MdIcon @icon="chevron-left" />
|
|
</LinkTo>
|
|
{{/if}}
|
|
|
|
{{#each this.availablePages as |i|}}
|
|
{{#if (eq @current i)}}
|
|
<span class="{{commonClasses}} border rounded">{{i}}</span>
|
|
{{else if (eq "..." i)}}
|
|
<span class={{commonClasses}}>{{i}}</span>
|
|
{{else}}
|
|
<LinkTo
|
|
@route={{this.router.currentRouteName}}
|
|
@models={{if @model (array @model) (array)}}
|
|
@query={{hash page=i}}
|
|
class={{commonClasses}}
|
|
>
|
|
{{i}}
|
|
</LinkTo>
|
|
{{/if}}
|
|
{{/each}}
|
|
|
|
{{#if this.nextPage}}
|
|
<LinkTo
|
|
@route={{this.router.currentRouteName}}
|
|
@models={{if @model (array @model) (array)}}
|
|
@query={{hash page=this.nextPage}}
|
|
class={{commonClasses}}
|
|
title="Next page"
|
|
>
|
|
<MdIcon @icon="chevron-right" />
|
|
</LinkTo>
|
|
{{/if}}
|
|
{{/let}}
|
|
</nav>
|
|
{{/if}}
|