Add pagination to the tags view
This commit is contained in:
parent
0d133b0fa4
commit
672e8a5ba9
7 changed files with 113 additions and 2 deletions
20
static/directives/page-controls.html
Normal file
20
static/directives/page-controls.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<div class="page-controls-element">
|
||||
<span class="current-items dropdown">
|
||||
<span class="page-view" data-toggle="dropdown">
|
||||
{{ getPageStart(currentPage, pageSize, totalCount) }} - {{ getPageEnd(currentPage, pageSize, totalCount) }}
|
||||
of {{ totalCount }}
|
||||
</span>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="javascript:void(0)" ng-click="setPage(0)"><i class="fa fa-caret-square-o-left"></i>First Page</a></li>
|
||||
<li><a href="javascript:void(0)" ng-click="setPage(getPageCount(pageSize, totalCount) - 1)"><i class="fa fa-caret-square-o-right"></i>Last Page</a></li>
|
||||
</ul>
|
||||
</span>
|
||||
<span class="page-buttons btn-group">
|
||||
<button class="btn btn-default"
|
||||
ng-disabled="currentPage == 0"
|
||||
ng-click="changePage(-1)">❮</button>
|
||||
<button class="btn btn-default"
|
||||
ng-disabled="currentPage >= getPageCount(pageSize, totalCount) - 1"
|
||||
ng-click="changePage(1)">❯</button>
|
||||
</span>
|
||||
</div>
|
|
@ -53,6 +53,7 @@
|
|||
</span>
|
||||
|
||||
<span class="co-filter-box">
|
||||
<span class="page-controls" total-count="tags.length" current-page="options.page" page-size="50"></span>
|
||||
<input class="form-control" type="text" ng-model="options.tagFilter" placeholder="Filter Tags...">
|
||||
</span>
|
||||
</div>
|
||||
|
@ -87,7 +88,7 @@
|
|||
</thead>
|
||||
|
||||
<tr class="co-checkable-row"
|
||||
ng-repeat="tag in tags"
|
||||
ng-repeat="tag in tags | slice:(50 * options.page):(50 * (options.page + 1))"
|
||||
ng-class="checkedTags.isChecked(tag, checkedTags.checked) ? 'checked' : ''">
|
||||
<td><span class="cor-checkable-item" controller="checkedTags" item="tag"></span></td>
|
||||
<td><span class="tag-span"><i class="fa fa-tag"></i> {{ tag.name }}</span></td>
|
||||
|
|
Reference in a new issue