diff --git a/webapp/web/templates/freemarker/body/individual/individual-menu.ftl b/webapp/web/templates/freemarker/body/individual/individual-menu.ftl new file mode 100644 index 000000000..302e452b8 --- /dev/null +++ b/webapp/web/templates/freemarker/body/individual/individual-menu.ftl @@ -0,0 +1,36 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Default VIVO individual profile page template (extends individual.ftl in vitro) --> + +<#include "individual-setup.ftl"> + +<#assign individualProductExtension> + <#-- Include for any class specific template additions --> + ${classSpecificExtension!} + + <#include "individual-overview.ftl"> + + + + +<#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl --> + +

Menu management

+ +<#-- Menu Ontology properties --> +<#include "individual-menu-properties.ftl"> + +${stylesheets.add('', + '')} + +${headScripts.add('', + '', + '', + '', + '', + '', + '', + '')} + +${scripts.add('', + '')} \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/partials/individual/individual-menu-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/individual-menu-properties.ftl new file mode 100644 index 000000000..06870cc31 --- /dev/null +++ b/webapp/web/templates/freemarker/body/partials/individual/individual-menu-properties.ftl @@ -0,0 +1,24 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Template for menu management page --> + +<#import "lib-properties.ftl" as p> + +<#list propertyGroups.all as group> + <#assign groupName = group.getName(nameForOtherGroup)> + + <#-- Display the group heading --> + <#if groupName?has_content> +

${groupName?capitalize}

+ + + <#-- List the menu items(properties) in the group --> + <#list group.properties as property> + <#if property.localName == "hasElement"> + <#-- List menu Items --> + <@p.objectProperty property editable property.template /> +
<#--remove break--> + <@p.addLink property editable /> + + + \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl index 779f3bf2f..89d82af59 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl @@ -75,7 +75,11 @@ Assumes property is non-null. --> <#macro objectPropertyList property editable statements=property.statements template=property.template> <#list statements as statement> - <@propertyListItem property statement editable><#include "${template}"> + <#if property.localName == "hasElement"> + <@menuItem property statement editable><#include "${template}"> + <#else> + <@propertyListItem property statement editable><#include "${template}"> + @@ -95,7 +99,11 @@ name will be used as the label. --> <#--@dump var="property"/--> <#local url = property.addUrl> <#if url?has_content> - <@showAddLink property.localName label addParamsToEditUrl(url, extraParams) /> + <#if property.localName == "hasElement"> + <@showAddMenuItemLink property.localName label addParamsToEditUrl(url, extraParams) /> + <#else> + <@showAddLink property.localName label addParamsToEditUrl(url, extraParams) /> + @@ -241,4 +249,12 @@ name will be used as the label. --> <@editingLinks "label" label editable /> +<#-- Add menu item button --> +<#macro showAddMenuItemLink propertyLocalName label url> + Add menu item + +<#-- List menu items --> +<#macro menuItem property statement editable > + Position | <#nested> | <@editingLinks "${property.localName}" statement editable/>
+