2010-12-16 22:53:08 +00:00
|
|
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
|
|
|
|
|
|
|
<#-- Macros for working with Freemarker sequences -->
|
|
|
|
|
|
|
|
<#-- Macro join: join array elements with the specified glue string. -->
|
|
|
|
|
2010-12-16 23:08:47 +00:00
|
|
|
<#macro join arr glue=", ">
|
2010-12-16 22:53:08 +00:00
|
|
|
<#assign count = 0>
|
2010-12-16 23:08:47 +00:00
|
|
|
<#-- Freemarker is very finicky about whitespace here. The compress directives and formatting
|
|
|
|
here work; do not alter them. -->
|
|
|
|
<#list arr as el>
|
|
|
|
<#if el?has_content>
|
|
|
|
<#compress>
|
|
|
|
<#if (count > 0)>${glue}</#if>
|
|
|
|
${el}
|
|
|
|
</#compress>
|
|
|
|
<#assign count = count+1>
|
|
|
|
</#if>
|
|
|
|
</#list>
|
|
|
|
</#macro>
|
2010-12-16 22:53:08 +00:00
|
|
|
|