summaryrefslogtreecommitdiffstats
path: root/extensions/Needinfo
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2014-09-16 22:13:27 +0200
committerDylan William Hardison <dylan@hardison.net>2014-09-18 18:59:10 +0200
commite2a3c8d2063d60e297e19e9d08c1974b5602b8ec (patch)
tree6e831afb2de4cc786cf2d602a6adb283a0d02028 /extensions/Needinfo
parent7b055b9f5a7f4250e6effb230bbfb1f7996b1904 (diff)
downloadbugzilla-e2a3c8d2063d60e297e19e9d08c1974b5602b8ec.tar.gz
bugzilla-e2a3c8d2063d60e297e19e9d08c1974b5602b8ec.tar.xz
Bug 891199 - clicking on needinfo flag/text should scroll you to the comment which set the flag
Diffstat (limited to 'extensions/Needinfo')
-rw-r--r--extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl32
1 files changed, 31 insertions, 1 deletions
diff --git a/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl b/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl
index 453f85fe2..d334f232b 100644
--- a/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl
+++ b/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl
@@ -21,13 +21,43 @@
[% END %]
[% END %]
+[%
+ BLOCK needinfo_comment_div;
+ match = needinfo_flags.last.creation_date.match('^(\d{4})\.(\d{2})\.(\d{2})(.+)$');
+ date = "$match.0-$match.1-$match.2$match.3";
+ FOREACH comment IN bug.comments;
+ NEXT IF comment.is_private AND NOT (user.is_insider || user.id == comment.author.id);
+ IF comment.creation_ts == date;
+ GET "c$comment.count";
+ LAST;
+ END;
+ END;
+ END;
+%]
+
[% IF needinfo_flagtype %]
<div id="needinfo_container">
[% IF needinfo_flags.size > 0 %]
[%# Displays NEEDINFO tag in bug header %]
<script>
+ var needinfo_comment_div = '[% INCLUDE needinfo_comment_div FILTER js %]';
var summary_container = document.getElementById('static_bug_status');
- summary_container.appendChild(document.createTextNode('[NEEDINFO]'));
+ if (document.getElementById('inline-history-ext')) {
+ needinfo_comment_div = inline_history.getNeedinfoDiv();
+ }
+
+ if (needinfo_comment_div) {
+ var a = document.createElement('a');
+ a.id = 'needinfo-lnk';
+ a.href = "#" + needinfo_comment_div;
+ a.appendChild(document.createTextNode('NEEDINFO'));
+ summary_container.appendChild(document.createTextNode('['));
+ summary_container.appendChild(a);
+ summary_container.appendChild(document.createTextNode(']'));
+ }
+ else {
+ summary_container.appendChild(document.createTextNode('[NEEDINFO]'));
+ }
</script>
[% END %]
<table>