From 80fc05854135e575e7811b55f521e8bb9855a2ee Mon Sep 17 00:00:00 2001 From: Dexter Morgan Date: Fri, 26 Nov 2010 14:56:29 +0000 Subject: Add custom template with identity support --- template/en/default/bug/show.xml.tmpl | 157 ++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 template/en/default/bug/show.xml.tmpl (limited to 'template/en/default/bug/show.xml.tmpl') diff --git a/template/en/default/bug/show.xml.tmpl b/template/en/default/bug/show.xml.tmpl new file mode 100644 index 0000000..2349602 --- /dev/null +++ b/template/en/default/bug/show.xml.tmpl @@ -0,0 +1,157 @@ +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # The Initial Developer of the Original Code is Netscape Communications + # Corporation. Portions created by Netscape are + # Copyright (C) 1998 Netscape Communications Corporation. All + # Rights Reserved. + # + # Contributor(s): Bradley Baetz + # Colin Ogilvie + # + #%] +[% PROCESS bug/time.html.tmpl %] + + + + + +[% FOREACH bug = bugs %] + [% IF bug.error %] + + [% bug.bug_id FILTER xml %] + + [% ELSE %] + + [% FOREACH field = bug.fields %] + [% IF displayfields.$field %] + [%+ PROCESS bug_field %] + [% END %] + [% END %] + + [%# This is here so automated clients can still use process_bug.cgi %] + [% IF displayfields.token && user.id %] + [% issue_hash_token([bug.id, bug.delta_ts]) FILTER xml %] + [% END %] + + [%# Now handle 'special' fields #%] + [% IF displayfields.group %] + [% FOREACH g = bug.groups %] + [% NEXT UNLESS g.ison %] + [% g.name FILTER xml %] + [% END %] + [% END %] + + [%# Bug Flags %] + [% PROCESS section_flags obj => bug %] + + [% IF displayfields.long_desc %] + [% FOREACH c = bug.comments %] + [% NEXT IF c.is_private && !user.is_insider %] + + [% c.id FILTER xml %] + [% IF c.is_about_attachment %] + [% c.extra_data FILTER xml %] + [% END %] + [% c.author.email FILTER email FILTER xml %] + [% c.creation_ts FILTER time("%Y-%m-%d %T %z") FILTER xml %] + [% IF user.is_timetracker && (c.work_time - 0 != 0) %] + [% PROCESS formattimeunit time_unit = c.work_time FILTER xml %] + [% END %] + [% c.body_full FILTER xml %] + + [% END %] + [% END %] + + [% IF displayfields.attachment %] + [% FOREACH a = bug.attachments %] + [% NEXT IF a.isprivate && !user.is_insider %] + + [% a.id %] + [% a.attached FILTER time("%Y-%m-%d %T %z") FILTER xml %] + [% a.modification_time FILTER time("%Y-%m-%d %T %z") FILTER xml %] + [% a.description FILTER xml %] + [% a.filename FILTER xml %] + [% a.contenttype FILTER xml %] + [% a.datasize FILTER xml %] + [% a.attacher.email FILTER email FILTER xml %] + [%# This is here so automated clients can still use attachment.cgi %] + [% IF displayfields.token && user.id %] + [% issue_hash_token([a.id, a.modification_time]) FILTER xml %] + [% END %] + [% IF displayfields.attachmentdata %] + [% a.data FILTER base64 %] + [% END %] + + [% PROCESS section_flags obj => a %] + + [% END %] + [% END %] + + [% Hook.process("bug_end") %] + + + [% END %] +[% END %] + + + +[% BLOCK bug_field %] + [% FOREACH val = bug.$field %] + [%# We need to handle some fields differently. This should become + # nicer once we have custfields, and a type attribute for the fields + #%] + [% name = '' %] + [% IF field == 'reporter' OR field == 'assigned_to' OR + field == 'qa_contact' %] + [% name = val.name %] + [% val = val.email FILTER email %] + [% ELSIF field == 'cc' %] + [% val = val FILTER email %] + [% ELSIF field == 'creation_ts' OR field == 'delta_ts' %] + [% val = val FILTER time("%Y-%m-%d %T %z") %] + [% END %] + <[% field %][% IF name != '' %] name="[% name FILTER xml %]"[% END -%]> + [%- val FILTER xml %] + [% END %] +[% END %] + +[% BLOCK section_flags %] + [% RETURN UNLESS displayfields.flag %] + + [% FOREACH flag = obj.flags %] + + [% END %] +[% END %] -- cgit v1.2.1