diff options
author | Byron Jones <glob@mozilla.com> | 2015-06-16 08:24:40 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-06-16 08:24:40 +0200 |
commit | a48e145a7b49d54937cc8672d4e2e71780a08e15 (patch) | |
tree | cdefedba4a5a3f6d7b31225358c9ca3469889b3e /extensions | |
parent | 061328fe4778f8b633e5441828c2962672603922 (diff) | |
download | bugzilla-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.pm | 8 | ||||
-rw-r--r-- | extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl | 4 |
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> [% |