← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18947: Impl long text attribute type

 

------------------------------------------------------------
revno: 18947
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-04-20 12:37:00 +0200
message:
  Impl long text attribute type
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm
  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/updateAttributeForm.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-services/dhis-service-core/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties	2015-04-20 09:40:54 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties	2015-04-20 10:37:00 +0000
@@ -537,6 +537,7 @@
 min=Min
 max=Max
 text=Text
+long_text=Long text
 string=String
 int=Number
 number=Number

=== 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	2015-03-30 09:48:48 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2015-04-20 10:37:00 +0000
@@ -122,6 +122,21 @@
 </tr>
 #end
 
+#macro( trStringInput $args )
+#if( "$!args.name" == "" )
+	#set( $name = $!args.id )
+#else
+	#set( $name = $!args.name )
+#end
+
+<tr>
+	<td style="width: 200px;"><label for="$!args.id">$!args.text #if($args.mandatory)<em title="$i18n.getString( 'required' )" class="required">*</em>#end</label></td>
+	<td>
+		<input type="text" id="$!args.id" name="$!name" value="$!args.value" class="{validate:{required:$args.mandatory,rangelength:[1,230]}}" />
+	</td>
+</tr>
+#end
+
 #macro( trTextInput $args )
 #if( "$!args.name" == "" )
 	#set( $name = $!args.id )
@@ -132,7 +147,7 @@
 <tr>
 	<td style="width: 200px;"><label for="$!args.id">$!args.text #if($args.mandatory)<em title="$i18n.getString( 'required' )" class="required">*</em>#end</label></td>
 	<td>
-		<input type="text" id="$!args.id" name="$!name" value="$!args.value" class="{validate:{required:$args.mandatory,rangelength:[1,230]}}" />
+		<textarea id="$!args.id" name="$!name" class="{validate:{required:$args.mandatory}}">$!args.value</textarea>
 	</td>
 </tr>
 #end
@@ -290,7 +305,7 @@
 
 	json.id = jqItem.attr("id").split("_")[1];
 
-	if( jqItem.is("input[type='text']") )
+	if( jqItem.is("input[type='text']") || jqItem.is("textarea") )
 	{
 		json.value = jqItem.val();
 	}
@@ -327,8 +342,10 @@
 		#end
 
 		#if( $attribute.valueType == "string" )
+			#trStringInput( { "text": $text, "id": "attribute_$id", "mandatory": $mandatory, "value": $value } )
+		#elseif( $attribute.valueType == "text" )
 			#trTextInput( { "text": $text, "id": "attribute_$id", "mandatory": $mandatory, "value": $value } )
-		#elseif(  $attribute.valueType == "bool" )
+		#elseif( $attribute.valueType == "bool" )
 			#trBooleanSelectInput( { "text": $text, "id": "attribute_$id", "mandatory": $mandatory, "value": $value } )	
 		#elseif( $attribute.valueType == "date" )
 			#trDateInput( { "text": $text, "id": "attribute_$id", "mandatory": $mandatory, "value": $value } )	

=== 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	2015-03-20 07:08:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm	2015-04-20 10:37:00 +0000
@@ -71,6 +71,7 @@
 		<td>
 			<select id="valueType" name="valueType">
 				<option value="string">$i18n.getString( "text" )</option>
+				<option value="text">$i18n.getString( "long_text" )</option>
 				<option value="bool">$i18n.getString( "yes_no" )</option>
 				<option value="date">$i18n.getString( "date" )</option>
 				<option value="number">$i18n.getString( "number" )</option>

=== 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	2015-03-20 07:08:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm	2015-04-20 10:37:00 +0000
@@ -72,6 +72,7 @@
 		<td>
 			<select id="valueType" name="valueType" style="width:20em">
 				<option value="string" #if( $attribute.valueType == 'string') selected="selected" #end>$i18n.getString( "text" )</option>
+				<option value="text" #if( $attribute.valueType == 'text') selected="selected" #end>$i18n.getString( "long_text" )</option>
 				<option value="bool" #if( $attribute.valueType == 'bool') selected="selected" #end>$i18n.getString( "yes_no" )</option>
 				<option value="date" #if( $attribute.valueType == 'date') selected="selected" #end>$i18n.getString( "date" )</option>
 				<option value="number" #if( $attribute.valueType == 'number') selected="selected" #end>$i18n.getString( "number" )</option>