summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2005-10-07 05:08:38 +0200
committerbugreport%peshkin.net <>2005-10-07 05:08:38 +0200
commit1cf7bfe7635af2b613c52cdec13b7daf44c22de4 (patch)
tree0258d4cb29b2c25be480469b19ed088df99d0e04
parentaf7d21349fe822fc6517cab76b37bed3e8caeebe (diff)
downloadbugzilla-1cf7bfe7635af2b613c52cdec13b7daf44c22de4.tar.gz
bugzilla-1cf7bfe7635af2b613c52cdec13b7daf44c22de4.tar.xz
Bug 310171 Update css for private comments in real-time
Patch by Andre Batosti <batosti@async.com.br> r=joel, a=justdave
-rw-r--r--template/en/default/bug/comments.html.tmpl16
-rw-r--r--template/en/default/bug/edit.html.tmpl11
2 files changed, 26 insertions, 1 deletions
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl
index 289593b7a..163f3408d 100644
--- a/template/en/default/bug/comments.html.tmpl
+++ b/template/en/default/bug/comments.html.tmpl
@@ -23,6 +23,21 @@
[% PROCESS bug/time.html.tmpl %]
+ <script type="text/javascript">
+ <!--
+ function updateCommentPrivacy(checkbox, id) {
+ var text_elem = document.getElementById('comment_text_'+id);
+ if (checkbox.checked) {
+ text_elem.parentNode.className='bz_private';
+ } else {
+ text_elem.parentNode.className='';
+ }
+ document.refresh();
+ }
+ //-->
+ </script>
+
+
[% DEFAULT start_at = 0 mode = "show" %]
[% isinsider = Param("insidergroup") && UserInGroup(Param("insidergroup")) %]
[% sort_order = user.settings.comment_sort_order.value %]
@@ -112,6 +127,7 @@
value="[% comment.isprivate %]">
<input type="hidden" name="when-[% count %]" value="[% comment.when %]">
<input type="checkbox" name="isprivate-[% count %]" value="1"
+ onClick="updateCommentPrivacy(this, [% count %])"
id="isprivate-[% count %]"
[% " checked=\"checked\"" IF comment.isprivate %]> Private
</i>
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 38b01f06e..940e320bd 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -114,6 +114,14 @@
[% END %]
+ function updateCommentTagControl(checkbox, form) {
+ if (checkbox.checked) {
+ form.comment.className='bz_private';
+ } else {
+ form.comment.className='';
+ }
+ }
+
//-->
</script>
@@ -542,7 +550,8 @@
<b>Additional <u>C</u>omments:</b>
[% IF Param("insidergroup") && UserInGroup(Param("insidergroup")) %]
<input type="checkbox" name="commentprivacy" value="1"
- id="newcommentprivacy"> Private
+ id="newcommentprivacy"
+ onClick="updateCommentTagControl(this, form)"> Private
[% END %]
<br>
<a name="add_comment"></a>