From f954fdbde49bd97d911969dc4cfef343606d18e1 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Thu, 7 Jul 2016 08:21:12 +0100 Subject: [PATCH] [VIVO-1251] Special chars in property group names --- .../partials/individual/individual-property-group-menus.ftl | 4 ++-- .../main/webapp/templates/freemarker/lib/lib-properties.ftl | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/webapp/src/main/webapp/templates/freemarker/body/partials/individual/individual-property-group-menus.ftl b/webapp/src/main/webapp/templates/freemarker/body/partials/individual/individual-property-group-menus.ftl index fc794ab72..df68bbd06 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/partials/individual/individual-property-group-menus.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/partials/individual/individual-property-group-menus.ftl @@ -19,7 +19,7 @@ <#assign groupnameHtmlId = p.createPropertyGroupHtmlId(groupname) > <#-- capitalize will capitalize each word in the name; cap_first only the first. We may need a custom function to capitalize all except function words. --> -
  • ${groupname?capitalize}
  • +
  • ${groupname?capitalize}
  • @@ -44,7 +44,7 @@ <#if groupName?has_content> <#--the function replaces spaces in the name with underscores, also called for the property group menu--> <#assign groupNameHtmlId = p.createPropertyGroupHtmlId(groupName) > -

    ${groupName?capitalize}

    +

    ${groupName?capitalize}

    <#else>

    ${i18n().properties_capitalized}

    diff --git a/webapp/src/main/webapp/templates/freemarker/lib/lib-properties.ftl b/webapp/src/main/webapp/templates/freemarker/lib/lib-properties.ftl index 881e7e412..aae31c78b 100644 --- a/webapp/src/main/webapp/templates/freemarker/lib/lib-properties.ftl +++ b/webapp/src/main/webapp/templates/freemarker/lib/lib-properties.ftl @@ -334,6 +334,10 @@ name will be used as the label. --> <#--Property group names may have spaces in them, replace spaces with underscores for html id/hash--> <#function createPropertyGroupHtmlId propertyGroupName> - <#return propertyGroupName?replace(" ", "_")> + <#local groupName = propertyGroupName?replace(" ", "_")> + <#local groupName = groupName?replace("/", "-slash-")> + <#local groupName = groupName?replace(",", "-comma-")> + <#local groupName = groupName?replace("&", "-and-")> + <#return groupName>