← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8552: Small change ui for Comments and message tab in dashboard.

 

------------------------------------------------------------
revno: 8552
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-10-17 16:19:19 +0700
message:
  Small change ui for Comments and message tab in dashboard.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm


--
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-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm	2012-10-04 15:05:38 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm	2012-10-17 09:19:19 +0000
@@ -1,71 +1,48 @@
 #set($programStageInstances = $programInstance.programStageInstances)
 <table class="mainPageTable">
-	<col width="160px"/>
-	<col/>
-	<tr>
-		<th>$i18n.getString( "date" )</th>
-		<th>$i18n.getString( "program_stage" )</th>
-		<th>$i18n.getString( "sender" )</th>
-		<th>$i18n.getString( "message" )</th>
-	</tr>
-	
+	<colgroup>
+		<col width="160px"/>
+		<col width="160px"/>
+		<col width="100px"/>
+		<col/>
+	</colgroup>
+	<thead>
+		<tr>
+			<th>$i18n.getString( "date" )</th>
+			<th>$i18n.getString( "program_stage" )</th>
+			<th>$i18n.getString( "sender" )</th>
+			<th>$i18n.getString( "message" )</th>
+		</tr>
+	</thead>
 	<tbody id='commentTB'>
-		#set($index = 0)
-		#set($count = 0)
-		#foreach($programStageInstance in $programStageInstances)
-			#foreach( $comment in $programStageInstance.patientComments )
-				#if( $index < 5 )
-					<tr id="comment_$comment.id">
-						<td>$format.formatDateTime($comment.createdDate)</td>
-						<td>$programStageInstance.programStage.name</td>
-						<td>$comment.creator</td>
-						<td>$comment.commentText</td>
-						#set($index = $index + 1)
-					</tr>
-				#end
-				#set($count = $count + 1)
-			#end
-		#end
-		#foreach($programStageInstance in $programStageInstances)
-			#foreach( $sms in $programStageInstance.outboundSms )
-				#if( $index < 5 )
-					<tr id="tr${sms.id}">
-						<td>$format.formatDateTime($!sms.date)</td>
-						<td>$programStageInstance.programStage.name</td>
-						<td>$sms.sender</td>
-						<td>$sms.message</td>
-					</tr>
-				#end
-			#end
-		#end
-		#foreach($programStageInstance in $programStageInstances)
-			#foreach( $comment in $programStageInstance.patientComments )
-				#if( $index >= 5 )
-					<tr id="comment_$comment.id" class="hidden">
-						<td>$format.formatDateTime($comment.createdDate)</td>
-						<td>$programStageInstance.programStage.name</td>
-						<td>$comment.creator</td>
-						<td>$comment.commentText</td>
-					</tr>
-				#end
-				#set($count = $count + 1)
-			#end
-		#end	
-		
-		#foreach($programStageInstance in $programStageInstances)
-			#foreach( $sms in $programStageInstance.outboundSms )
-				#if( $index >= 5 )
-					<tr id="tr${sms.id}"  class='hidden'>
-						<td>$format.formatDateTime($!sms.date)</td>
-						<td>$programStageInstance.programStage.name</td>
-						<td>$sms.sender</td>
-						<td>$sms.message</td>
-					</tr>
-				#end
+		#set( $mark = false )
+		#foreach($programStageInstance in $programStageInstances)
+			#foreach( $comment in $programStageInstance.patientComments )
+				<tr id="comment_$comment.id" #alternate( $mark )>
+					<td>$format.formatDateTime($comment.createdDate)</td>
+					<td>$programStageInstance.programStage.name</td>
+					<td>$comment.creator</td>
+					<td>$comment.commentText</td>
+				</tr>
+				#set( $mark = !$mark )
+			#end
+		#end
+		#foreach($programStageInstance in $programStageInstances)
+			#foreach( $sms in $programStageInstance.outboundSms )
+				<tr id="tr${sms.id}" #alternate( $mark )>
+					<td>$format.formatDateTime($!sms.date)</td>
+					<td>$programStageInstance.programStage.name</td>
+					<td>$sms.sender</td>
+					<td>$sms.message</td>
+				</tr>
+				#set( $mark = !$mark )
 			#end
 		#end
 	</tbody>
 </table>
 <br>
-<input type='button' id="showCommentBtn" name="showCommentBtn" value='$i18n.getString("show_hide_more")' #if($count && $count<=5) class='hidden' #end onclick='commentDivToggle(false);'>
-<input type='button' id="hideCommentBtn" name="hideCommentBtn" value='$i18n.getString("show_hide_more")' class='hidden' onclick='commentDivToggle(true);'>
\ No newline at end of file
+<input type='button' id="showCommentBtn" name="showCommentBtn" value='$i18n.getString("show_hide_more")' onclick='commentDivToggle(false);'>
+<input type='button' id="hideCommentBtn" name="hideCommentBtn" value='$i18n.getString("show_hide_more")' onclick='commentDivToggle(true);'>
+<script>
+	commentDivToggle(true);
+</script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-10-17 07:23:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-10-17 09:19:19 +0000
@@ -1701,9 +1701,8 @@
 
 function commentDivToggle(isHide)
 {
-	var index = 1;
 	jQuery("#commentTB tr").removeClass("hidden");
-	jQuery("#commentTB tr").each( function(){
+	jQuery("#commentTB tr").each( function(index, item){
 		if(isHide && index > 5){
 			jQuery(this).addClass("hidden");
 		}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm	2012-10-17 07:46:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm	2012-10-17 09:19:19 +0000
@@ -26,13 +26,13 @@
 		
 		#if( $programStageInstance )
 			<tr>
-				<th><label for="executionDate">$programStageInstance.programStage.reportDateDescription &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label></th>
+				<th><label for="executionDate">$programStageInstance.programStage.reportDateDescription &nbsp;&nbsp;&nbsp;</label></th>
 				<th><input type="text" id="executionDate" name="executionDate" value="$!format.formatDate( $programStageInstance.executionDate )" onchange="saveExecutionDate( $programStageInstance.id, $programStageInstance.id, byId('executionDate') )" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
 					<script type="text/javascript">
 					   datePickerValid( 'executionDate', false );
 					</script>  
-				<th><label for="dueDate"> $i18n.getString( "due_date" ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label></th>
-				<th><input type="text" id="dueDate" name="dueDate" value="$!format.formatDate( $programStageInstance.dueDate )" disabled="disabled">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+				<th><label for="dueDate"> $i18n.getString( "due_date" ) &nbsp;&nbsp;&nbsp;</label></th>
+				<th><input type="text" id="dueDate" name="dueDate" value="$!format.formatDate( $programStageInstance.dueDate )" disabled="disabled">&nbsp;&nbsp;&nbsp;</th>
 			</tr>
 		#end
 	</table>