mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 15:49:00 +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": {
|
"units": {
|
||||||
"percentage": "%"
|
"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 FNote from "../../entities/fnote";
|
||||||
import froca from "../../services/froca";
|
import froca from "../../services/froca";
|
||||||
import { useNoteLabel } from "../react/hooks";
|
import { useNoteLabel } from "../react/hooks";
|
||||||
|
import { t } from "../../services/i18n";
|
||||||
|
|
||||||
interface PaginationContext {
|
interface PaginationContext {
|
||||||
page: number;
|
page: number;
|
||||||
@ -29,7 +30,7 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<P
|
|||||||
children.push((
|
children.push((
|
||||||
<a
|
<a
|
||||||
href="javascript:"
|
href="javascript:"
|
||||||
title={`Page of ${startIndex} - ${endIndex}`}
|
title={t("pagination.page_title", { startIndex, endIndex })}
|
||||||
onClick={() => setPage(i)}
|
onClick={() => setPage(i)}
|
||||||
>
|
>
|
||||||
{i}
|
{i}
|
||||||
@ -50,6 +51,8 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<P
|
|||||||
return (
|
return (
|
||||||
<div class="note-list-pager">
|
<div class="note-list-pager">
|
||||||
{children}
|
{children}
|
||||||
|
|
||||||
|
<span className="note-list-pager-total-count">({t("pagination.total_notes", { count: totalNotes })})</span>
|
||||||
</div>
|
</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
|
// 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) {
|
async renderNote(note: FNote, expand: boolean = false) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user