From fc3aa3e7aa78106e8148b3ecbd92e65e5ad63985 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Thu, 17 Feb 2005 02:05:05 +0000 Subject: Bug 280412: Templatize the 'list products' bit of editproducts Patch By Gavin Shelly r=wurblzap, a=myk --- .../en/default/admin/products/footer.html.tmpl | 86 +++++++++++++++ template/en/default/admin/products/list.html.tmpl | 119 +++++++++++++++++++++ template/en/default/admin/table.html.tmpl | 15 ++- template/en/default/filterexceptions.pl | 9 ++ 4 files changed, 226 insertions(+), 3 deletions(-) create mode 100644 template/en/default/admin/products/footer.html.tmpl create mode 100644 template/en/default/admin/products/list.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 new file mode 100644 index 000000000..0276437f3 --- /dev/null +++ b/template/en/default/admin/products/footer.html.tmpl @@ -0,0 +1,86 @@ +[%# 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. + # + # Contributor(s): Gavin Shelley + #%] + +[%# INTERFACE: + # name: string; the name of the product + # + # classification: string; If classifications are enabled, then this is + # the currently selected classification + # + # no_XXX_link: boolean; if defined, then don't show the corresponding + # link. Supported parameters are: + # + # no_edit_product_link + # no_edit_other_products_link + # no_add_product_link + #%] + +[% IF classification %] + [% classification_url_part = BLOCK %]&classification= + [%- classification FILTER url_quote %] + [% END %] + [% classification_text = BLOCK %] + of classification '[% classification FILTER html %]' + [% END %] +[% END %] + +

+ +


+ +[% UNLESS no_add_product_link %] + Add a product + + + [%# Strictly speaking, we should not have to check for a + classification if they are enabled, but I'm just being paranoid %] + [% IF Param('useclassification') && classification %] + (to + classification '[% classification FILTER html %]') + [% END %]. +[% END %] + +[% IF name && !no_edit_product_link %] + Edit product + '[% name FILTER html %]'FRED +[% END %] + + +[% UNLESS no_edit_other_products_link %] + Edit other products [% classification_text %]' + [%- classification FILTER html %]' + +[% END %] + +[% IF Param('useclassification') && classification %] + Edit classification ' + [%- classification FILTER html %]'. + +[% END %] + +

diff --git a/template/en/default/admin/products/list.html.tmpl b/template/en/default/admin/products/list.html.tmpl new file mode 100644 index 000000000..98676e198 --- /dev/null +++ b/template/en/default/admin/products/list.html.tmpl @@ -0,0 +1,119 @@ +[%# 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. + # + # Contributor(s): Gavin Shelley + #%] + +[%# INTERFACE: + # products: array of hashes having the following properties: + # - name: string; The name of the product + # - description: string; The product description (html allowed) + # - status: boolean; Can new bugs be created for the product? + # - votesperuser: number; The number of votes a user is allowed + # in the product + # - maxvotersperbug: number; Maximum votes allowed per bug in this + # product + # - votestoconfirm: number; The number of votes that are needed to + # auto-confirm a bug in this product + # - bug_count: number; The number of bugs in this product + # + # classification: string; If classifications are enabled, then this is + # the currently selected classification + #%] + +[% PROCESS global/variables.none.tmpl %] + +[% IF classification %] + [% classification_url_part = BLOCK %]&classification= + [%- classification FILTER url_quote %] + [%- END %] + [% classification_title = BLOCK %] + in classification '[% classification FILTER html %]' + [% END %] +[% END %] + +[% PROCESS global/header.html.tmpl + title = "Select product $classification_title" +%] + +[% edit_contentlink = BLOCK %] + editproducts.cgi?action=edit&product=%%name%% + [%- classification_url_part %] +[% END %] +[% delete_contentlink = BLOCK %] + editproducts.cgi?action=del&product=%%name%% + [%- classification_url_part %] +[% END %] +[% bug_count_contentlink = BLOCK %]buglist.cgi?product=%%name%%& + [%- classification_url_part %][% END %] + + +[% columns = [ + { + name => "name" + heading => "Edit product..." + contentlink => edit_contentlink + }, + { + name => "description" + heading => "Description" + allow_html_content => 1 + }, + { + name => "status" + heading => "Open For New $terms.Bugs" + yesno_field => 1 + }, + { + name => "votesperuser" + heading => "Votes Per User" + align => 'right' + }, + { + name => "maxvotesperbug" + heading => "Maximum Votes Per $terms.Bug" + align => 'right' + }, + { + name => "votestoconfirm" + heading => "Votes To Confirm" + align => 'right' + }, + { + name => "bug_count" + heading => "$terms.Bug Count" + align => 'right' + contentlink => bug_count_contentlink + }, + ] +%] + +[% columns.push({ + heading => "Action" + content => "Delete" + contentlink => delete_contentlink + }) +%] + +[% PROCESS admin/table.html.tmpl + columns = columns + data = products +%] + +

+ +[% PROCESS admin/products/footer.html.tmpl + no_edit_other_products_link = 1 + %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/table.html.tmpl b/template/en/default/admin/table.html.tmpl index ac4e5a666..fd1382b14 100644 --- a/template/en/default/admin/table.html.tmpl +++ b/template/en/default/admin/table.html.tmpl @@ -37,6 +37,7 @@ # text in the column. # allow_html_content: if defined, then this column allows html content # so it will not be filtered + # yesno_field: Turn the data from 0/!0 into Yes/No # # data: # array of hashes representing the data for the table. @@ -79,10 +80,18 @@ [% IF c.content %] [% c.content %] [% ELSE %] - [% IF c.allow_html_content %] - [% row.${c.name} FILTER none %] + [% IF c.yesno_field %] + [% IF row.${c.name} %] + Yes + [% ELSE %] + No + [% END %] [% ELSE %] - [% row.${c.name} FILTER html %] + [% IF c.allow_html_content %] + [% row.${c.name} FILTER none %] + [% ELSE %] + [% row.${c.name} FILTER html %] + [% END %] [% END %] [% END %] diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 8f297ef42..9fc4232b0 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -526,6 +526,15 @@ 'const.CONTROLMAPMANDATORY', ], +'admin/products/list.html.tmpl' => [ + 'classification_url_part', +], + +'admin/products/footer.html.tmpl' => [ + 'classification_url_part', + 'classification_text', +], + 'admin/keywords/edit.html.tmpl' => [ 'keyword_id', 'bug_count', -- cgit v1.2.3-24-g4f1b