=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2011-09-12 04:02:32 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2011-09-16 15:55:47 +0000 @@ -400,14 +400,14 @@ "attribute" : { "name" : { "required" : true, - "rangelength" : [ 3, 230 ], + "rangelength" : [ 2, 230 ], "alphanumericwithbasicpuncspaces" : true } }, "attributeOption" : { "name" : { "required" : true, - "rangelength" : [ 3, 230 ], + "rangelength" : [ 2, 230 ], "alphanumericwithbasicpuncspaces" : true } } === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2011-04-04 16:47:24 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2011-09-16 15:55:47 +0000 @@ -126,3 +126,124 @@ #end + +#* Helpers for building attribute forms. Note that these will have dynamic validation rules applied to them. *# + +#macro( trHeader $text ) + + $text + +#end + +#macro( trTextInput $text $name ) + + $text + + + + +#end + +#macro( trBooleanSelectInput $text $name ) + + $text + + + + +#end + +#macro( trDateInput $text $name ) + + + + $text + + + + +#end + +#macro( trDecimalInput $text $name ) + + $text + + + + +#end + +#macro( trIntegerInput $text $name ) + + $text + + + + +#end + +#macro( trPositiveIntegerInput $text $name ) + + $text + + + + +#end + +#macro( trNegativeIntegerInput $text $name ) + + $text + + + + +#end + +#macro( trMultipleSelectInput $text $name $choices ) + + $text + + + + +#end + +#macro( tblDynamicAttributes $attributes ) +
+ + #trHeader( "Dynamic Attributes" ) + + #foreach( $attribute in $attributes ) + #if( $attribute.valueType == "string" ) + #trTextInput( $attribute.name "text" ) + #elseif( $attribute.valueType == "bool" ) + #trBooleanSelectInput( $attribute.name "booleanAttribute" ) + #elseif( $attribute.valueType == "date" ) + #trDateInput( $attribute.name "dateAttribute" ) + #elseif( $attribute.valueType == "decimal" ) + #trDecimalInput( $attribute.name "decimalAttribute" ) + #elseif( $attribute.valueType == "integer" ) + #trIntegerInput( $attribute.name "integerAttribute" ) + #elseif( $attribute.valueType == "positive_integer" ) + #trPositiveIntegerInput( $attribute.name "positiveIntegerAttribute" ) + #elseif( $attribute.valueType == "negative_integer" ) + #trNegativeIntegerInput( $attribute.name "negativeIntegerAttribute" ) + #elseif( $attribute.valueType == "multiple_choice" ) + #trMultipleSelectInput( $attribute.name "multipleSelectAttribute" [ "One", "Two", "Three" ] ) + #end + #end +
+
+#end === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm 2011-09-08 19:22:56 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm 2011-09-16 15:55:47 +0000 @@ -71,10 +71,10 @@ - - - - + + + + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm 2011-09-08 19:22:56 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm 2011-09-16 15:55:47 +0000 @@ -72,10 +72,10 @@ - - - - + + + + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm 2011-09-16 13:47:12 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm 2011-09-16 15:55:47 +0000 @@ -144,15 +144,7 @@ - - - - - - - - -
Dynamic Attributes
Text
+#tblDynamicAttributes( $attributes )