← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2076: Made html in dataentry forms more compact

 

------------------------------------------------------------
revno: 2076
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2010-11-16 16:09:55 +0100
message:
  Made html in dataentry forms more compact
removed:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/order.vm
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.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-dataentry/src/main/webapp/dhis-web-dataentry/form.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm	2010-11-12 07:55:55 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm	2010-11-16 15:09:55 +0000
@@ -7,171 +7,154 @@
 
 #parse( "/dhis-web-dataentry/select.vm" )
 
-
-#if ( $disableDefaultForm )
-    
-    #if ( $customDataEntryFormExists )  
-        
-        #foreach( $optionCombo in $allOptionCombos )            
-            <td>
-                <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>                          
-            </td>       
-        #end        
-        
-        $customDataEntryFormCode
-        
-    #end
-
+#if ( $disableDefaultForm )    
+  #if ( $customDataEntryFormExists )  
+  #foreach( $optionCombo in $allOptionCombos )            
+  <td>
+    <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>                          
+  </td>       
+  #end              
+  $customDataEntryFormCode
+  #end
+  
 #else
     
-    #if ( $customDataEntryFormExists && $displayMode=="customform" )
+  #if ( $customDataEntryFormExists && $displayMode=="customform" )
+  #foreach( $optionCombo in $allOptionCombos )
+  <td><span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span></td>       
+  #end
+  $customDataEntryFormCode    
+  
+  #else
+  #set( $tabIndex = 1 )
+  #foreach( $categoryCombo in $orderedCategoryCombos )
+  <div style="border:1px solid #808080;width:98%">            
+    <table class="mainPageTable" cellpadding="0">
+    #set( $colCount = $numberOfTotalColumns.get( $categoryCombo.id )  ) 
+    #set( $categories = $orderedCategories.get( $categoryCombo.id )  )
+    #set( $optionsMap = $orderedOptionsMap.get( $categoryCombo.id )  )
+    #set( $colRepeat = $catColRepeat.get( $categoryCombo.id )  )
     
-        #foreach( $optionCombo in $allOptionCombos )
-            
-            <td>
-                <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>                          
-            </td>       
-            
+    #foreach( $category in $categories )
+    #set( $categoryOptions = $optionsMap.get( $category.id ) )
+    #set( $colCount = $colCount / $categoryOptions.size() )
+    <tr colspan="$colCount">
+      <td></td>
+      #set( $cols = $colRepeat.get( $category.id ) )
+      #foreach( $col in $cols )
+        #foreach( $categoryOption in $categoryOptions )
+        #set( $optionName = $categoryOption.name )
+        <th colspan="$colCount"><div align="center"> #if( $optionName != "default" ) $optionName #end </div></th>
         #end
-    
-        $customDataEntryFormCode    
+      #end
+    </tr>
+    #end
 
+    #set( $count = 0 )               
+    #set( $dataElements = $orderedDataElements.get( $categoryCombo )  )
+    #set( $optionCombos = $orderdCategoryOptionCombos.get( $categoryCombo.id )  )
+    #set( $mark = 0 )
+    #foreach( $dataElement in $dataElements )
+    #if( $mark == 1 )
+    #set( $mark = 0 )
     #else
-        
-        #set( $tabIndex = 1 )
-        
-        #foreach( $categoryCombo in $orderedCategoryCombos )
-        	
-        	<div style="border:1px solid #808080;width:98%">            
-        		<table class="mainPageTable" cellpadding="0">
-        			#set( $colCount = $numberOfTotalColumns.get( $categoryCombo.id )  ) 
-                    #set( $categories = $orderedCategories.get( $categoryCombo.id )  )
-                    #set( $optionsMap = $orderedOptionsMap.get( $categoryCombo.id )  )
-                    #set( $colRepeat = $catColRepeat.get( $categoryCombo.id )  )
-                
-                    #foreach( $category in $categories )
-            
-                        #set( $categoryOptions = $optionsMap.get( $category.id ) )
-                        #set( $colCount = $colCount / $categoryOptions.size() )     
-                        <tr colspan="$colCount">
-                            <td></td>
-                            #set( $cols = $colRepeat.get( $category.id ) )
-                            #foreach( $col in $cols )
-                                #foreach( $categoryOption in $categoryOptions )
-                                	#set( $optionName = $categoryOption.name )
-                                    <th colspan="$colCount"> <div align="center"> #if( $optionName != "default" ) $optionName #end </div> </th>
-                                #end
-                            #end                            
-                        </tr>
-                    #end
-    
-                    #set( $count = 0 )               
-                    
-                    #set( $dataElements = $orderedDataElements.get( $categoryCombo )  )
-                    #set( $optionCombos = $orderdCategoryOptionCombos.get( $categoryCombo.id )  )
-
-					#set( $mark = 0 )
-                    #foreach( $dataElement in $dataElements )
-                    	#if( $mark == 1 )
-            				#set( $mark = 0 )
-        				#else
-            				#set( $mark = 1 )
-        				#end
+    #set( $mark = 1 )
+    #end
         				 
-                        #set( $count = $count + 1 )
-                        #set( $calculatedValue = false )
-                        #set( $calculatedValue = $calculatedValueMap.get( $dataElement ) )
-                        
-                        #set( $calculated = false )
-                        #set( $calculated = ($calculatedDataElementIds.contains($dataElement.id)) )
-                        <tr>            
-                            ##data element name
-                            <td #if( $mark == 1 ) style="background-color:#dddddd" #end>
-                                <span id="value[$dataElement.id].name" title="$!encoder.htmlEncode( $dataElement.description )">
-                
-                                    #if( $useShortName )
-                                        $encoder.htmlEncode( $dataElement.shortName )
-                                    #else
-                                        $encoder.htmlEncode( $dataElement.name )
-                                    #end           
-                                </span>
-                            </td>    
-                            
-                            ##type      
-                            <td style="display:none">
-                                $dataElementTypeMap.get( $dataElement.type )
-                                <span id="value[$dataElement.id].type" style="display:none">$dataElement.getDetailedNumberType()</span>
-                            </td>                                  
+    #set( $count = $count + 1 )
+    #set( $calculatedValue = false )
+    #set( $calculatedValue = $calculatedValueMap.get( $dataElement ) )                        
+    #set( $calculated = false )
+    #set( $calculated = ($calculatedDataElementIds.contains($dataElement.id)) )
+    <tr>            
+      ## Data element name
+      <td #if( $mark == 1 ) style="background-color:#dddddd" #end>
+        <span id="value[$dataElement.id].name" title="$!encoder.htmlEncode( $dataElement.description )">
+        #if( $useShortName )
+        $encoder.htmlEncode( $dataElement.shortName )
+        #else
+        $encoder.htmlEncode( $dataElement.name )
+        #end           
+        </span>
+      </td>    
+                    
+      ## Type      
+      <td style="display:none">
+        $dataElementTypeMap.get( $dataElement.type )
+        <span id="value[$dataElement.id].type" style="display:none">$dataElement.getDetailedNumberType()</span>
+      </td>                                  
                                             
-                            #foreach( $optionCombo in $optionCombos )                       
-                                #set( $minMax = false )
-                                #set( $minMax = $minMaxMap.get( "$dataElement.id:$optionCombo.id" ) )
-                        
-                                #set( $dataValue = false )
-                                #set( $dataValue = $dataValueMap.get( "$dataElement.id:$optionCombo.id" ) )
-            
-                                #set( $dataEntryId = "value[$dataElement.id].value:value[$optionCombo.id].value" )
-                                ##Data Entry
-                                <td>
-                                    #if( $dataElement.type == "bool" )
-                                        <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>
-                                        <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-                                            <option value="">[$i18n.getString( "no_value" )]</option>
-                                            <option value="true" #if( $dataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
-                                            <option value="false" #if( $dataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
-                                        </select>
-                                    #else                                
-                                        #if( $dataElement.type == "string" )
-                                            #set( $coun = 0 ) 
-                                            #foreach($customValue in $customValues)
-                                                #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id)                                    
-                                                    #set( $coun = $coun +1 )
-                                                #end
-                                            #end  
-                                            #if($coun>0)   
-                                                <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-                                                    <option value="" </option>                
-                                                    #foreach($customValue in $customValues)
-                                                        #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id)
-                                                            <option value="$customValue.customValue" #if( $dataValue.value == $customValue.customValue ) selected="selected" #end>$customValue.customValue</option>   
-                                                        #end
-                                                    #end 
-                                                </select>
-                                            #else
-                                                <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>                                
-                                            #end    
-                                        #end    
-                                    #end
+      #foreach( $optionCombo in $optionCombos )                       
+      #set( $minMax = false )
+      #set( $minMax = $minMaxMap.get( "$dataElement.id:$optionCombo.id" ) )
+      #set( $dataValue = false )
+      #set( $dataValue = $dataValueMap.get( "$dataElement.id:$optionCombo.id" ) )
+      #set( $dataEntryId = "value[$dataElement.id].value:value[$optionCombo.id].value" )
+      
+      ## Data entry
+      <td>
+        #if( $dataElement.type == "bool" )
+        <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>
+        <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
+          <option value="">[$i18n.getString( "no_value" )]</option>
+          <option value="true" #if( $dataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
+          <option value="false" #if( $dataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
+        </select>
+        
+        #else                                
+        #if( $dataElement.type == "string" )
+        #set( $coun = 0 )
+        #foreach($customValue in $customValues)
+          #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id)                                    
+          #set( $coun = $coun +1 )
+          #end
+        #end
+        #if( $coun > 0 )
+        <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
+        #foreach($customValue in $customValues)
+          #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id)
+          <option value="$customValue.customValue" #if( $dataValue.value == $customValue.customValue ) selected="selected" #end>$customValue.customValue</option>
+          #end
+        #end
+        </select>
+        
+        #else
+        <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>                                
+        #end
+        #end
+        #end
                                 
-                                    #set( $minMaxError = false )
-                                    #if( $dataElement.type == "int" && $dataValue && $minMax )          
-                                        #if( $integer.parseInt( $dataValue.value ) < $minMax.min || $integer.parseInt( $dataValue.value ) > $minMax.max )
-                                            #set( $minMaxError = true )
-                                        #end
-                                    #end
-                                                
-                                    <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>
-                                    <span id="value[$dataElement.id].name" style="display:none">$encoder.htmlEncode( $dataElement.shortName )</span>
-                                    <div id="value[$dataElement.id:$optionCombo.id].min" style="display:none">$!minMax.min</div>
-                                    <div id="value[$dataElement.id:$optionCombo.id].max" style="display:none">$!minMax.max</div>    
+        #set( $minMaxError = false )
+        #if( $dataElement.type == "int" && $dataValue && $minMax )
+          #if( $integer.parseInt( $dataValue.value ) < $minMax.min || $integer.parseInt( $dataValue.value ) > $minMax.max )
+          #set( $minMaxError = true )
+          #end
+        #end
+
+        <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>
+        <span id="value[$dataElement.id].name" style="display:none">$encoder.htmlEncode( $dataElement.shortName )</span>
+        <div id="value[$dataElement.id:$optionCombo.id].min" style="display:none">$!minMax.min</div>
+        <div id="value[$dataElement.id:$optionCombo.id].max" style="display:none">$!minMax.max</div>
                     
-                                    #if( $dataElement.aggregationOperator == "sum" && $dataElement.type != "string")
-                                        <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-                                    #elseif( $dataElement.type != "string")
-                                        <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-                                    #end
-                                </td>
-                                #set( $tabIndex = $tabIndex + 1 )
-                            #end
-                        </tr>                                                
-                    #end
-                </table>                
-            </div>
-            <br>
-            <br>          
-        #end        
-    #end    
-#end
+        #if( $dataElement.aggregationOperator == "sum" && $dataElement.type != "string")
+        <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
+        #elseif( $dataElement.type != "string")
+        <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
+        #end
+      </td>
+
+      #set( $tabIndex = $tabIndex + 1 )
+      #end
+    </tr>
+    #end
+    </table>
+  </div>
+  <br>
+  <br>
+  #end        
+#end
+#end
+
 #parse( "/dhis-web-dataentry/completeRegistration.vm" )
 
 <script type="text/javascript">
@@ -190,4 +173,4 @@
 		  #set( $count = $count + 1 )
 		#end
     }
-</script>
\ No newline at end of file
+</script>

=== removed file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/order.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/order.vm	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/order.vm	1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
-<h3>$i18n.getString( "data_element_order" )</h3>
-
-<p>
-	<input type="button" value="$i18n.getString( "close" )" onclick="closeWindow()">
-    <input type="button" value="$i18n.getString( "order_by_entry" )" onclick="window.location.href='orderDataElementsByEntry.action'">
-    <input type="button" value="$i18n.getString( "order_by_name" )" onclick="window.location.href='orderDataElementsByName.action'">
-    <input type="button" value="$i18n.getString( "order_by_code" )" onclick="window.location.href='orderDataElementsByCode.action'">
-    <input type="button" value="$i18n.getString( "reset_order_inherit" )" onclick="window.location.href='resetDataElementOrder.action'">
-</p>
-
-<table>
-	<tr>
-		<th>$i18n.getString( "name" )</th>
-		<th>$i18n.getString( "code" )</th>
-		<th>$i18n.getString( "move" )</th>
-	</tr>
-	#set( $mark = 0 )
-	#foreach( $dataElement in $dataElements )
-		#if( $mark == 1 )
-			#set( $mark = 0 )
-		#else
-			#set( $mark = 1 )
-		#end
-	<tr #if( $mark == 0 ) style="background-color:#dddddd" #end>
-		<td>$encoder.htmlEncode( $dataElement.name )</td>
-		<td>$!encoder.htmlEncode( $dataElement.code )</td>
-		<td>
-			<a href="moveDataElementUp.action?dataElementId=$dataElement.id"><img src="../images/move_up.png" alt="$i18n.getString( "move_up" )"></a>
-			<a href="moveDataElementDown.action?dataElementId=$dataElement.id"><img src="../images/move_down.png" alt="$i18n.getString( "move_down" )"></a>
-		</td>
-	</tr>
-	#end
-</table>

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm	2010-11-12 07:55:55 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm	2010-11-16 15:09:55 +0000
@@ -2,167 +2,154 @@
 #parse( "/dhis-web-dataentry/select.vm" )
 
 #set( $marker = 0 )
-
 #set( $tabIndex = 1 )
 
-#foreach( $section in $sections)	
-	
+#foreach( $section in $sections)
+
 #if( $marker == 1 )
-	#set( $marker = 0 )
-	
+  #set( $marker = 0 )
 #else
-	#set( $marker = 1 )
+  #set( $marker = 1 )
 #end
+
+<div style="border:thin solid">
+
+<table class="mainPageTable">
+<tr>
+  <td onclick="openCloseSection( $section.id )" onmouseover="style.backgroundColor='#ebf0f6';" onmouseout="style.backgroundColor='#FFFFFF'">
+    <div id="$section.id:name" style="text-align:center"><h3>$encoder.htmlEncode( $section.name )</h3></div>
+  </td>
+</tr>
+<tr>
+  <td>
+    <div id="$section.id" style="display:block">
+      <table class="mainPageTable" cellpadding="0">
+      #set( $categoryComboId = $sectionCombos.get( $section.id ) )
+      #set( $colCount = $numberOfTotalColumns.get( $categoryComboId ) )
+      #set( $categories = $orderedCategories.get( $categoryComboId ) )
+      #set( $optionsMap = $orderedOptionsMap.get( $categoryComboId ) )
+      #set( $colRepeat = $catColRepeat.get( $categoryComboId ) )
 	
-<div style="border:thin solid; ">            
-	<table class="mainPageTable">    		
-   			<tr>		   
-   			<td onclick="openCloseSection( $section.id )" onmouseover="style.backgroundColor='#ebf0f6';" onmouseout="style.backgroundColor='#FFFFFF'">
-   				<div id="$section.id:name" style="text-align:center"><h3>$encoder.htmlEncode( $section.name )</h3></div>
-   			</td>       				   			        		  
-		</tr>    	
-		<tr>
-   			<td>        	
-       			<div id="$section.id" style="display:block">        				
-				
-				<table class="mainPageTable" cellpadding="0">
-					
-				    #set( $categoryComboId = $sectionCombos.get( $section.id ) )   
-				
-				    #set( $colCount = $numberOfTotalColumns.get( $categoryComboId )  ) 
-				    #set( $categories = $orderedCategories.get( $categoryComboId )  )
-				    #set( $optionsMap = $orderedOptionsMap.get( $categoryComboId )  )
-				    #set( $colRepeat = $catColRepeat.get( $categoryComboId )  )
-				                
-				    #foreach( $category in $categories )
-				            
-				        #set( $categoryOptions = $optionsMap.get( $category.id ) )
-				        #set( $colCount = $colCount / $categoryOptions.size() )     
-				        <tr colspan="$colCount">
-				            <td></td>
-				            #set( $cols = $colRepeat.get( $category.id ) )
-				            #foreach( $col in $cols )
-				                #foreach( $categoryOption in $categoryOptions )
-				                	#set( $optionName = $categoryOption.name )                    
-				                    <th colspan="$colCount"> <div align="center"> #if( $optionName != "default" ) $optionName #end </div> </th>
-				                #end
-				            #end                            
-				        </tr>
-				    #end
-				    
-				    #set( $count = 0 )            
-				    #set( $mark = 0 )
-				    #set( $optionCombos = $orderdCategoryOptionCombos.get( $categoryComboId )  )    
-				    
-				    #foreach( $dataElement in $section.dataElements )
-				    	#if( $mark == 1 )
-				            #set( $mark = 0 )
-				        #else
-				            #set( $mark = 1 )
-				        #end    
-				        
-				        #set( $count = $count + 1 )
-				        #set( $calculatedValue = false )
-				        #set( $calculatedValue = $calculatedValueMap.get( $dataElement ) )
-				                        
-				        #set( $calculated = false )
-				        #set( $calculated = ($calculatedDataElementIds.contains($dataElement.id)) )
-				        <tr>        
-				            ##data element name
-				            <td #if( $mark == 1 ) style="background-color:#dddddd" #end>
-				                <span id="value[$dataElement.id].name" title="$!encoder.htmlEncode( $dataElement.description )">
-				                    #if( $useShortName )
-				                        $encoder.htmlEncode( $dataElement.shortName )
-				                    #else
-				                        $encoder.htmlEncode( $dataElement.name )
-				                    #end        
-				                </span>
-				            </td>    
-				                            
-				            ##type      
-				            <td style="display:none">
-				                $dataElementTypeMap.get( $dataElement.type )
-				                <span id="value[$dataElement.id].type" style="display:none">$dataElement.getDetailedNumberType()</span>
-				            </td>                                  
-				                                            
-				            #foreach( $optionCombo in $optionCombos )                       
-				                #set( $minMax = false )
-				                #set( $minMax = $minMaxMap.get( "$dataElement.id:$optionCombo.id" ) )
-				                        
-				                #set( $dataValue = false )
-				                #set( $dataValue = $dataValueMap.get( "$dataElement.id:$optionCombo.id" ) )
-				            
-				                #set( $dataEntryId = "value[$dataElement.id].value:value[$optionCombo.id].value" )
-				                        
-				                ##Data Entry
-				                <td>                	
-				                
-				                    #set( $greyedField = false )
-				                    #set( $greyedField = $greyedFields.get( "$dataElement.id:$optionCombo.id" ) )
-				                    
-				                    #if( $dataElement.type == "bool" )
-				                        <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>
-				                        <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100%  #if( $greyedField ) ;background-color:#000000 #end " tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end #if( $greyedField ) disabled="disabled" #end>
-				                            <option value="">[$i18n.getString( "no_value" )]</option>
-				                            <option value="true" #if( $dataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
-				                            <option value="false" #if( $dataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
-				                        </select>
-				                    #else                                
-				                        #if( $dataElement.type == "string" )
-				                            #set( $coun = 0 ) 
-				                            #foreach($customValue in $customValues)
-				                                #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id)                                    
-				                                    #set( $coun = $coun +1 )
-				                                #end
-				                            #end  
-				                            #if($coun>0)   
-				                                <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100% #if( $greyedField ) ;background-color:#000000 #end " tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end #if( $greyedField ) disabled="disabled" #end>
-				                                    <option value="">[$i18n.getString( "please_select" )] </option>                
-				                                    #foreach($customValue in $customValues)
-				                                        #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id)
-				                                            <option value="$customValue.customValue" #if( $dataValue.value == $customValue.customValue ) selected="selected" #end>$customValue.customValue</option>   
-				                                        #end
-				                                    #end 
-				                                </select>
-				                            #else
-				                                <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end  #if( $greyedField ) ;background-color:#000000 #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end #if( $greyedField ) disabled="disabled" #end>                                 
-				                            #end    
-				                        #end    
-				                    #end
-				                                
-				                    #set( $minMaxError = false )
-				                    #if( $dataElement.type == "int" && $dataValue && $minMax )          
-				                        #if( $integer.parseInt( $dataValue.value ) < $minMax.min || $integer.parseInt( $dataValue.value ) > $minMax.max )
-				                            #set( $minMaxError = true )
-				                        #end
-				                    #end
-				                                                
-				                    <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>
-				                    <span id="value[$dataElement.id].name" style="display:none">$encoder.htmlEncode( $dataElement.shortName )</span>
-				                    <div id="value[$dataElement.id:$optionCombo.id].min" style="display:none">$!minMax.min</div>
-				                    <div id="value[$dataElement.id:$optionCombo.id].max" style="display:none">$!minMax.max</div>    
-				                    
-				                    #if( $dataElement.aggregationOperator == "sum" && $dataElement.type != "string")
-				                    	<input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end  #if( $greyedField ) ;background-color:#000000 #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end  #if( $greyedField ) disabled="disabled" #end>	                        	
-				                    #elseif( $dataElement.type != "string")
-				                        <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end  #if( $greyedField ) ;background-color:#000000 #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end #if( $greyedField ) disabled="disabled" #end>
-				                    #end
-				                </td>
-				                #set( $tabIndex = $tabIndex + 1 )
-				            #end
-				        </tr>
-				        <tr></tr>                                                
-				    #end    
-				</table>
-				
-       			</div>
-   			</td>
-		</tr>    		    		    	    	
+      #foreach( $category in $categories )
+	  #set( $categoryOptions = $optionsMap.get( $category.id ) )
+      #set( $colCount = $colCount / $categoryOptions.size() )
+      <tr colspan="$colCount">
+        <td></td>
+        #set( $cols = $colRepeat.get( $category.id ) )
+        #foreach( $col in $cols )
+          #foreach( $categoryOption in $categoryOptions )
+          #set( $optionName = $categoryOption.name )
+          <th colspan="$colCount"> <div align="center"> #if( $optionName != "default" ) $optionName #end </div> </th>
+          #end
+        #end
+      </tr>
+      #end
+
+      #set( $count = 0 )
+      #set( $mark = 0 )
+      #set( $optionCombos = $orderdCategoryOptionCombos.get( $categoryComboId )  )
+      #foreach( $dataElement in $section.dataElements )
+      #if( $mark == 1 )
+      #set( $mark = 0 )
+      #else
+      #set( $mark = 1 )
+      #end
+      #set( $count = $count + 1 )
+      #set( $calculatedValue = false )
+      #set( $calculatedValue = $calculatedValueMap.get( $dataElement ) )
+      #set( $calculated = false )
+      #set( $calculated = ($calculatedDataElementIds.contains($dataElement.id)) )
+      <tr>
+      
+        ## Data element name
+        <td #if( $mark == 1 ) style="background-color:#dddddd" #end>
+        <span id="value[$dataElement.id].name" title="$!encoder.htmlEncode( $dataElement.description )">
+        #if( $useShortName )
+        $encoder.htmlEncode( $dataElement.shortName )
+        #else
+        $encoder.htmlEncode( $dataElement.name )
+        #end
+        </span>
+        </td>
+
+        ## Type      
+        <td style="display:none">
+        $dataElementTypeMap.get( $dataElement.type )
+        <span id="value[$dataElement.id].type" style="display:none">$dataElement.getDetailedNumberType()</span>
+        </td>
+                                          
+        #foreach( $optionCombo in $optionCombos )                       
+        #set( $minMax = false )
+        #set( $minMax = $minMaxMap.get( "$dataElement.id:$optionCombo.id" ) )
+        #set( $dataValue = false )
+        #set( $dataValue = $dataValueMap.get( "$dataElement.id:$optionCombo.id" ) )
+        #set( $dataEntryId = "value[$dataElement.id].value:value[$optionCombo.id].value" )
+
+        ## Data Entry
+        <td>	                
+        #set( $greyedField = false )
+        #set( $greyedField = $greyedFields.get( "$dataElement.id:$optionCombo.id" ) )
+        #if( $dataElement.type == "bool" )
+        <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>
+        <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100%  #if( $greyedField ) ;background-color:#000000 #end " tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end #if( $greyedField ) disabled="disabled" #end>
+	      <option value="">[$i18n.getString( "no_value" )]</option>
+          <option value="true" #if( $dataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
+          <option value="false" #if( $dataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
+        </select>
+        #else
+        #if( $dataElement.type == "string" )
+        #set( $coun = 0 )
+          #foreach($customValue in $customValues)
+          #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id)
+          #set( $coun = $coun +1 )
+          #end
+          #end
+          #if( $coun > 0 )
+          <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100% #if( $greyedField ) ;background-color:#000000 #end " tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end #if( $greyedField ) disabled="disabled" #end>
+            <option value="">[$i18n.getString( "please_select" )] </option>
+            #foreach($customValue in $customValues)
+              #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id)
+              <option value="$customValue.customValue" #if( $dataValue.value == $customValue.customValue ) selected="selected" #end>$customValue.customValue</option>
+	          #end
+            #end
+		  </select>
+	      #else
+          <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError );background-color:#ffcccc #end  #if( $greyedField );background-color:#000000 #end #if( $dataElement.type == "int" );text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end #if( $greyedField ) disabled="disabled" #end>
+          #end
+        #end
+        #end
+        
+        #set( $minMaxError = false )
+        #if( $dataElement.type == "int" && $dataValue && $minMax )
+          #if( $integer.parseInt( $dataValue.value ) < $minMax.min || $integer.parseInt( $dataValue.value ) > $minMax.max )
+          #set( $minMaxError = true )
+          #end
+        #end
+
+        <span id="value[option$optionCombo.id].name" style="display:none">$optionCombo.name</span>
+        <span id="value[$dataElement.id].name" style="display:none">$encoder.htmlEncode( $dataElement.shortName )</span>
+        <div id="value[$dataElement.id:$optionCombo.id].min" style="display:none">$!minMax.min</div>
+        <div id="value[$dataElement.id:$optionCombo.id].max" style="display:none">$!minMax.max</div>
+
+        #if( $dataElement.aggregationOperator == "sum" && $dataElement.type != "string")
+        <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError );background-color:#ffcccc #end  #if( $greyedField );background-color:#000000 #end #if( $dataElement.type == "int" );text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end  #if( $greyedField ) disabled="disabled" #end>
+        #elseif( $dataElement.type != "string")
+        <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveMultiDimensionalValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError );background-color:#ffcccc #end  #if( $greyedField );background-color:#000000 #end #if( $dataElement.type == "int" );text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end #if( $greyedField ) disabled="disabled" #end>
+        #end
+      </td>
+      #set( $tabIndex = $tabIndex + 1 )
+      #end
+      </tr>
+	#end
 	</table>
+    </div>
+    </td>
+  </tr>
+  </table>
 </div>
 
-<br>		
-	
+<br>
+
 #end
 
 #parse( "/dhis-web-dataentry/completeRegistration.vm" )