[%# 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. #%] [%# # field: (field object) bug_fields.$field_name object # field_type: (const) constants.FIELD_TYPE_* # no_label: (boolean) don't output label # label: (string) field label text (default: field_descs.${$field.name} # view_only: (boolean) don't allow editing (default: determined from bug.check_can_change_field) # edit_only: (boolean) always render the edit ui # container: (boolean) output just a label and the content (eg. for multiple fields next to one label) # value: (string) visible value (default: bug.$name) # values: (array of string) list of value objects (FIELD_TYPE_SINGLE_SELECT and _BUG_URLS only) (default: lazy-load on edit) # inline: (boolean) output field as a table-cell instead of as a stand-alone div (default: false) # no_indent: (boolean) don't indent the field (left-padding) (default: false) # full_width: (boolean) the field takes up the complete page width (default: false) # short_width: (boolean) the field shouldn't take up much space at all (default: false) # hide_on_view: (boolean) hide field from read-only view (default: false) # hide_on_edit: (boolean) hide content when in edit mode (default: false) # append_content: (boolean) when called as a WRAPPER, the content will be appended to the # edit html instead of replacing it. forces edit_only (default: false); #%] [% IF field_type.defined && !field; RETURN; END; IF !name.defined; name = field.name; END; IF !value.defined; value = bug.$name; END; IF hide_on_edit; view_only = 1; END; IF view_only || container; editable = 0; END; IF !editable.defined; editable = bug.check_can_change_field(name, 0, 1); END; IF append_content; edit_only = 1; END; IF inline && !label.defined; no_label = 1; END; IF !no_label && !label.defined; label = field_descs.${field.name}; END; IF field_type == ""; field_type = -1; END; # date picker fields should always be short IF field_type == constants.FIELD_TYPE_DATE || field_type == constants.FIELD_TYPE_DATETIME; short_width = 1; END; # determine if a field is set IF field_type == constants.FIELD_TYPE_BUG_URLS || field_type == constants.FIELD_TYPE_BUG_LIST; has_value = values.size > 0; ELSIF field_type == constants.FIELD_TYPE_MULTI_SELECT || field_type == constants.FIELD_TYPE_USERS; has_value = value.size > 0; ELSE; has_value = value != ""; END; # switch to view mode if edit-only and the current user cannot edit IF !editable && edit_only; edit_only = 0; END; IF hide_on_view && hide_on_edit; RETURN; END; %]
[%# bug-urls, currently just see-also %] [% BLOCK bug_urls %] [% FOREACH url IN values %]