continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r330052 - /maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm
Date Tue, 01 Nov 2005 13:13:56 GMT
Author: evenisse
Date: Tue Nov  1 05:13:51 2005
New Revision: 330052

URL: http://svn.apache.org/viewcvs?rev=330052&view=rev
Log:
Add default value if it's defined

Modified:
    maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm?rev=330052&r1=330051&r2=330052&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm Tue Nov
 1 05:13:51 2005
@@ -55,10 +55,15 @@
 ## ----------------------------------------------------------------------------
 
 #macro ( text $element $elementData )
+#if ( $elementData == "" && $element.defaultValue )
+#set ( $value = $element.defaultValue )
+#else
+#set ( $value = $elementData )
+#end
 #if ( $element && $element.attributes && $element.attributes.size > 0
)
-<input type="text" name="$element.id" value="$elementData" size="$element.attributes.size"/>
+<input type="text" name="$element.id" value="$value" size="$element.attributes.size"/>
 #else
-<input type="text" name="$element.id" value="$elementData" size="100"/>
+<input type="text" name="$element.id" value="$value" size="100"/>
 #end
 #end
 
@@ -79,7 +84,12 @@
 #end
 
 #macro ( checkbox $element $elementData )
-<input type="checkbox" name="$element.id" #if( $elementData == "true" ) checked="checked"
#end/>
+#if ( $elementData == "" && $element.defaultValue )
+#set ( $value = $element.defaultValue )
+#else
+#set ( $value = $elementData )
+#end
+<input type="checkbox" name="$element.id" #if( $value == "true" ) checked="checked" #end/>
 #end
 
 #macro ( pulldown $element $elementData )



Mime
View raw message