← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13610: Dashboard, impl missing full size view of report tables

 

------------------------------------------------------------
revno: 13610
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-01-07 12:57:08 +0100
message:
  Dashboard, impl missing full size view of report tables
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.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/dashboard.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm	2014-01-02 10:28:29 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm	2014-01-07 11:57:08 +0000
@@ -63,10 +63,12 @@
     <ul id="contentList" class="horizontalMenu"></ul>
 </div>
 
-<div id="chartView">
+<div id="chartView" class="page">
 	<img id="chartImage" src="" style="padding: 10px;"></img>
 </div>
 
+<div id="reportDialogView" class="page"></div>
+
 <div id="shareForm">
 	<textarea id="interpretationArea" class="interpretationArea" placeholder="$i18n.getString( 'write_your_interpretation' )"></textarea>
 	<input type="button" class="interpretationButton" value="$i18n.getString( 'share' )" onclick="dhis2.db.shareInterpretation()">

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js	2014-01-02 18:31:49 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js	2014-01-07 11:57:08 +0000
@@ -87,7 +87,7 @@
 		     
 	reportTableItem: "<li id='liDrop-${itemId}' class='liDropItem'><div class='dropItem' id='drop-${itemId}' data-item='${itemId}'></div></li>" +
                "<li id='li-${itemId}' class='liItem'><div class='item' id='${itemId}'><div class='itemHeader'><a href='javascript:dhis2.db.removeItem( \"${itemId}\" )'>${i18n_remove}</a>" +
-               "<a href='javascript:dhis2.db.viewImage( \"../api/reportTables/${id}/data.html\", \"${name}\" )'>${i18n_view}</a>" +
+               "<a href='javascript:dhis2.db.viewReportDialog( \"../api/reportTables/${id}/data.html\", \"${name}\" )'>${i18n_view}</a>" +
                "<a href='javascript:dhis2.db.viewShareForm( \"${id}\", \"reportTable\", \"${name}\" )'>${i18n_share}</a></div>" +
                "<div id='pivot-${itemId}' onclick='dhis2.db.exploreReportTable( \"${id}\" )' title='${i18n_click}'></div>" +
                "<script type='text/javascript'>dhis2.db.renderReportTable( '${id}', '${itemId}' );</script></div></li>",
@@ -598,7 +598,7 @@
 {
 	$.get( "../api/reportTables/" + tableId + "/data.html", function( data ) {
 		$( "#pivot-" + itemId ).html( data );
-	} );	
+	} );
 }
 
 //------------------------------------------------------------------------------
@@ -820,16 +820,17 @@
 }
 
 //------------------------------------------------------------------------------
-// Chart
+// Full size view
 //------------------------------------------------------------------------------
 
 dhis2.db.viewImage = function( url, name )
 {
-  var width = 820;
-  var height = 550;
-  var title = i18n_viewing + " " + name;
+  var width = 820,
+      height = 550,
+      title = i18n_viewing + " " + name;
 
   $( "#chartImage" ).attr( "src", url );
+  
   $( "#chartView" ).dialog( {
       autoOpen : true,
       modal : true,
@@ -839,3 +840,23 @@
       title : title
   } );
 }
+
+dhis2.db.viewReportDialog = function( url, name )
+{
+	var width = 820,
+		height = 550,
+		title = i18n_viewing + " " + name;
+
+	$.get( url, function( data ) {
+		$( "#reportDialogView" ).html( data );
+	} );
+	
+  $( "#reportDialogView" ).dialog( {
+      autoOpen : true,
+      modal : true,
+      height : height + 65,
+      width : width + 25,
+      resizable : false,
+      title : title
+  } );
+}