aboutsummaryrefslogtreecommitdiffstats
path: root/template/en/default/bug
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/bug')
-rw-r--r--template/en/default/bug/field.html.tmpl26
1 files changed, 24 insertions, 2 deletions
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index 762e659db..3b26073aa 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -28,9 +28,21 @@
# allow_dont_change: display the --do_not_change-- option for select fields.
# value_span: A colspan for the table cell containing
# the field value.
+ # bug (optional): The current Bugzilla::Bug being displayed, or a hash
+ # with default field values being displayed on a page.
#%]
-<th class="field_label">
+[% SET hidden = 0 %]
+[% IF field.visibility_field.defined %]
+ [% IF !bug.${field.visibility_field.name}
+ .contains(field.visibility_value.name)
+ %]
+ [% SET hidden = 1 %]
+ [% END %]
+[% END %]
+
+<th class="field_label [% ' bz_hidden_field' IF hidden %]"
+ id="field_label_[% field.name FILTER html %]">
[% IF editable %]
<label for="[% field.name FILTER html %]">
[% END %]
@@ -38,7 +50,9 @@
[% '</label>' IF editable %]
</th>
-<td class="field_value" [% "colspan=\"$value_span\"" FILTER none IF value_span %]>
+<td class="field_value [% ' bz_hidden_field' IF hidden %]"
+ id="field_container_[% field.name FILTER html %]"
+ [% " colspan=\"$value_span\"" FILTER none IF value_span %]>
[% IF editable %]
[% SWITCH field.type %]
[% CASE constants.FIELD_TYPE_FREETEXT %]
@@ -121,6 +135,14 @@
id = field.name name = field.name minrows = 4 maxrows = 8
cols = 60 defaultcontent = value %]
[% END %]
+
+ [% FOREACH controlled_field = field.controls_visibility_of %]
+ <script type="text/javascript">
+ showFieldWhen('[% controlled_field.name FILTER js %]',
+ '[% field.name FILTER js %]',
+ '[% controlled_field.visibility_value.name FILTER js %]');
+ </script>
+ [% END %]
[% ELSIF field.type == constants.FIELD_TYPE_TEXTAREA %]
<div class="uneditable_textarea">[% value FILTER wrap_comment(60)
FILTER html %]</div>