From a44e152480c9c22ca9b3a89da774317c5590d21b Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 18 Nov 2009 07:04:57 +0000 Subject: Bug 519142: Replace IF/ELSE statements about bug_status/resolution with just a display_value call, and use display_value in more places to translate field values. Patch by Vitaly Fedrushkov r=mkanat, a=mkanat --- template/en/default/list/edit-multiple.html.tmpl | 2 +- template/en/default/list/list.atom.tmpl | 10 +++++----- template/en/default/list/list.html.tmpl | 12 ++---------- template/en/default/list/table.html.tmpl | 16 ++-------------- 4 files changed, 10 insertions(+), 30 deletions(-) (limited to 'template/en/default/list') diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl index 528d1bd68..11f3491f2 100644 --- a/template/en/default/list/edit-multiple.html.tmpl +++ b/template/en/default/list/edit-multiple.html.tmpl @@ -368,7 +368,7 @@ [% FOREACH menuitem = menuitems %] [% IF property %][% menuitem = menuitem.$property %][% END %] - + [% END %] [% END %] diff --git a/template/en/default/list/list.atom.tmpl b/template/en/default/list/list.atom.tmpl index 5086a044c..3c504f9c9 100644 --- a/template/en/default/list/list.atom.tmpl +++ b/template/en/default/list/list.atom.tmpl @@ -23,7 +23,7 @@ # This is a template for generating an Atom representation of a buglist. #%] -[% PROCESS global/variables.none.tmpl %] +[% PROCESS "global/field-descs.none.tmpl" %] [% DEFAULT title = "$terms.Bugzilla $terms.Bugs" %] @@ -71,16 +71,16 @@ [% bug.reporter_realname FILTER html %] [% columns.bug_status.title FILTER html %] - [% bug.bug_status FILTER html %] + [% display_value("bug_status", bug.bug_status) FILTER html %] [% columns.resolution.title FILTER html %] - [% bug.resolution FILTER html %] + [% display_value("resolution", bug.resolution) FILTER html %] [% columns.priority.title FILTER html %] - [% bug.priority FILTER html %] + [% display_value("priority", bug.priority) FILTER html %] [% columns.bug_severity.title FILTER html %] - [% bug.bug_severity FILTER html %] + [% display_value("bug_severity", bug.bug_severity) FILTER html %] [% IF Param("usetargetmilestone") %] [% columns.target_milestone.title FILTER html %] diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index 6d7f80585..1e9a9e998 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -91,16 +91,8 @@ [% IF shown_types.contains(desc_item.type) || debug %] ([% search_descs.${desc_item.type} FILTER html %]) [% END %] - [% IF desc_item.field == 'bug_status' %] - [% FOREACH status IN desc_item.value.split(',') %] - [%+ display_value("bug_status", status) FILTER html %][% ',' UNLESS loop.last %] - [% END %] - [% ELSIF desc_item.field == 'resolution' %] - [% FOREACH resolution IN desc_item.value.split(',') %] - [%+ display_value("resolution", resolution) FILTER html %][% ',' UNLESS loop.last %] - [% END %] - [% ELSE %] - [%+ desc_item.value FILTER html %] + [% FOREACH val IN desc_item.value.split(',') %] + [%+ display_value(desc_item.field, val) FILTER html %][% ',' UNLESS loop.last %] [% END %] [% IF debug %] ([% desc_item.term FILTER html %]) diff --git a/template/en/default/list/table.html.tmpl b/template/en/default/list/table.html.tmpl index 6ca90b921..f6a871e19 100644 --- a/template/en/default/list/table.html.tmpl +++ b/template/en/default/list/table.html.tmpl @@ -201,14 +201,7 @@ [% FOREACH column = displaycolumns %] [% IF abbrev.$column.maxlength %] - + [% END %] [% IF abbrev.$column.format_value %] [%- bug.$column FILTER format(abbrev.$column.format_value) FILTER html -%] @@ -216,11 +209,6 @@ column == 'remaining_time' || column == 'estimated_time' %] [% PROCESS formattimeunit time_unit=bug.$column %] - [% ELSIF column == 'bug_status' %] - [%- display_value("bug_status", bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %] - [% ELSIF column == 'resolution' %] - [%- display_value("resolution", bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %] - [%# 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$') %] @@ -228,7 +216,7 @@ abbrev.$column.ellipsis) FILTER html %] [% ELSE %] - [%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%] + [%- display_value(column, bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%] [% END %] [% IF abbrev.$column.maxlength %] -- cgit v1.2.3-24-g4f1b