Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
e06f5266
Commit
e06f5266
authored
Jul 12, 2004
by
jouni%heikniemi.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 244265: Abstract out the typical admin page table to a separate template. r=vladd, a=justdave
parent
abdd4eba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
63 deletions
+127
-63
list.html.tmpl
template/en/default/admin/keywords/list.html.tmpl
+30
-58
table.html.tmpl
template/en/default/admin/table.html.tmpl
+92
-0
filterexceptions.pl
template/en/default/filterexceptions.pl
+5
-5
No files found.
template/en/default/admin/keywords/list.html.tmpl
View file @
e06f5266
...
...
@@ -18,13 +18,12 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Vlad Dascalu <jocuri@softhome.net>
# Jouni Heikniemi <jouni@heikniemi.net>
#%]
[%# INTERFACE:
# max_table_size: number. Determines the maximum number of
# rows in each keywords table.
# keywords: array with keyword objects having the properties:
# -
keyword_
id: number. The ID of the keyword.
# - id: number. The ID of the keyword.
# - name: string. The name of the keyword.
# - description: string. The description of the keyword.
# - bug_count: number. The number of bugs with the keyword.
...
...
@@ -36,62 +35,35 @@
title = "Select keyword"
%]
[% max_table_size = 50 %]
[% BLOCK table_header %]
<table border="1" cellpadding="4" cellspacing="0">
<tr bgcolor="#6666FF">
<th align="left">Edit keyword ...</th>
<th align="left">Description</th>
<th align="left">[% terms.Bugs %]</th>
<th align="left">Action</th>
</tr>
[% END %]
[% BLOCK table_footer %]
</table>
[% END %]
[% PROCESS table_header %]
[% FOREACH keyword = keywords %]
[% IF !loop.first() && loop.count() % max_table_size == 1 %]
[% PROCESS table_header %]
[% END %]
<tr>
<th valign="top">
<a href="editkeywords.cgi?action=edit&id=[% keyword.id %]">[% keyword.name FILTER html %]</a>
</th>
<td valign="top">
[% IF keyword.description %]
[% keyword.description FILTER html %]
[% ELSE %]
<font color="red">missing</font>
[% END %]
</td>
<td valign="top" align="right">
[% IF keyword.bug_count %]
[% keyword.bug_count %]
[% ELSE %]
none
[% END %]
</td>
<th valign="top">
<a href="editkeywords.cgi?action=delete&id=[% keyword.id %]">Delete</a>
</th>
</tr>
[% IF !loop.last() && loop.count() % max_table_size == 0 %]
[% PROCESS table_footer %]
[% END %]
[% END %]
[% columns = [
{
name => "name"
heading => "Edit keyword..."
contentlink => "editkeywords.cgi?action=edit&id=%id%"
},
{
name => "description"
heading => "Description"
},
{
name => "bug_count"
heading => "Bugs"
align => "right"
},
{
heading => "Action"
content => "Delete"
contentlink => "editkeywords.cgi?action=delete&id=%id%"
}
]
%]
<tr>
<td valign="top" colspan="3">Add a new keyword</td>
<td><a href="editkeywords.cgi?action=add">Add</a></td>
</tr>
[% PROCESS admin/table.html.tmpl
columns = columns
data = keywords
footer = footer_row
%]
[% PROCESS table_footer %]
<p><a href="editkeywords.cgi?action=add">Add a new keyword</a></p>
[% PROCESS global/footer.html.tmpl %]
template/en/default/admin/table.html.tmpl
0 → 100644
View file @
e06f5266
[%# 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): Jouni Heikniemi <jouni@heikniemi.net>
#
#%]
[%# INTERFACE:
#
# columns:
# array of hashes representing the columns in the table.
# Each hash contains data for a single column. Hash keys:
# name: Name of the field in the data param
# heading: The text to print at the header cell
# contentlink: URI to which the content of a data cell shall be linked to.
# Expressions of format %xxx% are replaced with value
# with the key xxx in data hash of the current row.
# content: If specified, the content of this variable is used
# instead of the data pulled from the current row.
# NOTE: This value is not HTML filtered at output!
# align: left/center/right. Controls the horizontal alignment of the
# text in the column.
#
# data:
# array of hashes representing the data for the table.
# Each hash contains data for a single row of data. The
# keys are column names from columns subhashes name field.
#
#%]
[%################### TABLE HEADER ######################%]
<table border="1" cellpadding="4" cellspacing="0">
<tr bgcolor="#6666FF">
[% FOREACH c = columns %]
[%# Default to align left for headers %]
<th align="[% (c.align || 'left') FILTER html %]">
[% c.heading FILTER html %]
</th>
[% END %]
</tr>
[%################### TABLE CONTENT ######################%]
[% FOREACH row = data %]
<tr>
[% FOREACH c = columns %]
<td [% IF c.align %] align="[% c.align FILTER html %]" [% END %]>
[% IF c.contentlink %]
[% link_uri = c.contentlink %]
[% FOREACH m = link_uri.match('%(.+?)%'); %]
[% replacement_value = FILTER url_quote; row.$m; END %]
[% link_uri = link_uri.replace("%$m%", replacement_value) %]
[% END %]
<a href="[% link_uri %]">
[% END %]
[% IF c.content %]
[% c.content %]
[% ELSE %]
[% row.${c.name} FILTER html %]
[% END %]
[% IF c.contentlink %]
</a>
[% END %]
</td>
[% END %]
</tr>
[% END %]
[%################### TABLE FOOTER ######################%]
</table>
template/en/default/filterexceptions.pl
View file @
e06f5266
...
...
@@ -479,6 +479,11 @@
'section_num'
],
'admin/table.html.tmpl'
=>
[
'link_uri'
,
'c.content'
],
'admin/products/groupcontrol/confirm-edit.html.tmpl'
=>
[
'group.count'
,
],
...
...
@@ -493,11 +498,6 @@
'const.CONTROLMAPMANDATORY'
,
],
'admin/keywords/list.html.tmpl'
=>
[
'keyword.id'
,
'keyword.bug_count'
,
],
'admin/keywords/edit.html.tmpl'
=>
[
'keyword_id'
,
'bug_count'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment