From b173be41f6e36f7abd0134090b9906db3f2ffd30 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 8 Sep 2005 23:58:56 +0000 Subject: Bug 306242: Templatize the 'update product' bit of editproducts.cgi - Patch by GavinS r=LpSolit a=justdave --- .../en/default/admin/products/footer.html.tmpl | 15 +- .../en/default/admin/products/updated.html.tmpl | 220 +++++++++++++++++++++ template/en/default/global/user-error.html.tmpl | 54 ++++- 3 files changed, 278 insertions(+), 11 deletions(-) create mode 100644 template/en/default/admin/products/updated.html.tmpl (limited to 'template') diff --git a/template/en/default/admin/products/footer.html.tmpl b/template/en/default/admin/products/footer.html.tmpl index 2244c69a1..157e71582 100644 --- a/template/en/default/admin/products/footer.html.tmpl +++ b/template/en/default/admin/products/footer.html.tmpl @@ -32,6 +32,9 @@ [% classification_url_part = BLOCK %]&classification= [%- classification FILTER url_quote %] [% END %] + [% classification_url_part_start = BLOCK %]classification= + [%- classification FILTER url_quote %] + [% END %] [% classification_text = BLOCK %] of classification '[% classification FILTER html %]' [% END %] @@ -61,16 +64,16 @@ [% classification_text %]" href="editproducts.cgi?action=edit&product= [%- name FILTER url_quote %][% classification_url_part %]"> - '[% name FILTER html %]' + '[% name FILTER html %]'. [% END %] +[%# Edit other products (in a classification if specified): %] [% UNLESS no_edit_other_products_link %] - Edit other products [% classification_text %]' - [%- classification FILTER html %]' + Edit other products + [% classification_text %]. [% END %] diff --git a/template/en/default/admin/products/updated.html.tmpl b/template/en/default/admin/products/updated.html.tmpl new file mode 100644 index 000000000..7c00c4ae5 --- /dev/null +++ b/template/en/default/admin/products/updated.html.tmpl @@ -0,0 +1,220 @@ +[%# 1.0@bugzilla.org %] +[%# 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): Gavin Shelley + #%] + +[%# INTERFACE: + # + # updated_XXX : boolean; is true when the 'XXX' field has been updated. + # old_XXX : ... string; old value of the field 'XXX'. + # new_XXX : ... string; new value of the field 'XXX'. + # + # updated_product: boolean; the name of the product was updated + # + # updated_description: boolean; the product description was updated + # + # updated_milestoneurl: boolean; the product milestone URL was updated + # + # updated_votesperuser: boolean; the votes per user was updated + # + # updated_maxvotesperbug: boolean; the max votes per bug was updated + # + # updated_votestoconfirm: boolean; the votes to confirm a bug was updated + # + # updated_defaultmilestone: boolean; the default milestone was updated + # + # updated_bugsubmitstatus: boolean; the open/closed for new bugs status + # was updated (no 'old_XXX' value) + # + # classification: string; The product classification (may be empty or missing) + # + # changer: string; user id of the user making the changes, used for mailing + # bug changes if necessary + # + # name: string; the product name + # + # checkvotes: boolean; is true if vote related fields have changed. If so, + # then the following parameters will be specified: + # + # toomanyvotes: list of hashes, each one with an 'id' and a 'name' hash key + # detailing the bug id and the username of users who had too + # many votes for a bug + # + # toomanytotalvotes: list of hashes, each one with an 'id' and a 'name' hash key + # detailing the bug id and the username of users who had + # too many total votes + # + # confirmedbugs: list of bug ids, which were confirmed by votes + # + #%] + +[% IF classification %] + [% classification_url_part = BLOCK %]&classification= + [%- classification FILTER url_quote %] + [% END %] + [% classification_text = BLOCK %] + of classification '[% classification FILTER html %]' + [% END %] +[% END %] + +[% title = BLOCK %]Updating Product '[% name FILTER html %]' + [% classification_text FILTER none %][% END %] +[% PROCESS global/header.html.tmpl + title = title + style_urls = ['skins/standard/admin.css'] +%] + +[% IF updated_product %] +

+ Updated product name from '[% old_product FILTER html %]' to + [% new_product FILTER html %]. +[% END %] + + +[% IF updated_description %] +

+ Updated description to:

+

+

[% new_description FILTER html %]

+[% END %] + +[% IF updated_bugsubmitstatus %] +

+ Product is now + [% IF new_bugsubmitstatus %] + closed to + [% ELSE %] + open for + [% END %] + new [% terms.bugs %]. +[% END %] + +[% IF updated_milestoneurl %] +

+ Updated milestone URL + [% IF old_milestoneurl != '' %] + from
' + [%- old_milestoneurl FILTER html %]' + [% END %] + to + [% IF new_milestoneurl != '' %] +
' + [%- new_milestoneurl FILTER html %]'. + [% ELSE %] + be empty. + [% END %] +

+[% END %] + +[% IF updated_defaultmilestone %] +

+ Updated default milestone from '[% old_defaultmilestone FILTER html %]' to + '[% new_defaultmilestone FILTER html %]'. +

+[% END %] + +[% IF updated_votesperuser %] +

+ Updated votes per user from + [%+ old_votesperuser FILTER html %] to + [%+ new_votesperuser FILTER html %]. +[% END %] + +[% IF updated_maxvotesperbug %] +

+ Updated maximum votes per [% terms.bug %] from + [%+ old_maxvotesperbug FILTER html %] to + [%+ new_maxvotesperbug FILTER html %]. +[% END %] + +[% IF updated_votestoconfirm %] +

+ Updated number of votes needed to confirm a [% terms.bug %] from + [%+ old_votestoconfirm FILTER html %] to + [%+ new_votestoconfirm FILTER html %]. +[% END %] + +[% UNLESS updated_bugsubmitstatus || + updated_description || + updated_milestoneurl || + updated_votesperuser || + updated_maxvotesperbug || + updated_votestoconfirm || + updated_defaultmilestone || + updated_product %] +

Nothing changed for product '[% name FILTER html %]'. +[% END %] + +[%# Note that this display of changed votes and/or confirmed bugs is + not very scalable. We could have a _lot_, and we just list them all. + One day we should limit this perhaps, or have a more scalable display %] + + +[% IF checkvotes %] +


+ +

Checking existing votes in this product for anybody who now + has too many votes for [% terms.abug %]...
+ [% IF toomanyvotes.size > 0 %] + [% FOREACH detail = toomanyvotes %] + →removed votes for [% terms.bug %] + [%- detail.id FILTER html %] from [% detail.name FILTER html %]
+ [% END %] + [% ELSE %] + →there were none. + [% END %] + +

Checking existing votes in this product for anybody + who now has too many total votes...
+ [% IF toomanytotalvotes.size > 0 %] + [% FOREACH detail = toomanytotalvotes %] + →removed votes for [% terms.bug %] + [%- detail.id FILTER html %] from [% detail.name FILTER html %]
+ [% END %] + [% ELSE %] + →there were none. + [% END %] + +

Checking unconfirmed [% terms.bugs %] in this product for any which now have + sufficient votes...
+ [% IF confirmedbugs.size > 0 %] + [% FOREACH id = confirmedbugs %] + + [%# This is INCLUDED instead of PROCESSED to avoid variables getting + overwritten, which happens otherwise %] + [% INCLUDE bug/process/results.html.tmpl + type = 'votes' + mailrecipients = { 'changer' => changer } + header_done = 1 + id = id + %] + [% END %] + [% ELSE %] + →there were none. + [% END %] + +[% END %] + +[% PROCESS admin/products/footer.html.tmpl %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 34340fc41..be6108e81 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -288,11 +288,6 @@ [% title = "Component Requires Default Assignee" %] You must enter a default assignee for component '[% name FILTER html %]'. - [% ELSIF error == "product_not_specified" %] - [% title = "No Product Specified" %] - No product specified when trying to edit components, milestones or - versions. - [% ELSIF error == "component_not_specified" %] [% title = "No Component Specified" %] No component specified when trying to edit components. @@ -951,6 +946,50 @@ Patches cannot be more than [% Param('maxpatchsize') %] KB in size. Try breaking your patch into several pieces. + [% ELSIF error == "prod_votes_per_bug_must_be_nonnegative" %] + [% title = "Maximum Votes Must Be Non-negative" %] + '[% maxvotesperbug FILTER html %]' is an invalid value for the + 'Maximum Votes Per [% terms.Bug %]' field, which should + contain a non-negative number. + + [% ELSIF error == "prod_votes_per_user_must_be_nonnegative" %] + [% title = "Votes Per User Must Be Non-negative" %] + '[% votesperuser FILTER html %]' is an invalid value for the + 'Votes Per User' field, which should contain a + non-negative number. + + [% ELSIF error == "prod_votes_to_confirm_must_be_nonnegative" %] + [% title = "Votes To Confirm Must Be Non-negative" %] + '[% votestoconfirm FILTER html %]' is an invalid value for the + 'Votes To Confirm' field, which should contain a + non-negative number. + + [% ELSIF error == "prod_cant_delete_description" %] + [% title = "Cannot delete product description" %] + Cannot delete the description for product + '[% product FILTER html %]'. + + [% ELSIF error == "prod_cant_delete_name" %] + [% title = "Cannot delete product name" %] + Cannot delete the product name for product '[% product FILTER html %]'. + + [% ELSIF error == "prod_name_already_in_use" %] + [% title = "Product name already in use" %] + The product name '[% product FILTER html %]' is already in use. + + [% ELSIF error == "prod_must_define_defaultmilestone" %] + [% title = "Must define new default milestone" %] + [% IF classification %] + [% classification_url_part = BLOCK %]&classification= + [%- classification FILTER url_quote %] + [% END %] + [% END %] + You must + create the milestone '[% defaultmilestone FILTER html %]' before + it can be made the default milestone for product '[% product FILTER html %]'. + [% ELSIF error == "product_disabled" %] [% title = BLOCK %]Product closed for [% terms.Bugs %] Entry[% END %] Sorry, entering [% terms.bugs %] into the @@ -967,6 +1006,11 @@ You must reassign those [% terms.bugs %] to another product before you can delete this one. + [% ELSIF error == "product_not_specified" %] + [% title = "No Product Specified" %] + No product specified when trying to edit components, milestones, versions + or product. + [% ELSIF error == "query_name_missing" %] [% title = "No Search Name Specified" %] You must enter a name for your search. -- cgit v1.2.3-24-g4f1b