mirror of
https://github.com/zadam/trilium.git
synced 2025-10-19 06:38:59 +02:00
chore(react/collections/list): add note count to pagination
This commit is contained in:
parent
a9c5a3105f
commit
49b189e7a9
@ -2024,5 +2024,9 @@
|
||||
},
|
||||
"units": {
|
||||
"percentage": "%"
|
||||
},
|
||||
"pagination": {
|
||||
"page_title": "Page of {{startIndex}} - {{endIndex}}",
|
||||
"total_notes": "{{count}} notes"
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import { Dispatch, StateUpdater, useEffect, useState } from "preact/hooks";
|
||||
import FNote from "../../entities/fnote";
|
||||
import froca from "../../services/froca";
|
||||
import { useNoteLabel } from "../react/hooks";
|
||||
import { t } from "../../services/i18n";
|
||||
|
||||
interface PaginationContext {
|
||||
page: number;
|
||||
@ -29,7 +30,7 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<P
|
||||
children.push((
|
||||
<a
|
||||
href="javascript:"
|
||||
title={`Page of ${startIndex} - ${endIndex}`}
|
||||
title={t("pagination.page_title", { startIndex, endIndex })}
|
||||
onClick={() => setPage(i)}
|
||||
>
|
||||
{i}
|
||||
@ -50,6 +51,8 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<P
|
||||
return (
|
||||
<div class="note-list-pager">
|
||||
{children}
|
||||
|
||||
<span className="note-list-pager-total-count">({t("pagination.total_notes", { count: totalNotes })})</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ class ListOrGridView extends ViewMode<{}> {
|
||||
|
||||
|
||||
// no need to distinguish "note" vs "notes" since in case of one result, there's no paging at all
|
||||
$pager.append(`<span class="note-list-pager-total-count">(${this.filteredNoteIds.length} notes)</span>`);
|
||||
$pager.append(`<span class=""></span>`);
|
||||
}
|
||||
|
||||
async renderNote(note: FNote, expand: boolean = false) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user