From a43231dd4ccef2b02fa0434217b637a6d1638c97 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 3 Oct 2008 06:40:15 +0000 Subject: Bug 456922: Now that Bugzilla::Field::Choice is complete, clean up editvalues.cgi and error messages Patch By Max Kanat-Alexander r=bbaetz, a=mkanat --- .../admin/fieldvalues/confirm-delete.html.tmpl | 83 ++++++++++++---------- .../en/default/admin/fieldvalues/create.html.tmpl | 13 ++-- .../en/default/admin/fieldvalues/edit.html.tmpl | 32 ++++----- .../en/default/admin/fieldvalues/footer.html.tmpl | 9 +-- .../en/default/admin/fieldvalues/list.html.tmpl | 31 ++++---- 5 files changed, 87 insertions(+), 81 deletions(-) (limited to 'template/en/default/admin') diff --git a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl index d18e03a53..12be0e8e4 100644 --- a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl +++ b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl @@ -14,18 +14,14 @@ #%] [%# INTERFACE: - # value: string; The field value being deleted. - # bug_count: number; The number of bugs that have this field value. - # value_count: number; The number of values left for this field, including - # this value. + # value: Bugzilla::Field::Choice; The field value being deleted. + # value_count: number; The number of values available for this field. # field: object; the field the value is being deleted from. - # param_name: string; The name of the parameter (defaultxxx) associated - # with the field. #%] [% title = BLOCK %] - Delete Value '[% value FILTER html %]' from the '[% field.description FILTER html %]' - ([% field.name FILTER html %]) field + Delete Value '[% value.name FILTER html %]' from the + '[% field.description FILTER html %]' ([% field.name FILTER html %]) field [% END %] [% PROCESS global/header.html.tmpl @@ -44,15 +40,18 @@ Field Value: - [% value FILTER html %] + [% value.name FILTER html %] [% terms.Bugs %]: -[% IF bug_count %] - [% bug_count FILTER html %] +[% IF value.bug_count %] + + [%- value.bug_count FILTER html %] [% ELSE %] None [% END %] @@ -62,44 +61,52 @@

Confirmation

-[% IF (param_name.defined && Param(param_name) == value) || bug_count || (value_count == 1) %] +[% IF value.is_default || value.bug_count || (value_count == 1) %] -

Sorry, but the '[% value FILTER html %]' value cannot be deleted - from the '[% field.description FILTER html %]' field for the following reason(s):

+

Sorry, but the '[% value.name FILTER html %]' value cannot be deleted + from the '[% field.description FILTER html %]' field for the following + reason(s):

@@ -111,7 +118,7 @@ - + diff --git a/template/en/default/admin/fieldvalues/create.html.tmpl b/template/en/default/admin/fieldvalues/create.html.tmpl index fe906bfe3..9d318cd1d 100644 --- a/template/en/default/admin/fieldvalues/create.html.tmpl +++ b/template/en/default/admin/fieldvalues/create.html.tmpl @@ -26,26 +26,27 @@ %]

- This page allows you to add a new value for the '[% field.description FILTER html %]' field. + This page allows you to add a new value for the + '[% field.description FILTER html %]' field.

- + - + [% IF field.name == "bug_status" %]
- +
diff --git a/template/en/default/admin/fieldvalues/edit.html.tmpl b/template/en/default/admin/fieldvalues/edit.html.tmpl index 98b480ba8..29f881ec8 100644 --- a/template/en/default/admin/fieldvalues/edit.html.tmpl +++ b/template/en/default/admin/fieldvalues/edit.html.tmpl @@ -14,16 +14,15 @@ #%] [%# INTERFACE: - # value: string; The field value we are editing. - # sortkey: number; Sortkey of the field value we are editing. - # field: object; The field this value belongs to. + # value: Bugzilla::Field::Choice; The field value we are editing. + # field: Bugzilla::Field; The field this value belongs to. #%] [% PROCESS global/variables.none.tmpl %] [% title = BLOCK %] - Edit Value '[% value FILTER html %]' for the '[% field.description FILTER html %]' - ([% field.name FILTER html %]) field + Edit Value '[% value.name FILTER html %]' for the + '[% field.description FILTER html %]' ([% field.name FILTER html %]) field [% END %] [% PROCESS global/header.html.tmpl title = title @@ -33,32 +32,33 @@ - + - + [% IF field.name == "bug_status" %] - + [% END %]
- [% IF is_static %] - - [% value FILTER html %] + [% IF value.is_static %] + + [%- value.name FILTER html %] [% ELSE %] - + [% END %]
[% IF is_open %]Open[% ELSE %]Closed[% END %][% IF value.is_open %]Open[% ELSE %]Closed[% END %]
- - + diff --git a/template/en/default/admin/fieldvalues/footer.html.tmpl b/template/en/default/admin/fieldvalues/footer.html.tmpl index dcb6dbc8d..288612d4c 100644 --- a/template/en/default/admin/fieldvalues/footer.html.tmpl +++ b/template/en/default/admin/fieldvalues/footer.html.tmpl @@ -35,13 +35,14 @@ [%- field.name FILTER url_quote %]">Add a value. [% END %] -[% IF value && !no_edit_link %] +[% IF value.defined && !no_edit_link %] Edit value - '[% value FILTER html %]'. + [%- field.name FILTER url_quote %]&value= + [%- value.name FILTER url_quote %]"> + '[% value.name FILTER html %]'. [% END %] [% UNLESS no_edit_other_link %] diff --git a/template/en/default/admin/fieldvalues/list.html.tmpl b/template/en/default/admin/fieldvalues/list.html.tmpl index d14bbc26d..976b58ae7 100644 --- a/template/en/default/admin/fieldvalues/list.html.tmpl +++ b/template/en/default/admin/fieldvalues/list.html.tmpl @@ -58,26 +58,13 @@ } ] %] -[% IF default.defined %] - [% overrides.action = [ { - match_value => "$default" - match_field => 'name' - override_content => 1 - content => "(Default value)" - override_contentlink => 1 - contentlink => undef - } ] - %] -[% END %] -[% IF static.size %] - [% UNLESS overrides.action.size %] - [% overrides.action = [] %] - [% END %] +[% SET overrides.action = [] %] +[% FOREACH check_value = values %] - [% FOREACH static_value = static %] + [% IF check_value.is_static %] [% overrides.action.push({ - match_value => "$static_value" + match_value => check_value.name match_field => 'name' override_content => 1 content => "(Non-deletable value)" @@ -85,7 +72,17 @@ contentlink => undef }) %] + [% ELSIF check_value.is_default %] + [% overrides.action.push({ + match_value => check_value.name + match_field => 'name' + override_content => 1 + content => "(Default value)" + override_contentlink => 1 + contentlink => undef }) + %] [% END %] + [% END %] [% PROCESS admin/table.html.tmpl -- cgit v1.2.3-24-g4f1b