From 3976cd36b486565c2ee398c0ebef8bc411a77f03 Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 30 May 2019 17:13:27 +0000 Subject: [PATCH] Bugfixes for Freemarker functions git-svn-id: https://svn.libreccm.org/ccm/trunk@6096 8810af33-2d31-482b-a856-94f89814c4df --- .../ccm-sci-publications-navigation.ftl | 70 +++++++++++++++---- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/ccm-sci-publications-navigation/web/themes/freemarker/ccm-sci-publications-navigation.ftl b/ccm-sci-publications-navigation/web/themes/freemarker/ccm-sci-publications-navigation.ftl index 47c2c8795..684073cad 100644 --- a/ccm-sci-publications-navigation/web/themes/freemarker/ccm-sci-publications-navigation.ftl +++ b/ccm-sci-publications-navigation/web/themes/freemarker/ccm-sci-publications-navigation.ftl @@ -14,7 +14,11 @@ <#function getTitleFilterValue list> - <#return list["./fiters/title"]> + <#if (list["./filters/title"]?size > 0)> + <#return list["./filters/title"]> + <#else> + <#return ""> + <#function getYearOfPublicationFilterAvailableYears list> @@ -22,15 +26,27 @@ <#function getYearOfPublicationFilterValue list> - <#return list["./fiters/year"]> + <#if (list["./fiters/year"]?size > 0)> + <#return list["./fiters/year"].@@text> + <#else> + <#return ""> + <#function getAuthorsFilterValue list> - <#return list["./filters/authors"]> + <#if (list["./filters/authors"]?size > 0)> + <#return list["./filters/authors"]> + <#else> + <#return ""> + <#function getSort list> - <#return list["./filters/sort"]> + <#if (list["./filters/sort"]?size > 0)> + <#return list["./filters/sort"]> + <#else> + <#return ""> + <#function getCount list> @@ -66,7 +82,7 @@ <#function getPublicationObjectType item> - <#return item["./object-type"]> + <#return item["./object-type"].@@text> <#function getPublicationTitle item> @@ -81,12 +97,20 @@ <#return item["./authors/author"]> +<#function hasAuthorSurname author> + <#return (author["./@surname"]?size > 0)> + + <#function getAuthorSurname author> - <#return author["./surname"]> + <#return author["./@surname"]> + + +<#function hasAuthorGivenName author> + <#return (author["./@givenname"]?size > 0)> <#function getAuthorGivenName author> - <#return author["./givenname"]> + <#return author["./@givenname"]> <#function getPublicationPlace item> @@ -122,23 +146,35 @@ <#function getJournalName journal> - <#return journal["./name"]> + <#return journal["./name"].@@text> <#function getPublicationIssue item> - <#return item["./issue"]> + <#return item["./issue"].@@text> + + +<#function hasPublicationVolumeOfJournal item> + <#return (item["./volume-of-journal"]?size > 0)> <#function getPublicationVolumeOfJournal item> - <#return item["./volume-of-journal"]> + <#return item["./volume-of-journal"].@@text> <#function getPublicationPagesFrom item> - <#return item["./pages-from"]> + <#if (item["./pages-from"]?size > 0)> + <#return item["./pages-from"].@@text?number> + <#else> + <#return 0> + <#function getPublicationPagesTo item> - <#return item["./pages-to"]> + <#if (item["./pages-to"]?size > 0)> + <#return item["./pages-to"].@@text?number> + <#else> + <#return 0> + <#function getPublicationCollectedVolume item> @@ -150,13 +186,21 @@ <#function getCollectedVolumeTitle collectedVolume> - <#return collectedVolume["./title"]> + <#return collectedVolume["./title"].@@text> <#function getCollectedVolumePublisher collectedVolume> <#return collectedVolume["./publisher"]> +<#function getCollectedVolumePlace collectedVolume> + <#return collectedVolume["./place"]> + + +<#function hasProceedings item> + <#return (item["./proceedings"]?size > 0)> + + <#function getProceedings item> <#return item["./proceedings"]> \ No newline at end of file