Show total count when no pagination is applied

If no pagination is applied (or disabled in the settings), there is no view on how many items you have in your library. By showing the pagination text (without the pagination buttons) it's still visible for the user how many items are listed in the library.
This commit is contained in:
h3llrais3r 2022-12-11 18:38:47 +01:00 committed by Bill Thornton
parent 7fb1b462e5
commit 53aaa35a3b
2 changed files with 13 additions and 0 deletions

View File

@ -88,6 +88,15 @@ const Pagination: FC<PaginationProps> = ({ viewQuerySettings, setViewQuerySettin
/> />
</div> </div>
)} )}
{!showControls && (
<div className='listPaging' style={{ display: 'flex', alignItems: 'center' }}>
<span>
{globalize.translate('ListPaging', (totalRecordCount ? startIndex + 1 : 0), totalRecordCount, totalRecordCount)}
</span>
</div>
)}
</div> </div>
</div> </div>
); );

View File

@ -90,6 +90,10 @@ export function getQueryPagingHtml (options) {
html += '<span style="vertical-align:middle;">'; html += '<span style="vertical-align:middle;">';
html += globalize.translate('ListPaging', totalRecordCount ? startIndex + 1 : 0, recordsEnd, totalRecordCount); html += globalize.translate('ListPaging', totalRecordCount ? startIndex + 1 : 0, recordsEnd, totalRecordCount);
html += '</span>'; html += '</span>';
} else {
html += '<span style="vertical-align:middle;">';
html += globalize.translate('ListPaging', totalRecordCount ? startIndex + 1 : 0, totalRecordCount, totalRecordCount);
html += '</span>';
} }
if (showControls || options.viewButton || options.filterButton || options.sortButton || options.addLayoutButton) { if (showControls || options.viewButton || options.filterButton || options.sortButton || options.addLayoutButton) {