From 4fbfc4f54fb6d6f1bf24de265e02c4ed4ea15593 Mon Sep 17 00:00:00 2001 From: aynsix Date: Tue, 23 Feb 2021 10:26:19 +0300 Subject: [PATCH] PHRAS-3371 fix key navigation --- lib/Alchemy/Phrasea/Controller/Prod/QueryController.php | 1 + lib/classes/record/preview.php | 8 ++++++++ templates/web/prod/preview/result_train.html.twig | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php index 3285b9d1f2..792fee26a0 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php @@ -499,6 +499,7 @@ class QueryController extends Controller 'records' => $record->get_train(), 'index' => $index, 'selected' => $pos, + 'recordsTotal' => $record->getTotal() ]) ]); } diff --git a/lib/classes/record/preview.php b/lib/classes/record/preview.php index 7177d49ca8..55c716c439 100644 --- a/lib/classes/record/preview.php +++ b/lib/classes/record/preview.php @@ -552,6 +552,14 @@ class record_preview extends record_adapter return $this->statistics; } + /** + * @return int + */ + public function getTotal() + { + return isset($this->total) ? $this->total : 0; + } + /** * @return media_adapter */ diff --git a/templates/web/prod/preview/result_train.html.twig b/templates/web/prod/preview/result_train.html.twig index d9025603f8..77844aeb1e 100644 --- a/templates/web/prod/preview/result_train.html.twig +++ b/templates/web/prod/preview/result_train.html.twig @@ -1,4 +1,4 @@ -
+
    {% for record in records %}