svn commit: r814260 - /ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r814260 - /ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl

apatel-2
Author: apatel
Date: Sun Sep 13 02:03:46 2009
New Revision: 814260

URL: http://svn.apache.org/viewvc?rev=814260&view=rev
Log:
Using style attribute value to determine appropriate html element and render it. Idea is to render better markup.

Modified:
    ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl

Modified: ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl?rev=814260&r1=814259&r2=814260&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl Sun Sep 13 02:03:46 2009
@@ -61,7 +61,55 @@
 </#macro>
 
 <#macro renderHorizontalSeparator id style><hr<#if id?has_content> id="${id}"</#if><#if style?has_content> class="${style}"</#if>/></#macro>
-<#macro renderLabel text id style><#if text?exists><#if id?has_content || style?has_content><span<#if id?has_content> id="${id}"</#if><#if style?has_content> class="${style}"</#if>></#if>${text}<#if id?has_content || style?has_content></span></#if></#if></#macro>
+<#macro renderLabel text id style>
+  <#if text?exists>
+    <#-- Label is considered block level element in screen widget. There is not reason to render text outside of any html element. Use of style element has set pattern and we'll use style
+       to determine appropriate html element to use -->
+    <#if style?has_content>
+      <#if style=="h1">
+        <h1
+      <#elseif style=="h2">
+        <h2
+      <#elseif style=="h3">
+        <h3
+      <#elseif style=="h4">
+        <h4
+      <#elseif style=="h5">
+        <h5
+      <#elseif style=="h6">
+        <h6
+      <#else>
+        <p class="${style}"
+      </#if>
+    <#else>
+      <p
+    </#if>
+    <#if id?has_content >
+        <#if id?has_content> id="${id}"</#if>
+    </#if>
+        >${text}
+    <#if style?has_content>
+      <#if style=="h1">
+        <h1/>
+      <#elseif style=="h2">
+        <h2/>
+      <#elseif style=="h3">
+        <h3/>
+      <#elseif style=="h4">
+        <h4/>
+      <#elseif style=="h5">
+        <h5/>
+      <#elseif style=="h6">
+        <h6/>
+      <#else>
+        <p/>
+      </#if>
+    <#else>
+      <p/>
+    </#if>
+  </#if>
+</#macro>
+
 <#macro renderLink parameterList targetWindow target uniqueItemName linkType actionUrl id style name linkUrl text imgStr>
 <#if "hidden-form" == linkType>
 <form method="post" action="${actionUrl}" <#if targetWindow?has_content>target="${targetWindow}"</#if> onSubmit="javascript:submitFormDisableSubmits(this)" name="${uniqueItemName}"><#rt/>