[%# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
#%]
[%# INTERFACE:
# field: a Bugzilla::Field object
# value: The value of the field for this bug.
# override_legal_values (optional): The list of legal values, for select fields.
# editable: Whether the field should be displayed as an editable
# or as just the plain text of its value.
# allow_dont_change: display the --do_not_change-- option for select fields.
# value_span: A colspan for the table cell containing
# the field value.
# no_tds: boolean; if true, don't display the label
or the
# wrapping
for the field.
# bug (optional): The current Bugzilla::Bug being displayed, or a hash
# with default field values being displayed on a page.
#%]
[% SET hidden = 0 %]
[% IF bug AND !field.is_visible_on_bug(bug) %]
[% SET hidden = 1 %]
[% END %]
[% IF NOT no_tds %]
[% PROCESS "bug/field-label.html.tmpl" %]
[% END %]
[% Hook.process('start_field_column') %]
[% IF editable %]
[% SWITCH field.type %]
[% CASE constants.FIELD_TYPE_FREETEXT %]
[% CASE constants.FIELD_TYPE_DATETIME %]
[% CASE constants.FIELD_TYPE_BUG_ID %]
[% IF value %]
[% value FILTER bug_link(value, use_alias => 1) FILTER none %]
[% END %]
(edit)
[% CASE [ constants.FIELD_TYPE_SINGLE_SELECT
constants.FIELD_TYPE_MULTI_SELECT ] %]
[%# When you pass an empty multi-select in the web interface,
# it doesn't appear at all in the CGI object. Instead of
# forcing all users of process_bug to always specify every
# multi-select, we have this field defined if the multi-select
# field is defined, and then if this is passed but the multi-select
# isn't, we know that the multi-select was emptied.
%]
[% IF field.type == constants.FIELD_TYPE_MULTI_SELECT %]
[% END %]
[% CASE constants.FIELD_TYPE_TEXTAREA %]
[% INCLUDE global/textarea.html.tmpl
id = field.name name = field.name minrows = 4 maxrows = 8
cols = 60 defaultcontent = value mandatory = field.is_mandatory %]
[% CASE constants.FIELD_TYPE_BUG_URLS %]
[% '
' IF value.size %]
[% FOREACH bug_url = value %]
[% PROCESS bug_url_link bug_url = bug_url %]
[% END %]
[% '
' IF value.size %]
[% IF Param('use_see_also') %]
(add)
[% END %]
[% CASE constants.FIELD_TYPE_KEYWORDS %]
[% END %]
[% ELSE %]
[% SWITCH field.type %]
[% CASE constants.FIELD_TYPE_TEXTAREA %]
[% value FILTER html %]
[% CASE constants.FIELD_TYPE_BUG_ID %]
[% IF value %]
[% value FILTER bug_link(value, use_alias => 1) FILTER none %]
[% END %]
[% CASE [ constants.FIELD_TYPE_SINGLE_SELECT
constants.FIELD_TYPE_MULTI_SELECT ] %]
[% FOREACH val = value %]
[% display_value(field.name, val) FILTER html %]
[% ', ' UNLESS loop.last() %]
[% END %]
[% CASE constants.FIELD_TYPE_BUG_URLS %]
[% '
' IF value.size %]
[% FOREACH bug_url = value %]
[% PROCESS bug_url_link bug_url = bug_url %]
[% END %]
[% '
' IF value.size %]
[% CASE %]
[% value.join(', ') FILTER html %]
[% END %]
[% END %]
[% Hook.process('end_field_column') %]
[% '
' IF NOT no_tds %]
[%# for reverse relationships, we show this pseudo-field after the main field %]
[% IF bug.id && field.is_relationship %]
[% extra_field_item = {} %]
[% extra_field_item.header = field.reverse_desc _ ":" FILTER html %]
[% extra_field_item.data = BLOCK %]
[% FOREACH depbug = bug.related_bugs(field) %]
[% depbug.id FILTER bug_link(depbug, use_alias => 1) FILTER none %][% " " %]
[% END %]
[% END %]
[% ELSE %]
[% extra_field_item = '' %]
[% END %]
[% BLOCK bug_url_link %]
[% IF bug_url.isa('Bugzilla::BugUrl::Bugzilla::Local') %]
[% bug_url.target_bug_id FILTER bug_link(bug_url.target_bug_id, use_alias => 1) FILTER none %]
[% ELSE %]
[% bug_url.name FILTER html %]
[% END %]
[% END %]