------------------------------------------------------------
revno: 8307
committer: Lars Helge Ă˜verland <larshe...@gmail.com>
branch nick: dhis2
timestamp: Sun 2012-09-30 19:45:22 +0200
message:
  Async loading of interpretations
added:
  
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml
  
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretation.vm
  
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.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/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml	2012-09-25 13:56:20 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml	2012-09-30 17:45:22 +0000
@@ -125,7 +125,7 @@
 
     <!-- Interpretation -->
 	
-	<action name="interpretation" class="org.hisp.dhis.dashboard.interpretation.action.GetInterpretationsAction">
+	<action name="interpretation" class="org.hisp.dhis.dashboard.action.NoAction">
 	  <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-dashboard-integration/interpretation.vm</param>
       <param name="menu">/dhis-web-dashboard-integration/menu.vm</param>
@@ -133,5 +133,9 @@
 	  <param name="stylesheets">style/dashboard.css</param>
     </action>
 
+    <action name="getInterpretations" class="org.hisp.dhis.dashboard.interpretation.action.GetInterpretationsAction">
+      <result name="success" type="velocity">/dhis-web-dashboard-integration/interpretationFeed.vm</result>
+    </action>
+
   </package>
 </struts>

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretation.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretation.vm	2012-09-05 07:20:37 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretation.vm	2012-09-30 17:45:22 +0000
@@ -7,61 +7,6 @@
 </div>
 
 <div id="interpretationFeed">
-#foreach( $ip in $interpretations )
-<div class="interpretation">
-
-	<div class="interpretationName">
-		<span class="bold" style="cursor:pointer" onclick="showUserInfo( '${ip.user.id}' )">${ip.user.name}</span>&nbsp;
-		<span class="grey">${format.formatDate( $ip.created )}</span>
-	</div>
-	<div class="interpretationText">
-		${ip.text}
-	</div>
-	<div class="interpretationChart">
-	#if( $ip.chartInterpretation )	
-		<img style="cursor:pointer" 
-		     src="../api/charts/${ip.chart.uid}/data?date=${format.formatDate( $ip.created )}&width=530&height=300" 
-		     onclick="javascript:window.location.href='../dhis-web-visualizer/app/index.html?id=${ip.chart.uid}&date=${format.formatDate( $ip.created )}'"
-		     title="$i18n.getString( 'click_to_view_in_data_visualizer' )">
-	#elseif( $ip.mapViewInterpretation )
-		<a class="bold" 
-		   title="$i18n.getString( 'click_to_view_in_gis' )" 
-		   href="../dhis-web-mapping/mapping/index.html?id=${ip.mapView.uid}">$encoder.htmlEncode( $ip.mapView.name )</a>
-	#elseif( $ip.reportTableInterpretation )
-		#if( $ip.organisationUnit )#set( $ou = "&ou=" + $ip.organisationUnit.uid )#else#set( $ou = "" )#end
-		<a class="bold" 
-		   title="$i18n.getString( 'click_to_view_report_table' )" 
-		   href="../dhis-web-reporting/exportTable.action?uid=${ip.reportTable.uid}&pe=${format.formatDate( $ip.created )}${ou}">
-		   	$encoder.htmlEncode( $ip.reportTable.name )</a>
-	#elseif( $ip.dataSetReportInterpretation )
-	    <a class="bold"
-		   title="$i18n.getString( 'click_to_view_data_set_report' )"
-		   href="../dhis-web-reporting/showDataSetReportForm.action?ds=${ip.dataSet.uid}&pe=${ip.period.isoDate}&ou=${ip.organisationUnit.uid}">
-		   $encoder.htmlEncode( $ip.dataSet.name )</a>
-	#end
-	</div>
-	
-	#set( $comments = $ip.comments )
-	<div class="interpretationCommentArea">
-		<div id="comments${ip.uid}">
-		#foreach( $comment in $comments )
-		<div>
-			<div class="interpretationName">
-				<span class="bold pointer" onclick="showUserInfo( '${comment.user.id}' )">${comment.user.name}</span>&nbsp;
-				<span class="grey">${format.formatDate( $comment.created )}</span>
-			</div>
-		</div>
-		<div class="interpretationText">
-			${comment.text}
-		</div>
-		#end
-		</div>
-		<textarea id="commentArea${ip.uid}" class="commentArea" placeholder="$i18n.getString( 'add_a_comment' )..."></textarea>
-		<input type="button" class="commentButton" value="Post comment" onclick="postComment( '${ip.uid}' )">
-	</div>
-	
-</div>
-#end
 </div>
 
 <div id="userInfo" class="page" style="display:none"></div>

=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm	2012-09-30 17:45:22 +0000
@@ -0,0 +1,55 @@
+#foreach( $ip in $interpretations )
+<div class="interpretation">
+
+    <div class="interpretationName">
+        <span class="bold" style="cursor:pointer" onclick="showUserInfo( '${ip.user.id}' )">${ip.user.name}</span>&nbsp;
+        <span class="grey">${format.formatDate( $ip.created )}</span>
+    </div>
+    <div class="interpretationText">
+        ${ip.text}
+    </div>
+    <div class="interpretationChart">
+    #if( $ip.chartInterpretation )  
+        <img style="cursor:pointer" 
+             src="../api/charts/${ip.chart.uid}/data?date=${format.formatDate( $ip.created )}&width=530&height=300" 
+             onclick="javascript:window.location.href='../dhis-web-visualizer/app/index.html?id=${ip.chart.uid}&date=${format.formatDate( $ip.created )}'"
+             title="$i18n.getString( 'click_to_view_in_data_visualizer' )">
+    #elseif( $ip.mapViewInterpretation )
+        <a class="bold" 
+           title="$i18n.getString( 'click_to_view_in_gis' )" 
+           href="../dhis-web-mapping/mapping/index.html?id=${ip.mapView.uid}">$encoder.htmlEncode( $ip.mapView.name )</a>
+    #elseif( $ip.reportTableInterpretation )
+        #if( $ip.organisationUnit )#set( $ou = "&ou=" + $ip.organisationUnit.uid )#else#set( $ou = "" )#end
+        <a class="bold" 
+           title="$i18n.getString( 'click_to_view_report_table' )" 
+           href="../dhis-web-reporting/exportTable.action?uid=${ip.reportTable.uid}&pe=${format.formatDate( $ip.created )}${ou}">
+            $encoder.htmlEncode( $ip.reportTable.name )</a>
+    #elseif( $ip.dataSetReportInterpretation )
+        <a class="bold"
+           title="$i18n.getString( 'click_to_view_data_set_report' )"
+           href="../dhis-web-reporting/showDataSetReportForm.action?ds=${ip.dataSet.uid}&pe=${ip.period.isoDate}&ou=${ip.organisationUnit.uid}">
+           $encoder.htmlEncode( $ip.dataSet.name )</a>
+    #end
+    </div>
+    
+    #set( $comments = $ip.comments )
+    <div class="interpretationCommentArea">
+        <div id="comments${ip.uid}">
+        #foreach( $comment in $comments )
+        <div>
+            <div class="interpretationName">
+                <span class="bold pointer" onclick="showUserInfo( '${comment.user.id}' )">${comment.user.name}</span>&nbsp;
+                <span class="grey">${format.formatDate( $comment.created )}</span>
+            </div>
+        </div>
+        <div class="interpretationText">
+            ${comment.text}
+        </div>
+        #end
+        </div>
+        <textarea id="commentArea${ip.uid}" class="commentArea" placeholder="$i18n.getString( 'add_a_comment' )..."></textarea>
+        <input type="button" class="commentButton" value="Post comment" onclick="postComment( '${ip.uid}' )">
+    </div>
+    
+</div>
+#end
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.js	2012-09-20 12:00:28 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.js	2012-09-30 17:45:22 +0000
@@ -1,6 +1,7 @@
 
 $( document ).ready( function() {
-	$( '.commentArea' ).autogrow();
+	$( ".commentArea" ).autogrow();
+	$( "#interpretationFeed" ).load( "getInterpretations.action" );
 } );
 
 function showUserInfo( id )

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to