From 8db3b1e10fd61f0270dee22046d763304528f94e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Aug 2020 16:44:34 +0200 Subject: [PATCH] Bug 25430: Use label-default for 0 Signed-off-by: Kyle M Hall --- .../prog/en/modules/circ/circulation.tt | 16 +++++++++++---- .../prog/en/modules/members/moremember.tt | 17 ++++++++++++---- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 20 +++++++++++++++++-- 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 5172a2435d..0a0462168e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -874,14 +874,22 @@ [% IF ( patron.return_claims.count ) %] Claim(s) - [% patron.return_claims.resolved.count | html %] - [% patron.return_claims.unresolved.count | html %] + [% IF patron.return_claims.resolved.count == 0 %] + [% patron.return_claims.resolved.count | html %] + [% ELSE %] + [% patron.return_claims.resolved.count | html %] + [% END %] + [% IF patron.return_claims.unresolved.count == 0 %] + [% patron.return_claims.unresolved.count | html %] + [% ELSE %] + [% patron.return_claims.unresolved.count | html %] + [% END %] [% ELSE %] Claim(s) - 0 - 0 + 0 + 0 [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 20a4b991e4..38ab8d2562 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -764,14 +764,23 @@ [% IF ( patron.return_claims.count ) %] Claim(s) - [% patron.return_claims.resolved.count | html %] - [% patron.return_claims.unresolved.count | html %] + [% IF patron.return_claims.resolved.count == 0 %] + [% patron.return_claims.resolved.count | html %] + [% ELSE %] + [% patron.return_claims.resolved.count | html %] + [% END %] + [% IF patron.return_claims.unresolved.count == 0 %] + [% patron.return_claims.unresolved.count | html %] + [% ELSE %] + [% patron.return_claims.unresolved.count | html %] + [% END %] + [% ELSE %] Claim(s) - 0 - 0 + 0 + 0 [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 41c3562a67..31589a396d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -985,8 +985,24 @@ $(document).ready(function() { let resolved = json.resolved; let unresolved = json.unresolved; - $('#return-claims-count-resolved').text(resolved); - $('#return-claims-count-unresolved').text(unresolved); + if ( resolved > 0 ) { + $('#return-claims-count-resolved').text(resolved) + .removeClass('label-default') + .addClass('label-success'); + } else { + $('#return-claims-count-resolved').text(resolved) + .removeClass('label-success') + .addClass('label-default'); + } + if ( unresolved > 0 ) { + $('#return-claims-count-unresolved').text(unresolved) + .removeClass('label-default') + .addClass('label-warning'); + } else { + $('#return-claims-count-unresolved').text(unresolved) + .removeClass('label-warning') + .addClass('label-default'); + } fnCallback(json) } ); -- 2.24.1 (Apple Git-126)