← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14984: Custom forms, removed inline css

 

------------------------------------------------------------
revno: 14984
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-25 13:10:13 +0200
message:
  Custom forms, removed inline css
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.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-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java	2014-04-25 11:10:13 +0000
@@ -270,6 +270,7 @@
             String inputHtml = inputMatcher.group();
 
             Matcher identifierMatcher = IDENTIFIER_PATTERN.matcher( inputHtml );
+            Matcher dataElementTotalMatcher = DATAELEMENT_TOTAL_PATTERN.matcher( inputHtml );
             Matcher indicatorMatcher = INDICATOR_PATTERN.matcher( inputHtml );
 
             if ( identifierMatcher.find() && identifierMatcher.groupCount() > 0 )
@@ -336,6 +337,10 @@
                 inputHtml += "<span id=\"" + dataElement.getUid() + "-dataelement\" style=\"display:none\">" + dataElement.getFormNameFallback() + "</span>";
                 inputHtml += "<span id=\"" + categoryOptionCombo.getUid() + "-optioncombo\" style=\"display:none\">" + categoryOptionCombo.getName() + "</span>";
             }
+            else if ( dataElementTotalMatcher.find() && dataElementTotalMatcher.groupCount() > 0 )
+            {
+                inputHtml = inputHtml.replace( TAG_CLOSE, " class=\"dataelementtotal\"" + TAG_CLOSE );
+            }
             else if ( indicatorMatcher.find() && indicatorMatcher.groupCount() > 0 )
             {
                 inputHtml = inputHtml.replace( TAG_CLOSE, " class=\"indicator\"" + TAG_CLOSE );

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-04-24 21:46:04 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-04-25 11:10:13 +0000
@@ -1292,6 +1292,7 @@
       complete: function()
       {
         $( '.indicator' ).attr( 'readonly', 'readonly' );
+        $( '.dataelementtotal' ).attr( 'readonly', 'readonly' );
         $( document ).trigger('dhis2.de.event.dataValuesLoaded');
       }
 	} );

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css	2014-04-24 21:46:04 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css	2014-04-25 11:10:13 +0000
@@ -117,10 +117,13 @@
 }
 
 .entryfield,
-.entryoptionset
+.entryoptionset,
+.dataelementtotal,
+.indicator
 {
   text-align: center;
   box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
+  border: 1px solid #aaa;
 }
 
 .entryarea

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js	2013-08-16 12:29:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js	2014-04-25 11:10:13 +0000
@@ -291,13 +291,12 @@
 	
 		if (dataElementType == "bool") {
 			html = "<input title=\"" + titleValue
-					+ "\" value=\"" + displayName + "\" id=\"" + dataEntryId
-					+ "\" style=\"width:7em;text-align:center\"/>";
+					+ "\" value=\"" + displayName + "\" id=\"" + dataEntryId + "\" />";
 		} 
 		else {
 			html = "<input title=\"" + titleValue
 					+ "\" value=\"" + displayName + "\" id=\"" + dataEntryId
-					+ "\" style=\"width:7em;text-align:center\"" + greyedField + "/>";
+					+ "\" " + greyedField + "/>";
 		}
 	
 		if (!checkExisted(dataEntryId)) {
@@ -319,7 +318,7 @@
 		var id = $option.data("id");
 		var title = $option.val();
 		var dataEntryId = 'total' + id;		
-		var template = '<input id="' + dataEntryId + '" name="total" value="[' + title + ']" title="' + title + '" dataelementid="' + id + '" style="width:7em;text-align:center;" readonly="readonly" />';
+		var template = '<input id="' + dataEntryId + '" name="total" value="[' + title + ']" title="' + title + '" dataelementid="' + id + '" readonly="readonly" />';
 		
 		if(!checkExisted(dataEntryId)) {
 			oEditor.insertHtml( template );
@@ -338,7 +337,7 @@
 	if( $option.length !== 0 ) {
 		var id = $option.data("id");
 		var title = $option.val();
-		var template = '<input id="indicator' + id + '" value="[ ' + title + ' ]" title="' + title + '" name="indicator" indicatorid="' + id + '" style="width:7em;text-align:center;" readonly="readonly" />';
+		var template = '<input id="indicator' + id + '" value="[ ' + title + ' ]" title="' + title + '" name="indicator" indicatorid="' + id + '" readonly="readonly" />';
 
 		if(!checkExisted("indicator" + id)) {
 			oEditor.insertHtml( template );