From: dklawren Date: Thu, 17 Jan 2019 18:53:58 +0000 (-0500) Subject: Bug 1520011 - Phabbugz panel short description missing X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb888cca8a60cbe95ef3e674931820af2c779194;p=thirdparty%2Fbugzilla.git Bug 1520011 - Phabbugz panel short description missing --- diff --git a/extensions/PhabBugz/Extension.pm b/extensions/PhabBugz/Extension.pm index 2a91edb7b..7adf0a3fd 100644 --- a/extensions/PhabBugz/Extension.pm +++ b/extensions/PhabBugz/Extension.pm @@ -30,12 +30,14 @@ sub template_before_process { if (my $bug = exists $vars->{'bugs'} ? $vars->{'bugs'}[0] : $vars->{'bug'}) { my $has_revisions = 0; + my $active_revision_count = 0; foreach my $attachment (@{$bug->attachments}) { next if $attachment->contenttype ne PHAB_CONTENT_TYPE; + $active_revision_count++ if !$attachment->isobsolete; $has_revisions = 1; - last; } $vars->{phabricator_revisions} = $has_revisions; + $vars->{phabricator_active_revision_count} = $active_revision_count; } } diff --git a/extensions/PhabBugz/template/en/default/hook/bug_modal/edit-module.html.tmpl b/extensions/PhabBugz/template/en/default/hook/bug_modal/edit-module.html.tmpl index 054cc72e8..ee77ca899 100644 --- a/extensions/PhabBugz/template/en/default/hook/bug_modal/edit-module.html.tmpl +++ b/extensions/PhabBugz/template/en/default/hook/bug_modal/edit-module.html.tmpl @@ -8,8 +8,16 @@ [% RETURN UNLESS phabricator_revisions %] +[% + phab_subtitle = []; + IF phabricator_active_revision_count; + phab_subtitle.push(phabricator_active_revision_count _ " active revision" _ (phabricator_active_revision_count == 1 ? "" : "s")); + END; +%] + [% WRAPPER bug_modal/module.html.tmpl title = "Phabricator Revisions" + subtitle = phab_subtitle collapsed = 0 %] [% INCLUDE phabricator/table.html.tmpl %]