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/admin/params/common.html.tmpl | 14 ++++++++++- .../en/default/admin/workflow/comment.html.tmpl | 4 +-- template/en/default/admin/workflow/edit.html.tmpl | 6 ++--- template/en/default/bug/activity/table.html.tmpl | 12 ++------- template/en/default/bug/create/create.html.tmpl | 7 ++---- template/en/default/bug/show-multiple.html.tmpl | 6 ++--- template/en/default/global/code-error.html.tmpl | 2 +- template/en/default/global/field-descs.none.tmpl | 1 + 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 ++---------- template/en/default/pages/bug-writing.html.tmpl | 4 +-- template/en/default/pages/fields.html.tmpl | 29 +++++++++++----------- .../en/default/reports/duplicates-table.html.tmpl | 6 ++--- template/en/default/reports/report-bar.png.tmpl | 24 +++--------------- template/en/default/reports/report-line.png.tmpl | 24 +++--------------- template/en/default/reports/report-pie.png.tmpl | 12 ++------- template/en/default/reports/report-table.csv.tmpl | 8 ++---- template/en/default/reports/report-table.html.tmpl | 8 ++---- template/en/default/search/form.html.tmpl | 12 ++------- template/en/default/whine/mail.html.tmpl | 6 ++--- template/en/default/whine/mail.txt.tmpl | 6 ++--- 23 files changed, 79 insertions(+), 152 deletions(-) (limited to 'template') diff --git a/template/en/default/admin/params/common.html.tmpl b/template/en/default/admin/params/common.html.tmpl index c23c2ca9a..5b0d00429 100644 --- a/template/en/default/admin/params/common.html.tmpl +++ b/template/en/default/admin/params/common.html.tmpl @@ -22,6 +22,8 @@ # panel: hash representing the current panel. #%] +[% PROCESS "global/field-descs.none.tmpl" %] + [% sortlist_separator = '---' %]
@@ -115,7 +117,17 @@ [% FOREACH item = param.choices %] [% END %] diff --git a/template/en/default/admin/workflow/comment.html.tmpl b/template/en/default/admin/workflow/comment.html.tmpl index 2fa78f003..a7a6a74c2 100644 --- a/template/en/default/admin/workflow/comment.html.tmpl +++ b/template/en/default/admin/workflow/comment.html.tmpl @@ -49,7 +49,7 @@   [% FOREACH status = statuses %] - [% status.name FILTER html %] + [% display_value("bug_status", status.name) FILTER html %] [% END %] @@ -59,7 +59,7 @@ [% FOREACH status = p.merge(statuses) %] - [% status.name FILTER html %] + [% display_value("bug_status", status.name) FILTER html %] [% FOREACH new_status = statuses %] diff --git a/template/en/default/admin/workflow/edit.html.tmpl b/template/en/default/admin/workflow/edit.html.tmpl index 787937989..406c08a21 100644 --- a/template/en/default/admin/workflow/edit.html.tmpl +++ b/template/en/default/admin/workflow/edit.html.tmpl @@ -54,7 +54,7 @@   [% FOREACH status = statuses %] - [% status.name FILTER html %] + [% display_value("bug_status", status.name) FILTER html %] [% END %] @@ -64,7 +64,7 @@ [% FOREACH status = p.merge(statuses) %] - [% status.name FILTER html %] + [% display_value("bug_status", status.name) FILTER html %] [% FOREACH new_status = statuses %] @@ -89,7 +89,7 @@

When [% terms.abug %] is marked as a duplicate of another one or is moved to another installation, the [% terms.bug %] status is automatically set to - [% Param("duplicate_or_move_bug_status") FILTER html %]. All transitions to + [% display_value("bug_status", Param("duplicate_or_move_bug_status")) FILTER html %]. All transitions to this [% terms.bug %] status must then be valid (this is the reason why you cannot edit them above).
Note: you can change this setting by visiting the diff --git a/template/en/default/bug/activity/table.html.tmpl b/template/en/default/bug/activity/table.html.tmpl index a467fe5f2..ae9dbcb80 100644 --- a/template/en/default/bug/activity/table.html.tmpl +++ b/template/en/default/bug/activity/table.html.tmpl @@ -80,15 +80,11 @@ change.fieldname == 'remaining_time' || change.fieldname == 'work_time' %] [% PROCESS formattimeunit time_unit=change.removed %] - [% ELSIF change.fieldname == 'bug_status' %] - [% display_value("bug_status", change.removed) FILTER html %] - [% ELSIF change.fieldname == 'resolution' %] - [% display_value("resolution", change.removed) FILTER html %] [% ELSIF change.fieldname == 'blocked' || change.fieldname == 'dependson' %] [% change.removed FILTER bug_list_link FILTER none %] [% ELSE %] - [% change.removed FILTER email FILTER html %] + [% display_value(change.fieldname, change.removed) FILTER email FILTER html %] [% END %] [% ELSE %]   @@ -100,15 +96,11 @@ change.fieldname == 'remaining_time' || change.fieldname == 'work_time' %] [% PROCESS formattimeunit time_unit=change.added %] - [% ELSIF change.fieldname == 'bug_status' %] - [% display_value("bug_status", change.added) FILTER html %] - [% ELSIF change.fieldname == 'resolution' %] - [% display_value("resolution", change.added) FILTER html %] [% ELSIF change.fieldname == 'blocked' || change.fieldname == 'dependson' %] [% change.added FILTER bug_list_link FILTER none %] [% ELSE %] - [% change.added FILTER email FILTER html %] + [% display_value(change.fieldname, change.added) FILTER email FILTER html %] [% END %] [% ELSE %]   diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 3572ec372..f466f7704 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -664,11 +664,8 @@ TUI_hide_default('expert_fields'); [%- FOREACH x = ${sel.name} %] + [% display_value(sel.name, x) FILTER html %] + [% END %] diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl index b6507b964..177bea14f 100644 --- a/template/en/default/bug/show-multiple.html.tmpl +++ b/template/en/default/bug/show-multiple.html.tmpl @@ -139,7 +139,7 @@ [% field_descs.bug_severity FILTER html %]: - [% bug.bug_severity FILTER html %] + [% display_value("bug_severity", bug.bug_severity) FILTER html %] [% PROCESS rightcell %] @@ -301,7 +301,7 @@ [% BLOCK row %] [% field_descs.${cell} FILTER html %]: - [% bug.${cell} FILTER html %] + [% display_value(cell, bug.${cell}) FILTER html %] [% PROCESS rightcell IF !fullrow %] [% fullrow = 0 %] @@ -357,7 +357,7 @@ [% ELSIF name != "" %] [% field_descs.${name} FILTER html %]: - [% bug.${name} FILTER html %] + [% display_value(name, bug.${name}) FILTER html %] [% ELSE %]     diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index 64bd41af3..f35c1ec93 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -327,7 +327,7 @@ A valid quipid is needed. [% ELSIF error == "no_manual_moved" %] - You cannot set the resolution of [% terms.abug %] to MOVED without + You cannot set the resolution of [% terms.abug %] to display_value("resolution", "MOVED") FILTER html %] without moving the [% terms.bug %]. [% ELSIF error == "no_open_bug_status" %] diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl index 278800594..5012769ca 100644 --- a/template/en/default/global/field-descs.none.tmpl +++ b/template/en/default/global/field-descs.none.tmpl @@ -146,6 +146,7 @@ }, "resolution" => { + "" => "---", # "FIXED" => "NO LONGER AN ISSUE", # "MOVED" => "BYE-BYE", }, 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 %] diff --git a/template/en/default/pages/bug-writing.html.tmpl b/template/en/default/pages/bug-writing.html.tmpl index 035876bb1..ec997be0a 100644 --- a/template/en/default/pages/bug-writing.html.tmpl +++ b/template/en/default/pages/bug-writing.html.tmpl @@ -78,8 +78,8 @@ no-one else appears to have reported it, then:

it? (e.g. Linux, Windows XP, Mac OS X.)
If you know the [% terms.bug %] happens on more than one type of - operating system, choose "All". - If your OS isn't listed, choose Other.

+ operating system, choose [% display_value("op_sys", "All") FILTER html %]. + If your OS isn't listed, choose [% display_value("op_sys", "Other") FILTER html %].

Summary: How would you describe the [% terms.bug %], in approximately 60 or fewer characters?
diff --git a/template/en/default/pages/fields.html.tmpl b/template/en/default/pages/fields.html.tmpl index 9e938bbcb..5be28cab7 100644 --- a/template/en/default/pages/fields.html.tmpl +++ b/template/en/default/pages/fields.html.tmpl @@ -19,7 +19,6 @@ # Gervase Markham #%] -[% PROCESS global/variables.none.tmpl %] [% PROCESS "global/field-descs.none.tmpl" %] [% INCLUDE global/header.html.tmpl title = "A $terms.Bug's Life Cycle" %] @@ -221,46 +220,46 @@ This field describes the impact of [% terms.abug %]. - + - + - + - + - + - + - +
Blocker[% display_value("bug_severity", "blocker") FILTER html %] Blocks development and/or testing work
Critical[% display_value("bug_severity", "critical") FILTER html %] crashes, loss of data, severe memory leak
Major[% display_value("bug_severity", "major") FILTER html %] major loss of function
Normal[% display_value("bug_severity", "normal") FILTER html %] regular issue, some loss of functionality under specific circumstances
Minor[% display_value("bug_severity", "minor") FILTER html %] minor loss of function, or other problem where easy workaround is present
Trivial[% display_value("bug_severity", "trivial") FILTER html %] cosmetic problem like misspelled words or misaligned text
Enhancement[% display_value("bug_severity", "enhancement") FILTER html %] Request for enhancement
@@ -270,23 +269,25 @@ This is the hardware platform against which the [% terms.bug %] was reported. Legal platforms include:

-Note: When searching, selecting the option "All" does not +Note: When searching, selecting the option +[% display_value("rep_platform", "All") FILTER html %] does not select [% terms.bugs %] assigned against any platform. It merely selects [% terms.bugs %] that are -marked as occurring on all platforms, i.e. are designated "All". +marked as occurring on all platforms, i.e. are designated +[% display_value("rep_platform", "All") FILTER html %].

Operating System

This is the operating system against which the [% terms.bug %] was reported. Legal operating systems include: