Permalink
Browse files

IDE-819

  • Loading branch information...
1 parent 027ad29 commit 6a27b9298fb817211150e0fcfc5e43fc936642b3 @cinnndy9 cinnndy9 committed with gamerson Mar 20, 2013
Showing with 34 additions and 19 deletions.
  1. +34 −19 tools/plugins/com.liferay.ide.layouttpl.ui/templates/layouttpl.ftl
@@ -1,30 +1,45 @@
-<#if (root.getRows().size() > 0)>
-<div class="${templateName}" id="${root.id}" role="${root.role}">
+<#macro printLayout type="">
+<#if type == "ie">
+<#assign rowElement="table" trBegin="\n\t\t<tr>" trEnd="</tr>\n\t\t" columnElement="td" columnNewline="">
+<#else>
+<#assign rowElement="div" trBegin="" trEnd="" columnElement="div" columnNewline="\n">
+</#if>
+<#assign rowCounter=0>
<#list root.getRows() as row>
+<#if (rowCounter > 0)>
+
+</#if>
+<#assign rowCounter = rowCounter + 1>
+ <${rowElement} class="${row.className}">${trBegin}
<#if row.getColumns().size() == 1>
-<#assign columnOnly = row.getColumns().get(0)>
- <div class="${row.className}">
- <div class="portlet-column portlet-column-only" id="column-${columnOnly.numId}">
- $processor.processColumn("column-${columnOnly.numId}", "portlet-column-content portlet-column-content-only")
- </div>
- </div>
+<#assign columnOnly=row.getColumns().get(0)>
+ <${columnElement} class="portlet-column portlet-column-only" id="column-${columnOnly.numId}">
+ $processor.processColumn("column-${columnOnly.numId}", "portlet-column-content portlet-column-content-only")
+ </${columnElement}>
<#elseif (row.getColumns().size() > 1)>
- <div class="${row.className}">
<#list row.getColumns() as col>
<#if col.isFirst()>
- <div class="aui-w${col.getWeight()} portlet-column portlet-column-first" id="column-${col.numId}">
- $processor.processColumn("column-${col.numId}", "portlet-column-content portlet-column-content-first")
-<#elseif col.isLast()>
- <div class="aui-w${col.getWeight()} portlet-column portlet-column-last" id="column-${col.numId}">
- $processor.processColumn("column-${col.numId}", "portlet-column-content portlet-column-content-last")
-<#else>
- <div class="aui-w${col.getWeight()} portlet-column" id="column-${col.numId}">
- $processor.processColumn("column-${col.numId}", "portlet-column-content")
+ <${columnElement} class="aui-w${col.getWeight()} portlet-column portlet-column-first" id="column-${col.numId}">
+ $processor.processColumn("column-${col.numId}", "portlet-column-content portlet-column-content-first")
+<#elseif col.isLast()>${columnNewline}<#rt>
+ <${columnElement} class="aui-w${col.getWeight()} portlet-column portlet-column-last" id="column-${col.numId}">
+ $processor.processColumn("column-${col.numId}", "portlet-column-content portlet-column-content-last")
+<#else>${columnNewline}<#rt>
+ <${columnElement} class="aui-w${col.getWeight()} portlet-column" id="column-${col.numId}">
+ $processor.processColumn("column-${col.numId}", "portlet-column-content")
</#if>
- </div>
+ </${columnElement}>
</#list>
- </div>
</#if>
+ ${trEnd}</${rowElement}>
</#list>
+</#macro>
+<#if (root.getRows().size() > 0)>
+<div class="${templateName}" id="${root.id}" role="${root.role}">
+ #if ($browserSniffer.isIe($request) && $browserSniffer.getMajorVersion($request) < 8)
+ <@printLayout type="ie"/>
+ #else
+ <@printLayout/>
+ #end
</div>
</#if>

0 comments on commit 6a27b92

Please sign in to comment.