bugzilla-4intranet/template/en/default/list/table.html.tmpl

246 lines
9.7 KiB
Cheetah

[%# 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): Myk Melez <myk@mozilla.org>
# Jesse Clark <jjclark1982@gmail.com>
#%]
[%############################################################################%]
[%# Initialization #%]
[%############################################################################%]
[%# Don't display the table or do any processing if there are no bugs
# to display %]
[% RETURN IF !bugs.size %]
[%# Columns whose titles or values should be abbreviated to make the list
# more compact. For columns whose titles should be abbreviated,
# the shortened title is included. For columns whose values should be
# abbreviated, a maximum length is provided along with the ellipsis that
# should be added to an abbreviated value, if any.
# wrap is set if a column's contents should be allowed to be word-wrapped
# by the browser.
#%]
[% USE Bugzilla %]
[% field_descs.short_short_desc = field_descs.short_desc %]
[% field_descs.assigned_to_realname = field_descs.assigned_to %]
[% field_descs.reporter_realname = field_descs.reporter %]
[% field_descs.qa_contact_realname = field_descs.qa_contact %]
[% PROCESS bug/time.html.tmpl %]
[% Hook.process("before_table") %]
[%############################################################################%]
[%# Table Header #%]
[%############################################################################%]
[% tableheader = BLOCK %]
<table class="bz_buglist sortable" cellspacing="0" cellpadding="4" width="100%">
<thead>
<tr class="bz_buglist_header bz_first_buglist_header">
[% IF dotweak %]
<th>&nbsp;</th>
[% END %]
[% i = lsearch(order_columns, 'bug_id') %]
<th colspan="[% splitheader ? 2 : 1 %]" class="first-child0 [% "sortable_column_0" %][% IF i>=0 %] sorted_[% i %] sorttable_sorted[% "_reverse" IF order_dir.$i %][% END %]">
<a href="buglist.cgi?
[% urlquerypart FILTER html %]&amp;order=
[% PROCESS new_order id='bug_id' %]
[%-#%]&amp;query_based_on=
[% defaultsavename OR searchname FILTER url_quote %]">ID
</a>
</th>
[% IF splitheader %]
[% FOREACH id = displaycolumns %]
[% NEXT UNLESS loop.count() % 2 == 0 %]
[% column = columns.$id %]
[% PROCESS columnheader key=loop.count() %]
[% END %]
[%# vitalif@mail.ru --- A "hook" into the bug row for building custom views based on table view %]
[% IF bug_header_callback %][% bug_header_callback FILTER process %][% END %]
</tr><tr class="bz_buglist_header">
[% IF dotweak %]
<th>&nbsp;</th>
[% END %]
<th>&nbsp;</th>
[% FOREACH id = displaycolumns %]
[% NEXT IF loop.count() % 2 == 0 %]
[% column = columns.$id %]
[% PROCESS columnheader key=loop.count() %]
[% END %]
[%# vitalif@mail.ru --- A "hook" into the bug row for building custom views based on table view %]
[% IF bug_header_callback %][% bug_header_callback FILTER process %][% END %]
[% ELSE %]
[% FOREACH id = displaycolumns %]
[% column = columns.$id %]
[% PROCESS columnheader key=loop.count() %]
[% END %]
[%# vitalif@mail.ru --- A "hook" into the bug row for building custom views based on table view %]
[% IF bug_header_callback %][% bug_header_callback FILTER process %][% END %]
[% END %]
</tr>
</thead>
[% END %]
[% BLOCK columnheader %]
[% i = lsearch(order_columns, id) %]
<th colspan="[% splitheader ? 2 : 1 %]" class="[% "sortable_column_$key" %][% IF i>=0 %] sorted_[% i %] sorttable_sorted[% "_reverse" IF order_dir.$i %][% END %]">
<a href="buglist.cgi?[% urlquerypart FILTER html %]&amp;order=
[% PROCESS new_order %]
[%-#%]&amp;query_based_on=
[% defaultsavename OR searchname FILTER url_quote %]">
[%- abbrev.$id.title || field_descs.$id || column.title -%]
</a>
</th>
[% END %]
[% BLOCK new_order %]
[% desc = '' %]
[% IF (om = order.match("\\b$id( DESC)?")) %]
[% desc = ' DESC' IF NOT om.0 %]
[% END %]
[% id _ desc FILTER url_quote %]
[% IF id != 'bug_id' AND order %]
[% ',' _ order.remove("\\b$id( DESC)?(,\\s*|\$)") FILTER url_quote %]
[% END %]
[% END %]
[%############################################################################%]
[%# Bug Table #%]
[%############################################################################%]
[% tableheader %]
<tbody class="sorttable_body">
[% FOREACH bug = bugs %]
[% count = loop.count() %]
<tr class="bz_bugitem
bz_[% bug.bug_severity FILTER css_class_quote -%]
bz_[% bug.priority FILTER css_class_quote -%]
bz_[% bug.bug_status FILTER css_class_quote -%]
[%+ "bz_$bug.resolution" FILTER css_class_quote IF bug.resolution -%]
[%+ "bz_secure" IF bug.secure_mode -%]
[%+ "bz_secure_mode_$bug.secure_mode" FILTER css_class_quote IF bug.secure_mode -%]
[%+ count % 2 == 1 ? "bz_row_odd" : "bz_row_even" -%]
">
[% IF dotweak %]
<td class="bz_checkbox_column">
<input type="checkbox" id="id_[% bug.bug_id %]" name="id_[% bug.bug_id %]" />
</td>
[% END %]
<td class="first-child bz_id_column">
<a name="b[% bug.bug_id %]"
href="show_bug.cgi?id=[% bug.bug_id %]">[% bug.bug_id %]</a>
<span style="display: none">[%+ '[SEC]' IF bug.secure_mode %]</span>
</td>
[% FOREACH column = displaycolumns %]
<td class="bz_[% column FILTER css_class_quote %]_column
[%- IF Bugzilla.COLUMNS.$column.subid %] bz_[% Bugzilla.COLUMNS.$column.subid | css_class_quote %]_column[% END %]"
[%- IF abbrev.$column.maxlength %] title="[%- bug.$column | html %]"[% END %]>
[% IF abbrev.$column.format_value %]
[%- bug.$column FILTER format(abbrev.$column.format_value) FILTER html -%]
[% ELSIF Bugzilla.get_field(column).type == constants.FIELD_TYPE_BUG_ID %]
[% bug.$column FILTER bug_link(bug.$column) IF bug.$column %]
[% ELSIF column == 'work_time' ||
column == 'remaining_time' ||
column == 'estimated_time' ||
column == 'interval_time' %]
[% PROCESS formattimeunit time_unit=bug.$column %]
[%# Display the login name of the user if their real name is empty. %]
[% ELSIF column.match('_realname$') && bug.$column == '' %]
[% SET login_column = column.remove('_realname$') %]
[% bug.${login_column}.truncate(
abbrev.$column.maxlength,
abbrev.$column.ellipsis
) FILTER html %]
[% ELSIF column == 'blocked' OR column == 'dependson' %]
[% bug.$column | bug_list_link %]
[% ELSIF column == 'short_desc' %]
<a href="show_bug.cgi?id=[% bug.bug_id %]">
[%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%]
</a>
[% ELSE %]
[%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%]
[% END %]
</td>
[% END %]
[%# vitalif@mail.ru --- A "hook" into the bug row for building custom views based on table view %]
[% IF bug_table_callback %][% bug_table_callback FILTER process %][% END %]
</tr>
[% IF loop.last() && time_info.time_present == 1 %]
[% PROCESS time_summary_line %]
[% END %]
[% END %]
</tbody>
</table>
[% BLOCK time_summary_line %]
<tr class="bz_time_summary_line">
[% columns_to_span = 1 %] [%# bugID %]
[% IF dotweak %]
[% columns_to_span = columns_to_span + 1 %]
[% END %]
[% FOREACH column = displaycolumns %]
[% IF column == 'work_time' ||
column == 'remaining_time' ||
column == 'estimated_time' ||
column == 'percentage_complete' ||
column == 'interval_time' %]
[% IF columns_to_span > 0 %]
<td class="bz_total bz_total_label" colspan="
[%- columns_to_span FILTER html %]"><b>Totals</b></td>
[% columns_to_span = 0 %]
[% END %]
[% IF column == 'percentage_complete' %]
<td class="bz_total">[% time_info.percentage_complete
FILTER format(abbrev.$column.format_value) FILTER html %]</td>
[% ELSE %]
<td class="bz_total">
[%- PROCESS formattimeunit time_unit=time_info.$column %]</td>
[% END %]
[% ELSIF columns_to_span == 0 %] [%# A column following the first total %]
<td class="bz_total">&nbsp;</td>
[% ELSE %] [%# We haven't gotten to a time column yet, keep computing span %]
[% columns_to_span = columns_to_span + 1 %]
[% END %]
[% END %]
[%# vitalif@mail.ru --- A "hook" into the bug row for building custom views based on table view %]
[% IF bug_time_summary_line_callback %][% bug_time_summary_line_callback FILTER process %][% END %]
</tr>
[% END %]