summaryrefslogtreecommitdiffstats
path: root/template/en/default
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-02-17 03:05:05 +0100
committermkanat%kerio.com <>2005-02-17 03:05:05 +0100
commitfc3aa3e7aa78106e8148b3ecbd92e65e5ad63985 (patch)
tree8d2496e53e9ac2ab4db8b013ec9b9bd75b252a5a /template/en/default
parente8e8e8394944fb0d2e0f285b4f4104c27db1771a (diff)
downloadbugzilla-fc3aa3e7aa78106e8148b3ecbd92e65e5ad63985.tar.gz
bugzilla-fc3aa3e7aa78106e8148b3ecbd92e65e5ad63985.tar.xz
Bug 280412: Templatize the 'list products' bit of editproducts
Patch By Gavin Shelly <bugzilla@chimpychompy.org> r=wurblzap, a=myk
Diffstat (limited to 'template/en/default')
-rw-r--r--template/en/default/admin/products/footer.html.tmpl86
-rw-r--r--template/en/default/admin/products/list.html.tmpl119
-rw-r--r--template/en/default/admin/table.html.tmpl15
-rw-r--r--template/en/default/filterexceptions.pl9
4 files changed, 226 insertions, 3 deletions
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 <bugzilla@chimpychompy.org>
+ #%]
+
+[%# 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 %]&amp;classification=
+ [%- classification FILTER url_quote %]
+ [% END %]
+ [% classification_text = BLOCK %]
+ of classification '[% classification FILTER html %]'
+ [% END %]
+[% END %]
+
+<p>
+
+<hr>
+
+[% UNLESS no_add_product_link %]
+ <a title="Add a product"
+ href="editproducts.cgi?action=add">Add</a> 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 %]
+ (<a title="Add a product to classification '
+ [%- classification FILTER html %]'"
+ href="editproducts.cgi?action=add
+ [%- classification_url_part %]">to
+ classification '[% classification FILTER html %]'</a>)
+ [% END %].
+[% END %]
+
+[% IF name && !no_edit_product_link %]
+ Edit product <a
+ title="Edit Product '[% name FILTER html %]'
+ [% classification_text %]"
+ href="editproducts.cgi?action=edit&amp;product=
+ [%- name FILTER url_quote %][% classification_url_part %]">
+ '[% name FILTER html %]'</a>FRED
+[% END %]
+
+
+[% UNLESS no_edit_other_products_link %]
+ Edit other products [% classification_text %]<a
+ href="editproducts.cgi?product=
+ [%- name FILTER url_quote %]
+ [%- classification_url_part %]">'
+ [%- classification FILTER html %]'</a>
+
+[% END %]
+
+[% IF Param('useclassification') && classification %]
+ Edit classification <a href="editclassifications.cgi?action=edit
+ [%- classification_url_part %]">'
+ [%- classification FILTER html %]'</a>.
+
+[% END %]
+
+</p>
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 <bugzilla@chimpychompy.org>
+ #%]
+
+[%# 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 %]&amp;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&amp;product=%%name%%
+ [%- classification_url_part %]
+[% END %]
+[% delete_contentlink = BLOCK %]
+ editproducts.cgi?action=del&amp;product=%%name%%
+ [%- classification_url_part %]
+[% END %]
+[% bug_count_contentlink = BLOCK %]buglist.cgi?product=%%name%%&amp;
+ [%- 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
+%]
+
+<p>
+
+[% 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',