From 5cd77a826f5a52168335e1db0926215da6e23ad0 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sun, 28 Jun 2015 20:59:10 +0200 Subject: Show number of selected packages on search page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes FS#45379. Signed-off-by: Johannes Löthberg --- web/html/packages.php | 16 ++++++++++++++++ web/template/pkg_search_results.php | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/html/packages.php b/web/html/packages.php index bf3daf8..4b11f09 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -71,6 +71,22 @@ $(document).ready(function() { collapseDependsList("#pkgdepslist"); collapseDependsList("#pkgreqslist"); collapseDependsList("#pkgsrcslist"); + + function update_checked_count() { + var one_pkg = ''; + var pkgs = ''; + + var count = $('.package-checkbox:checked').length; + if (count === 1) { + var res = one_pkg; + } else { + var res = pkgs; + } + $('#pkglist-checked-count').text(res.replace('%s', count.toString())); + } + update_checked_count(); // Set initial string + + $('.package-checkbox').change(update_checked_count); }); diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php index cce533c..4d99dd6 100644 --- a/web/template/pkg_search_results.php +++ b/web/template/pkg_search_results.php @@ -9,6 +9,7 @@ if (!$result): ?>

+

1): ?>

@@ -49,7 +50,7 @@ if (!$result): ?> - ]" value="1" /> + ]" value="1" /> "> class="flagged"> @@ -89,6 +90,8 @@ if (!$result): ?>

+ +

1): ?>

-- cgit v1.2.3-70-g09d2