From 546b214a865d193739f1578c0c3c7369a5c1d418 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Wed, 22 Dec 2010 19:14:08 +0000 Subject: [PATCH] Comments --- .../web/templates/freemarker/lib/lib-list.ftl | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/webapp/web/templates/freemarker/lib/lib-list.ftl b/webapp/web/templates/freemarker/lib/lib-list.ftl index dc61b170d..6570164a1 100644 --- a/webapp/web/templates/freemarker/lib/lib-list.ftl +++ b/webapp/web/templates/freemarker/lib/lib-list.ftl @@ -13,11 +13,19 @@
  • elements. An
  • element may span multiple lines. Usage: - <@firstLastList /> + <@firstLastList>
  • apples
  • bananas
  • oranges
  • - + + + <@firstLastList> + <#list animals as animal> + <#if animal != "cow"> +
  • ${animal}
  • + + + RY Consider rewriting in Java. Probably designers won't want to modify this. That would allow us to support nested
  • elements. @@ -27,9 +35,8 @@ <#assign text> <#nested> - - <@processListItems text?matches("
  • .*?
  • ", "s") /> + <@processListItems text?matches("
  • .*?
  • ", "s") /> <#----------------------------------------------------------------------------> @@ -49,19 +56,27 @@ indicate how to split the text. Usage: - <@firstLastListNested /> + <@firstLastListNested>
  • apples
  • ,
  • bananas
  • ,
  • oranges
  • - + - <@firstLastListNested delim="??" /> + <@firstLastListNested> + <#list animals as animal> + <#if animal != "cow"> +
  • ${animal}
  • , + + + + + <@firstLastListNested delim="??">
  • apples, oranges
  • ??
  • bananas, lemons
  • ??
  • grapefruit, limes
  • - + - <@firstLastListNested delim="??" /> + <@firstLastListNested delim="??">
  • Books
  • - + RY Consider rewriting in Java. Probably designers won't want to modify this. --> @@ -104,6 +119,7 @@ --> <#macro processListItems items> <#list items as item> + <#-- A FreeMarker loop variable cannot have its value modified, so we use a new variable. --> <#assign newItem = item?trim> @@ -112,6 +128,7 @@ <#-- Keep any class value already assigned --> <#assign currentClass = newItem?matches("^
  • ]*(class=[\'\"](.*?)[\'\"])")> <#list currentClass as m> + ${m?groups[2]}
    <#assign classVal = m?groups[2]> <#assign newItem = newItem?replace(m?groups[1], "")>