← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18052: Dashboard, table title.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 18052 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-01-19 17:08:28 +0100
message:
  Dashboard, table title.
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js	2015-01-19 09:30:22 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js	2015-01-19 16:07:50 +0000
@@ -3647,7 +3647,10 @@
 						table,
 						getSXLayout,
 						getXResponse,
-                        getReport;
+                        getReport,
+                        getTitleHtml = function(title) {
+                            return ns.dashboard && title ? '<div style="height: 19px; line-height: 14px; width: 100%; font: bold 12px LiberationSans; color: #333; text-align: center; letter-spacing: -0.1px">' + title + '</div>' : '';
+                        };
 
                     getReport = function() {
                         var getHtml = function(xLayout, xResponse) {
@@ -3675,7 +3678,7 @@
                         }
 
                         //ns.app.centerRegion.removeAll(true);
-                        ns.app.centerRegion.update(table.html);
+                        ns.app.centerRegion.update(getTitleHtml(layout.name) + table.html);
 
                         // fade
                         if (!ns.skipFade) {
@@ -3736,7 +3739,10 @@
 
 				map['individual_cases'] = function() {
 					var xResponse,
-                        getReport;
+                        getReport,
+                        getTitleHtml = function(title) {
+                            return ns.dashboard && title ? '<div style="height: 19px; line-height: 14px; width: 100%; font: bold 12px LiberationSans; color: #333; text-align: center; letter-spacing: -0.1px">' + title + '</div>' : '';
+                        };
 
                     getReport = function() {
                         table = web.report.query.getHtml(layout, xResponse);
@@ -3749,7 +3755,7 @@
                         if (ns.app.centerRegion.removeAll) {
                             ns.app.centerRegion.removeAll(true);
                         }
-                        ns.app.centerRegion.update(table.html);
+                        ns.app.centerRegion.update(getTitleHtml(layout.name) + table.html);
 
                         Ext.defer( function() {
                             Ext.get(ns.core.init.el).fadeIn({

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js	2015-01-19 14:21:47 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js	2015-01-19 14:29:05 +0000
@@ -6975,7 +6975,7 @@
                     region: 'north',
                     width: el.getWidth(),
                     height: 19,
-                    bodyStyle: 'background-color: #fff; border: 0 none; font: bold 12px LiberationSans, arial, sans-serif; color: #333; text-align: center; line-height: 14px; letter-spacing: -0.3px',
+                    bodyStyle: 'background-color: #fff; border: 0 none; font: bold 12px LiberationSans, arial, sans-serif; color: #333; text-align: center; line-height: 14px; letter-spacing: -0.1px',
                     html: ''
                 }));
             }

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js	2015-01-15 22:09:04 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js	2015-01-19 16:07:50 +0000
@@ -579,7 +579,7 @@
 						console.log('Response: no valid headers');
 						return;
 					}
-                    
+
 					if (!(Ext.isArray(config.rows) && config.rows.length > 0)) {
                         init.alert('No values found');
 						return;
@@ -3285,7 +3285,10 @@
 					getXLayout = service.layout.getExtendedLayout,
 					getSXLayout = service.layout.getSyncronizedXLayout,
 					getXResponse = service.response.getExtendedResponse,
-					getXAxis = service.layout.getExtendedAxis;
+					getXAxis = service.layout.getExtendedAxis,
+                    getTitleHtml = function(title) {
+                        return ns.dashboard && title ? '<div style="height: 19px; line-height: 14px; width: 100%; font: bold 12px LiberationSans; color: #333; text-align: center">' + title + '</div>' : '';
+                    };
 
 				getHtml = function(xLayout, xResponse) {
 					xColAxis = getXAxis(xLayout, 'col');
@@ -3317,7 +3320,7 @@
                 ns.app.dateRender = new Date();
 
 				//ns.app.centerRegion.removeAll(true);
-				ns.app.centerRegion.update(table.html);
+				ns.app.centerRegion.update(getTitleHtml(layout.name) + table.html);
 
                 // fade
                 if (!ns.skipFade) {