summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-06-16 08:24:40 +0200
committerByron Jones <glob@mozilla.com>2015-06-16 08:24:40 +0200
commita48e145a7b49d54937cc8672d4e2e71780a08e15 (patch)
treecdefedba4a5a3f6d7b31225358c9ca3469889b3e /extensions
parent061328fe4778f8b633e5441828c2962672603922 (diff)
downloadbugzilla-a48e145a7b49d54937cc8672d4e2e71780a08e15.tar.gz
bugzilla-a48e145a7b49d54937cc8672d4e2e71780a08e15.tar.xz
Bug 1146774: treeherder/tbpl comments are not automatically collapsed
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BugModal/Extension.pm8
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl4
2 files changed, 10 insertions, 2 deletions
diff --git a/extensions/BugModal/Extension.pm b/extensions/BugModal/Extension.pm
index 12245dc54..e19e06726 100644
--- a/extensions/BugModal/Extension.pm
+++ b/extensions/BugModal/Extension.pm
@@ -256,7 +256,13 @@ sub template_before_process {
$vars->{tracking_flags_table} = \@tracking_table;
# for the "view -> hide treeherder comments" menu item
- $vars->{treeherder} = Bugzilla->treeherder_user;
+ my $treeherder_id = Bugzilla->treeherder_user->id;
+ foreach my $change_set (@{ $bug->activity_stream }) {
+ if ($change_set->{comment} && $change_set->{comment}->author->id == $treeherder_id) {
+ $vars->{treeherder} = Bugzilla->treeherder_user;
+ last;
+ }
+ }
}
sub bug_start_of_set_all {
diff --git a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl
index 33d8e73c6..7e4bc29d8 100644
--- a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl
@@ -19,7 +19,9 @@
<menuitem id="view-comments-only" label="Comments Only"></menuitem>
<hr>
<menuitem id="view-toggle-cc" label="Show CC Changes"></menuitem>
- <menuitem id="view-toggle-treeherder" label="Hide Treeherder Comments" data-userid="[% treeherder.id FILTER none %]"></menuitem>
+ [% IF treeherder %]
+ <menuitem id="view-toggle-treeherder" label="Hide Treeherder Comments" data-userid="[% treeherder.id FILTER none %]"></menuitem>
+ [% END %]
</menu>
[%