]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1520011 - Phabbugz panel short description missing
authordklawren <dklawren@users.noreply.github.com>
Thu, 17 Jan 2019 18:53:58 +0000 (13:53 -0500)
committerGitHub <noreply@github.com>
Thu, 17 Jan 2019 18:53:58 +0000 (13:53 -0500)
extensions/PhabBugz/Extension.pm
extensions/PhabBugz/template/en/default/hook/bug_modal/edit-module.html.tmpl

index 2a91edb7bbcdc0fd5e11a8de7e65cea19bc29686..7adf0a3fd6ad54390e9cef2b5627a990e768e60b 100644 (file)
@@ -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;
   }
 }
 
index 054cc72e8153289959494bffae4b1ce4926fd54f..ee77ca8995bec1905d6e918c365a422301ff4491 100644 (file)
@@ -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 %]