From fe4460ca51a5e4f94b700ab959065feedac3012a Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Thu, 28 Feb 2013 18:31:52 -0500 Subject: MyDashboard improvements --- extensions/MyDashboard/web/js/flags.js | 23 +++++++++++++++++------ extensions/MyDashboard/web/js/query.js | 24 +++++++++++++++--------- 2 files changed, 32 insertions(+), 15 deletions(-) (limited to 'extensions/MyDashboard/web/js') diff --git a/extensions/MyDashboard/web/js/flags.js b/extensions/MyDashboard/web/js/flags.js index e212466e8..6820ec289 100644 --- a/extensions/MyDashboard/web/js/flags.js +++ b/extensions/MyDashboard/web/js/flags.js @@ -71,14 +71,21 @@ YUI({ Y.Escape.html(o.data.bug_summary) + '">' + o.value + ''; }; + var createdFormatter = function (o) { + return '' + + Y.Escape.html(o.data.created_fancy) + ''; + }; + // Requestee dataSource.requestee = new Y.DataSource.IO({ source: 'jsonrpc.cgi' }); dataTable.requestee = new Y.DataTable({ columns: [ { key: "requester", label: "Requester", sortable: true }, { key: "type", label: "Flag", sortable: true }, - { key: "bug_id", label: "Bug", sortable: true, formatter: bugLinkFormatter, allowHTML: true }, - { key: "created", label: "Created", sortable: true } + { key: "bug_id", label: "Bug", sortable: true, + formatter: bugLinkFormatter, allowHTML: true }, + { key: "created", label: "Created", sortable: true, + formatter: createdFormatter, allowHTML: true } ], strings: { emptyMessage: 'No flag data found.', @@ -95,7 +102,8 @@ YUI({ dataSource.requestee.plug(Y.Plugin.DataSourceJSONSchema, { schema: { resultListLocator: "result.result.requestee", - resultFields: ["requester", "type", "bug_id", "bug_status", "bug_summary", "created"] + resultFields: ["requester", "type", "bug_id", "bug_status", + "bug_summary", "created", "created_fancy"] } }); @@ -111,8 +119,10 @@ YUI({ columns: [ { key:"requestee", label:"Requestee", sortable:true }, { key:"type", label:"Flag", sortable:true }, - { key:"bug_id", label:"Bug", sortable:true, formatter: bugLinkFormatter, allowHTML: true }, - { key:"created", label:"Created", sortable:true } + { key:"bug_id", label:"Bug", sortable:true, + formatter: bugLinkFormatter, allowHTML: true }, + { key: "created", label: "Created", sortable: true, + formatter: createdFormatter, allowHTML: true } ], strings: { emptyMessage: 'No flag data found.', @@ -129,7 +139,8 @@ YUI({ dataSource.requester.plug(Y.Plugin.DataSourceJSONSchema, { schema: { resultListLocator: "result.result.requester", - resultFields: ["requestee", "type", "bug_id", "bug_status", "bug_summary", "created"] + resultFields: ["requestee", "type", "bug_id", "bug_status", + "bug_summary", "created", "created_fancy"] } }); diff --git a/extensions/MyDashboard/web/js/query.js b/extensions/MyDashboard/web/js/query.js index 865d255a6..2ce438509 100644 --- a/extensions/MyDashboard/web/js/query.js +++ b/extensions/MyDashboard/web/js/query.js @@ -19,7 +19,7 @@ YUI({ } }).use("node", "datatable", "datatable-sort", "datatable-message", "json-stringify", "datatable-datasource", "datasource-io", "datasource-jsonschema", "cookie", - "gallery-datatable-row-expansion-bmo", "handlebars", function (Y) { + "gallery-datatable-row-expansion-bmo", "handlebars", "escape", function (Y) { var counter = 0, dataSource = null, dataTable = null, @@ -86,13 +86,18 @@ YUI({ }); }; + var updatedFormatter = function (o) { + return '' + + Y.Escape.html(o.data.changeddate_fancy) + ''; + }; + dataSource = new Y.DataSource.IO({ source: 'jsonrpc.cgi' }); dataSource.plug(Y.Plugin.DataSourceJSONSchema, { schema: { resultListLocator: "result.result.bugs", - resultFields: ["bug_id", "changeddate", "bug_status", - "short_desc", "last_changes"], + resultFields: ["bug_id", "changeddate", "changeddate_fancy", + "bug_status", "short_desc", "last_changes"], metaFields: { description: "result.result.description", heading: "result.result.heading", @@ -103,13 +108,14 @@ YUI({ dataTable = new Y.DataTable({ columns: [ - { key: Y.Plugin.DataTableRowExpansion.column_key, label: ' ' }, - { key: "bug_id", label: "Bug", sortable: true, - formatter: '{value}', allowHTML: true }, - { key: "changeddate", label: "Updated", sortable: true }, - { key: "bug_status", label: "Status", sortable: true }, - { key: "short_desc", label: "Summary", sortable: true }, + { key: Y.Plugin.DataTableRowExpansion.column_key, label: ' ', sortable: false }, + { key: "bug_id", label: "Bug", allowHTML: true, + formatter: '{value}' }, + { key: "changeddate", label: "Updated", formatter: updatedFormatter, allowHTML: true }, + { key: "bug_status", label: "Status" }, + { key: "short_desc", label: "Summary" }, ], + sortable: true }); var last_changes_source = Y.one('#last-changes-template').getHTML(), -- cgit v1.2.3-24-g4f1b