summaryrefslogtreecommitdiffstats
path: root/extensions/ProductDashboard
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/ProductDashboard')
-rw-r--r--extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl10
-rw-r--r--extensions/ProductDashboard/template/en/default/pages/productdashboard/components.html.tmpl68
-rw-r--r--extensions/ProductDashboard/template/en/default/pages/productdashboard/duplicates.html.tmpl38
-rw-r--r--extensions/ProductDashboard/template/en/default/pages/productdashboard/popularity.html.tmpl39
-rw-r--r--extensions/ProductDashboard/template/en/default/pages/productdashboard/recents.html.tmpl39
-rw-r--r--extensions/ProductDashboard/template/en/default/pages/productdashboard/roadmap.html.tmpl22
-rw-r--r--extensions/ProductDashboard/template/en/default/pages/productdashboard/summary.html.tmpl29
-rw-r--r--extensions/ProductDashboard/web/js/productdashboard.js12
8 files changed, 135 insertions, 122 deletions
diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
index 9f537636f..a8096e391 100644
--- a/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
+++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
@@ -11,21 +11,21 @@
[% filtered_product = product.name FILTER html %]
[% PROCESS global/header.html.tmpl
title = "Product Dashboard: $filtered_product"
- style_urls = [ "skins/standard/buglist.css",
- "js/yui/assets/skins/sam/paginator.css",
+ style_urls = [ "skins/standard/buglist.css",
+ "js/yui/assets/skins/sam/paginator.css",
"extensions/ProductDashboard/web/styles/productdashboard.css" ]
yui = [ "datatable", "paginator", "calendar" ]
- javascript_urls = [ "js/util.js", "js/field.js",
+ javascript_urls = [ "js/util.js", "js/field.js",
"extensions/ProductDashboard/web/js/productdashboard.js" ]
%]
<script type="text/javascript">
<!--
[%# Set up severities list for proper sorting %]
- var severities = new Array();
+ PD.severities = new Array();
[% sort_count = 0 %]
[% FOREACH s = severities %]
- severities['[% s FILTER js %]'] = [% sort_count FILTER js %];
+ PD.severities['[% s FILTER js %]'] = [% sort_count FILTER js %];
[% sort_count = sort_count + 1 %]
[% END %]
-->
diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard/components.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard/components.html.tmpl
index 7f5a05568..0f51f9de2 100644
--- a/extensions/ProductDashboard/template/en/default/pages/productdashboard/components.html.tmpl
+++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard/components.html.tmpl
@@ -16,30 +16,29 @@
<script type="text/javascript">
<!--
- var column_defs = [
- { key:"id", label:"ID", sortable:true, sortOptions:{ sortFunction:sortBugIdLinks } },
- { key:"bug_status", label:"Status", sortable:true },
- { key:"version", label:"Version", sortable:true },
- { key:"component", label:"Component", sortable:true },
- { key:"bug_severity", label:"Severity", sortable:true, sortOptions:{ sortFunction:sortBugSeverity } },
- { key:"Summary", label:"Summary", sortable:false },
+ PD.options = {
+ paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25, alwaysVisible: false })
+ };
+ PD.column_defs = [
+ { key:"id", label:"ID", sortable:true, sortOptions:{ sortFunction: PD.sortBugIdLinks } },
+ { key:"bug_status", label:"Status", sortable:true },
+ { key:"version", label:"Version", sortable:true },
+ { key:"component", label:"Component", sortable:true },
+ { key:"bug_severity", label:"Severity", sortable:true, sortOptions:{ sortFunction: PD.sortBugSeverity } },
+ { key:"Summary", label:"Summary", sortable:false },
];
- var fields = [
- { key:"id" },
- { key:"bug_status" },
- { key:"version" },
- { key:"component" },
- { key:"bug_severity" },
- { key:"Summary" }
+ PD.fields = [
+ { key:"id" },
+ { key:"bug_status" },
+ { key:"version" },
+ { key:"component" },
+ { key:"bug_severity" },
+ { key:"Summary" }
];
[% IF user.is_timetracker %]
- addStatListener("past_due", "past_due_table", column_defs, fields, {
- [% IF summary.past_due.size > 25 %] paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25 }) [% END %]
- });
+ PD.addStatListener("past_due", "past_due_table", PD.column_defs, PD.fields, PD.options);
[% END %]
- addStatListener("updated_recently", "updated_recently_table", column_defs, fields, {
- [% IF summary.updated_recently.size > 25 %] paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25 }) [% END %]
- });
+ PD.addStatListener("updated_recently", "updated_recently_table", PD.column_defs, PD.fields, PD.options);
-->
</script>
@@ -121,21 +120,24 @@
<script type="text/javascript">
<!--
- var column_defs = [
- { key:"name", label:"Name", sortable:true },
- { key:"count", label:"Count", sortable:true },
- { key:"percentage", label:"Percentage", sortable:false },
- { key:"bug_list", label:"[% terms.Bug %] List", sortable:false }
+ PD.options = {
+ paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25, alwaysVisible: false })
+ };
+ PD.column_defs = [
+ { key:"name", label:"Name", sortable:true },
+ { key:"count", label:"Count", sortable:true },
+ { key:"percentage", label:"Percentage", sortable:false },
+ { key:"bug_list", label:"[% terms.Bug %] List", sortable:false }
];
- var fields = [
- { key:"name" },
- { key:"count", parser:"number" },
- { key:"percentage" },
- { key:"bug_list" }
+ PD.fields = [
+ { key:"name" },
+ { key:"count", parser:"number" },
+ { key:"percentage" },
+ { key:"bug_list" }
];
- addStatListener("component_counts", "component_counts_table", column_defs, fields, {});
- addStatListener("version_counts", "version_counts_table", column_defs, fields, {});
- addStatListener("milestone_counts", "milestone_counts_table", column_defs, fields, {});
+ PD.addStatListener("component_counts", "component_counts_table", PD.column_defs, PD.fields, PD.options);
+ PD.addStatListener("version_counts", "version_counts_table", PD.column_defs, PD.fields, PD.options);
+ PD.addStatListener("milestone_counts", "milestone_counts_table", PD.column_defs, PD.fields, PD.options);
-->
</script>
diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard/duplicates.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard/duplicates.html.tmpl
index 36a820300..fc3403bc4 100644
--- a/extensions/ProductDashboard/template/en/default/pages/productdashboard/duplicates.html.tmpl
+++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard/duplicates.html.tmpl
@@ -12,26 +12,28 @@
<script type="text/javascript">
<!--
-var column_defs = [
- { key:"id", label:"ID", sortable:true, sortOptions:{ sortFunction:sortBugIdLinks } },
- { key:"count", label:"Count", sortable:true },
- { key:"bug_status", label:"Status", sortable:true },
- { key:"version", label:"Version", sortable:true },
- { key:"component", label:"Component", sortable:true },
- { key:"bug_severity", label:"Severity", sortable:true, sortOptions:{ sortFunction:sortBugSeverity } },
- { key:"Summary", label:"Summary", sortable:false },
+PD.options = {
+ paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25, alwaysVisible: false })
+};
+PD.column_defs = [
+ { key:"id", label:"ID", sortable:true, sortOptions:{ sortFunction: PD.sortBugIdLinks } },
+ { key:"count", label:"Count", sortable:true },
+ { key:"bug_status", label:"Status", sortable:true },
+ { key:"version", label:"Version", sortable:true },
+ { key:"component", label:"Component", sortable:true },
+ { key:"bug_severity", label:"Severity", sortable:true, sortOptions:{ sortFunction: PD.sortBugSeverity } },
+ { key:"Summary", label:"Summary", sortable:false },
];
-var fields = [
- { key:"id" },
- { key:"count", parser:"number" },
- { key:"bug_status" },
- { key:"version" },
- { key:"component" },
- { key:"bug_severity" },
- { key:"Summary" }
+PD.fields = [
+ { key:"id" },
+ { key:"count", parser:"number" },
+ { key:"bug_status" },
+ { key:"version" },
+ { key:"component" },
+ { key:"bug_severity" },
+ { key:"Summary" }
];
-addStatListener("duplicate_counts", "duplicate_counts_table", column_defs, fields, {
- [% IF by_duplicate.size > 25 %] paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25 }) [% END %]
+PD.addStatListener("duplicate_counts", "duplicate_counts_table", PD.column_defs, PD.fields, PD.options);
});
-->
</script>
diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard/popularity.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard/popularity.html.tmpl
index 9c7c42563..b6b159155 100644
--- a/extensions/ProductDashboard/template/en/default/pages/productdashboard/popularity.html.tmpl
+++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard/popularity.html.tmpl
@@ -12,27 +12,28 @@
<script type="text/javascript">
<!--
-var column_defs = [
- { key:"id", label:"ID", sortable:true, sortOptions:{ sortFunction:sortBugIdLinks } },
- { key:"count", label:"Count", sortable:true },
- { key:"bug_status", label:"Status", sortable:true },
- { key:"version", label:"Version", sortable:true },
- { key:"component", label:"Component", sortable:true },
- { key:"bug_severity", label:"Severity", sortable:true, sortOptions:{ sortFunction:sortBugSeverity } },
- { key:"Summary", label:"Summary", sortable:false },
+PD.options = {
+ paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25, alwaysVisible: false })
+};
+PD.column_defs = [
+ { key:"id", label:"ID", sortable:true, sortOptions:{ sortFunction: PD.sortBugIdLinks } },
+ { key:"count", label:"Count", sortable:true },
+ { key:"bug_status", label:"Status", sortable:true },
+ { key:"version", label:"Version", sortable:true },
+ { key:"component", label:"Component", sortable:true },
+ { key:"bug_severity", label:"Severity", sortable:true, sortOptions:{ sortFunction: PD.sortBugSeverity } },
+ { key:"Summary", label:"Summary", sortable:false },
];
-var fields = [
- { key:"id" },
- { key:"count", parser:"number" },
- { key:"bug_status" },
- { key:"version" },
- { key:"component" },
- { key:"bug_severity" },
- { key:"Summary" }
+PD.fields = [
+ { key:"id" },
+ { key:"count", parser:"number" },
+ { key:"bug_status" },
+ { key:"version" },
+ { key:"component" },
+ { key:"bug_severity" },
+ { key:"Summary" }
];
-addStatListener("popularity_counts", "popularity_counts_table", column_defs, fields, {
- [% IF by_popularity.size > 25 %] paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25 }) [% END %]
-});
+PD.addStatListener("popularity_counts", "popularity_counts_table", PD.column_defs, PD.fields, PD.options);
-->
</script>
diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard/recents.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard/recents.html.tmpl
index 4350e7472..470adef74 100644
--- a/extensions/ProductDashboard/template/en/default/pages/productdashboard/recents.html.tmpl
+++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard/recents.html.tmpl
@@ -12,28 +12,27 @@
<script type="text/javascript">
<!--
-var column_defs = [
- { key:"id", label:"ID", sortable:true, sortOptions:{ sortFunction:sortBugIdLinks } },
- { key:"bug_status", label:"Status", sortable:true },
- { key:"version", label:"Version", sortable:true },
- { key:"component", label:"Component", sortable:true },
- { key:"bug_severity", label:"Severity", sortable:true, sortOptions:{ sortFunction:sortBugSeverity } },
- { key:"Summary", label:"Summary", sortable:false },
+PD.options = {
+ paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25, alwaysVisible: false })
+};
+PD.column_defs = [
+ { key:"id", label:"ID", sortable:true, sortOptions:{ sortFunction: PD.sortBugIdLinks } },
+ { key:"bug_status", label:"Status", sortable:true },
+ { key:"version", label:"Version", sortable:true },
+ { key:"component", label:"Component", sortable:true },
+ { key:"bug_severity", label:"Severity", sortable:true, sortOptions:{ sortFunction: PD.sortBugSeverity } },
+ { key:"Summary", label:"Summary", sortable:false },
];
-var fields = [
- { key:"id" },
- { key:"bug_status" },
- { key:"version" },
- { key:"component" },
- { key:"bug_severity" },
- { key:"Summary" }
+PD.fields = [
+ { key:"id" },
+ { key:"bug_status" },
+ { key:"version" },
+ { key:"component" },
+ { key:"bug_severity" },
+ { key:"Summary" }
];
-addStatListener("recently_opened", "recently_opened_table", column_defs, fields, {
- [% IF recently_opened.size > 25 %] paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25 }) [% END %]
-});
-addStatListener("recently_closed", "recently_closed_table", column_defs, fields, {
- [% IF recently_closed.size > 25 %] paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25 }) [% END %]
-});
+PD.addStatListener("recently_opened", "recently_opened_table", PD.column_defs, PD.fields, PD.options);
+PD.addStatListener("recently_closed", "recently_closed_table", PD.column_defs, PD.fields, PD.options);
-->
</script>
diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard/roadmap.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard/roadmap.html.tmpl
index fad1cafa5..26edb03af 100644
--- a/extensions/ProductDashboard/template/en/default/pages/productdashboard/roadmap.html.tmpl
+++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard/roadmap.html.tmpl
@@ -8,18 +8,20 @@
<script type="text/javascript">
<!--
-var column_defs = [
- { key:"milestone", label:"Milestone", sortable:true },
- { key:"percentage complete", label:"Percentage Complete", sortable:false },
- { key:"links", label:"Links", sortable:false },
+PD.options = {
+ paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25, alwaysVisible: false })
+};
+PD.column_defs = [
+ { key:"milestone", label:"Milestone", sortable:true },
+ { key:"percentage complete", label:"Percentage Complete", sortable:false },
+ { key:"links", label:"Links", sortable:false },
];
-var fields = [
- { key:"milestone" },
- { key:"percentage complete" },
- { key:"links" }
+PD.fields = [
+ { key:"milestone" },
+ { key:"percentage complete" },
+ { key:"links" }
];
-
-addStatListener("bug_milestones", "bug_milestones_table", column_defs, fields, {});
+PD.addStatListener("bug_milestones", "bug_milestones_table", PD.column_defs, PD.fields, PD.options);
-->
</script>
diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard/summary.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard/summary.html.tmpl
index c1b0a8854..6d85b0175 100644
--- a/extensions/ProductDashboard/template/en/default/pages/productdashboard/summary.html.tmpl
+++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard/summary.html.tmpl
@@ -8,21 +8,24 @@
<script type="text/javascript">
<!--
-var column_defs = [
- { key:"name", label:"Name", sortable:true },
- { key:"count", label:"Count", sortable:true },
- { key:"percentage", label:"Percentage", sortable:false }
+PD.options = {
+ paginator: new YAHOO.widget.Paginator({ rowsPerPage: 25, alwaysVisible: false })
+};
+PD.column_defs = [
+ { key:"name", label:"Name", sortable:true },
+ { key:"count", label:"Count", sortable:true },
+ { key:"percentage", label:"Percentage", sortable:false }
];
-var fields = [
- { key:"name" },
- { key:"count", parser:"number" },
- { key:"percentage" }
+PD.fields = [
+ { key:"name" },
+ { key:"count", parser:"number" },
+ { key:"percentage" }
];
-addStatListener("bug_counts", "bug_counts_table", column_defs, fields, {});
-addStatListener("status_counts", "status_counts_table", column_defs, fields, {});
-addStatListener("priority_counts", "priority_counts_table", column_defs, fields, {});
-addStatListener("severity_counts", "severity_counts_table", column_defs, fields, {});
-addStatListener("assignee_counts", "assignee_counts_table", column_defs, fields, {});
+PD.addStatListener("bug_counts", "bug_counts_table", PD.column_defs, PD.fields, PD.options);
+PD.addStatListener("status_counts", "status_counts_table", PD.column_defs, PD.fields, PD.options);
+PD.addStatListener("priority_counts", "priority_counts_table", PD.column_defs, PD.fields, PD.options);
+PD.addStatListener("severity_counts", "severity_counts_table", PD.column_defs, PD.fields, PD.options);
+PD.addStatListener("assignee_counts", "assignee_counts_table", PD.column_defs, PD.fields, PD.options);
-->
</script>
diff --git a/extensions/ProductDashboard/web/js/productdashboard.js b/extensions/ProductDashboard/web/js/productdashboard.js
index e7276b7b2..56bc451ff 100644
--- a/extensions/ProductDashboard/web/js/productdashboard.js
+++ b/extensions/ProductDashboard/web/js/productdashboard.js
@@ -6,7 +6,11 @@
* defined by the Mozilla Public License, v. 2.0.
*/
-function addStatListener (div_name, table_name, column_defs, fields, options) {
+YAHOO.namespace('ProductDashboard');
+
+var PD = YAHOO.ProductDashboard;
+
+PD.addStatListener = function (div_name, table_name, column_defs, fields, options) {
YAHOO.util.Event.addListener(window, "load", function() {
YAHOO.example.StatsFromMarkup = new function() {
this.myDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get(table_name));
@@ -20,7 +24,7 @@ function addStatListener (div_name, table_name, column_defs, fields, options) {
}
// Custom sort handler to sort by bug id inside an anchor tag
-var sortBugIdLinks = function(a, b, desc) {
+PD.sortBugIdLinks = function (a, b, desc) {
// Deal with empty values
if (!YAHOO.lang.isValue(a)) {
return (!YAHOO.lang.isValue(b)) ? 0 : 1;
@@ -52,7 +56,7 @@ var sortBugIdLinks = function(a, b, desc) {
}
// Custom sort handler for bug severities
-var sortBugSeverity = function(a, b, desc) {
+PD.sortBugSeverity = function (a, b, desc) {
// Deal with empty values
if (!YAHOO.lang.isValue(a)) {
return (!YAHOO.lang.isValue(b)) ? 0 : 1;
@@ -73,7 +77,7 @@ var sortBugSeverity = function(a, b, desc) {
}
// Custom sort handler for bug priorities
-var sortBugPriority = function(a, b, desc) {
+PD.sortBugPriority = function (a, b, desc) {
// Deal with empty values
if (!YAHOO.lang.isValue(a)) {
return (!YAHOO.lang.isValue(b)) ? 0 : 1;