diff --git a/webapp/src/main/webapp/themes/iph/templates/text-lib.ftl b/webapp/src/main/webapp/themes/iph/templates/text-lib.ftl index 75f9f6e6..a63819ba 100644 --- a/webapp/src/main/webapp/themes/iph/templates/text-lib.ftl +++ b/webapp/src/main/webapp/themes/iph/templates/text-lib.ftl @@ -53,34 +53,67 @@ <#macro arrangeDocumentParts > -
+
+ <#assign lastLevel = 0 > <#list paths as order> -
<#-- ${order.path} --> - <#list excerpts as excerptProperties> - <#if order.elenphExcerpt?has_content && excerptProperties.elenphExcerpt == order.elenphExcerpt> - <#assign excerptText = excerptProperties.htmlContent > - <#assign excerptTextName = excerptProperties.htmlLabel > - <#assign worksCounter = excerptProperties.worksCounter > - <#assign bibliographyCounter = excerptProperties.bibliographyCounter > - - + <#list excerpts as excerptProperties> + <#if order.elenphExcerpt?has_content && excerptProperties.elenphExcerpt == order.elenphExcerpt> + <#assign excerptText = excerptProperties.htmlContent > + <#assign excerptTextName = excerptProperties.htmlLabel > + <#assign worksCounter = excerptProperties.worksCounter > + <#assign bibliographyCounter = excerptProperties.bibliographyCounter > + + + <@startDocumentPart order.level?number lastLevel/> <#if excerptText?? && excerptTextName?? && excerptTextName?has_content && excerptText?has_content> - - - + <#assign lastLevel = order.level?number > + <@endDocumentPart lastLevel />
<@arrangeSources works works?size /> <@arrangeLiterature bibliography bibliography?size /> +<#macro startDocumentPart newLevel lastLevel=0 > + <#assign depth = newLevel - lastLevel > + <#if depth == 0> + <@closeDocPart 1 /> + <@openDocPart 1 /> + <#elseif depth > 0> + <@openDocPart depth /> + <#else > + <@closeDocPart -depth+1 /> + <@openDocPart 1 /> + + + +<#macro endDocumentPart lastLevel newLevel=0> + <#assign depth = lastLevel - newLevel > + <#if depth > 0> + <@closeDocPart depth /> + + + +<#macro closeDocPart count> + <#list 1..count as x> +
+ + + +<#macro openDocPart count> + <#list 1..count as x> + +
+ + + <#macro arrangeSources sources counter filter="none"> <#if sources?? && sources?has_content && counter > 0>