← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11367: horizontal rendering of multi-ou forms ( ou=x, de=y ), basic rendering supported. categories is wip.

 

------------------------------------------------------------
revno: 11367
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-07-09 11:48:34 +0700
message:
  horizontal rendering of multi-ou forms ( ou=x, de=y ), basic rendering supported. categories is wip.
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multiOrgSectionForm.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/multiOrgSectionForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multiOrgSectionForm.vm	2013-06-24 05:33:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multiOrgSectionForm.vm	2013-07-09 04:48:34 +0000
@@ -10,6 +10,7 @@
   #set( $marker = 1 )
 #end
 
+#if( !$dataSet.renderHorizontally )
 <table class="formSection" data-multiorg="true" style="margin-bottom: 20px;">
 <tr>
   <td>
@@ -106,4 +107,82 @@
     </td>
   </tr>
 </table>
+#else
+<table class="formSection" data-multiorg="true" style="margin-bottom: 20px;">
+<tr>
+  <td>
+    <div class="cent"><h3>$encoder.htmlEncode( $section.displayName )</h3></div>
+  </td>
+</tr>
+<tr>
+  <td>
+    <div>
+    <table cellspacing="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 ) )
+    #set( $isDefaultCategory = $categories.get( 0 ).name == "default" )
+
+    <tr>
+        <td></td>
+        #foreach( $organisationUnit in $organisationUnits )
+        <th colspan="$colCount"><span align="center">${encoder.htmlEncode( $organisationUnit.displayName )}</span></th>
+        #end
+    </tr>
+
+    #set( $count = 0 )
+    #set( $mark = 0 )
+    #set( $optionCombos = $orderedCategoryOptionCombos.get( $categoryComboId )  )
+    #foreach( $optionCombo in $optionCombos )<span id="${optionCombo.uid}-optioncombo" class="hidden">${encoder.htmlEncode( $optionCombo.displayName )}</span>#end
+
+    #foreach( $dataElement in $section.dataElements )
+        #if( $mark == 1 )
+        #set( $mark = 0 )
+        #else
+        #set( $mark = 1 )
+        #end
+        #set( $count = $count + 1 )
+
+        <tr>
+            <td #if( $mark == 1 )class="alt"#else class="reg"#end>${encoder.htmlEncode( $dataElement.displayName )}</td>
+
+            #foreach( $organisationUnit in $organisationUnits )
+                #if( $isDefaultCategory )
+                    <span class="hidden" id="${dataElement.uid}-dataelement">${encoder.htmlEncode( $dataElement.getFormNameFallback() )}</span>
+                    #foreach( $optionCombo in $optionCombos )
+                    #set( $dataEntryId = "${organisationUnit.id}-${dataElement.uid}-${optionCombo.uid}-val" )
+                    #set( $greyedField = false )
+                    #set( $greyedField = $greyedFields.get( "$dataElement.uid:$optionCombo.uid" ) )
+                    #if( $dataElement.type == "bool" )
+                    <td><select name="entryselect" id="$dataEntryId" tabindex="$tabIndex"#if( $greyedField || !$hasAccess ) disabled="disabled"#end>
+                      <option value="">[$i18n.getString( "no_value" )]</option>
+                      <option value="true">$i18n.getString( "yes" )</option>
+                      <option value="false">$i18n.getString( "no" )</option>
+                    </select></td>
+                    #elseif( $dataElement.type == 'trueOnly' )
+                        <td><input name="entrytrueonly" id="$dataEntryId" type="checkbox" tabindex="$tabIndex"#if( $greyedField || !$hasAccess ) disabled="disabled"#end></td>
+                    #else
+                        #if( $dataElement.optionSet )
+                            <td><input name="entryoptionset" id="$dataEntryId" type="text" tabindex="$tabIndex"#if( $greyedField || !$hasAccess ) disabled="disabled"#end></td>
+                        #else
+                            <td><input name="entryfield" id="$dataEntryId" type="text" tabindex="$tabIndex"#if( $greyedField || !$hasAccess ) disabled="disabled"#end></td>
+                        #end
+                    #end
+                    </td>
+                    #set( $tabIndex = $tabIndex + 1 )
+                    #end
+                #else
+                #end
+            #end
+        </tr>
+    #end
+
+	</table>
+    </div>
+    </td>
+  </tr>
+</table>
+#end
 #end