From be95a1bdd8afc5c2c313a72edab16d9f0d888b57 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Thu, 16 Dec 2010 22:53:08 +0000 Subject: [PATCH] NIHVIVO-1336 Educational training short view --- .../web/templates/freemarker/lib/lib-sequence.ftl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 webapp/web/templates/freemarker/lib/lib-sequence.ftl diff --git a/webapp/web/templates/freemarker/lib/lib-sequence.ftl b/webapp/web/templates/freemarker/lib/lib-sequence.ftl new file mode 100644 index 000000000..6a9552b9c --- /dev/null +++ b/webapp/web/templates/freemarker/lib/lib-sequence.ftl @@ -0,0 +1,14 @@ +<#-- $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. --> + +<#macro join arr glue=", "><#compress> + <#assign count = 0> + <#-- This is VERY ugly: adding any formatting here inserts extra spaces into the output, even with the compress + directive. The compress directive is also necessary, though. Seems counter to the documentation at + http://freemarker.org/docs/dgui_misc_whitespace.html --> + <#list arr as el><#if el?has_content><#if (count > 0)>${glue}${el}<#assign count = count+1> + +