open-nomad/ui/app/templates/components/list-pagination.hbs
Buck Doyle e525ff99d3
Remove inverse block for list-pagination (#6523)
As the angle bracket invocation RFC says:

> There is no dedicated syntax for passing an "else" block
> directly. If needed, that can be passed using the named
> blocks syntax.

https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md#block

Unfortunately, using a contextual component doesn’t help as
the yield inside that component will still result in content
rendering that would show when the source isn’t empty. So
we decided to change the interface so you have to check
whether the source is empty before using it, which aligns with
how list-table works.
2019-10-24 07:05:43 -05:00

15 lines
596 B
Handlebars

{{#if source.length}}
{{yield (hash
first=(component "list-pagination/list-pager" test="first" page=1 visible=(not (eq page 1)))
prev=(component "list-pagination/list-pager" test="prev" page=(dec page) visible=(not (eq page 1)))
next=(component "list-pagination/list-pager" test="next" page=(inc page) visible=(not (eq page lastPage)))
last=(component "list-pagination/list-pager" test="last" page=lastPage visible=(not (eq page lastPage)))
pageLinks=pageLinks
currentPage=page
totalPages=lastPage
startsAt=startsAt
endsAt=endsAt
list=list
)}}
{{/if}}