From 589cc245a6a4a7649820362f723412ed62a25894 Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 31 Jan 2013 11:14:28 -0500 Subject: [PATCH] multiple updates and new files to support multiple foaf person profile pages --- .../individual/IndividualResponseBuilder.java | 40 ++++ .../individual/individual-property-groups.css | 48 ++++- webapp/web/images/emailIconSmall.gif | Bin 0 -> 64 bytes webapp/web/images/phoneIconSmall.gif | Bin 0 -> 95 bytes .../js/individual/propertyGroupControls.js | 188 ++++++++++++------ .../body/individual/individual-vitro.ftl | 18 +- .../freemarker/body/individual/individual.ftl | 24 +-- .../individual/individual-adminPanel.ftl | 2 +- .../individual/individual-properties.ftl | 112 ++++------- .../individual-property-group-menus.ftl | 53 +++++ .../individual-property-group-tabs.ftl | 65 ++++++ .../freemarker/lib/lib-properties.ftl | 18 +- 12 files changed, 385 insertions(+), 183 deletions(-) create mode 100644 webapp/web/images/emailIconSmall.gif create mode 100644 webapp/web/images/phoneIconSmall.gif create mode 100644 webapp/web/templates/freemarker/body/partials/individual/individual-property-group-menus.ftl create mode 100644 webapp/web/templates/freemarker/body/partials/individual/individual-property-group-tabs.ftl diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualResponseBuilder.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualResponseBuilder.java index a70b56ec2..ac39c3b10 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualResponseBuilder.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualResponseBuilder.java @@ -82,6 +82,7 @@ class IndividualResponseBuilder { body.put("relatedSubject", getRelatedSubject()); body.put("namespaces", namespaces); body.put("temporalVisualizationEnabled", getTemporalVisualizationFlag()); + body.put("profilePageTypesEnabled", getprofilePageTypesFlag()); body.put("verbosePropertySwitch", getVerbosePropertyValues()); //Execute data getters that might apply to this individual, e.g. because of the class of the individual @@ -91,6 +92,13 @@ class IndividualResponseBuilder { log.error("Data retrieval for individual lead to error", ex); } + // for quick profile view - users can toggle between the quick and the full views, + // so the "destination" let's us know which view they are targeting. On normal + // page request, this string is empty and the default template is loaded. + String targetedView = ""; + targetedView = vreq.getParameter("destination"); + body.put("targetedView", targetedView); + //Individual template model IndividualTemplateModel itm = getIndividualTemplateModel(individual); /* We need to expose non-getters in displaying the individual's property list, @@ -100,6 +108,7 @@ class IndividualResponseBuilder { */ // body.put("individual", wrap(itm, BeansWrapper.EXPOSE_SAFE)); body.put("labelCount", getLabelCount(itm.getUri(), vreq)); + body.put("profileType", getProfileType(itm.getUri(), vreq)); body.put("individual", wrap(itm, new ReadOnlyBeansWrapper())); body.put("headContent", getRdfLinkTag(itm)); @@ -169,6 +178,12 @@ class IndividualResponseBuilder { return "enabled".equals(property); } + private boolean getprofilePageTypesFlag() { + String property = ConfigurationProperties.getBean(vreq).getProperty( + "MultiViews.profilePageTypes"); + return "enabled".equals(property); + } + private Map getVerbosePropertyValues() { Map map = null; @@ -275,4 +290,29 @@ class IndividualResponseBuilder { } return theCount; } + + private static String PROFILE_TYPE_QUERY = "" + + "PREFIX display: \n" + + "SELECT ?profile WHERE { \n" + + " ?subject display:hasDefaultProfilePageType ?profile \n" + + "}" ; + + private static String getProfileType(String subjectUri, VitroRequest vreq) { + String queryStr = QueryUtils.subUriForQueryVar(PROFILE_TYPE_QUERY, "subject", subjectUri); + log.debug("queryStr = " + queryStr); + String profileType = "none"; + try { + ResultSet results = QueryUtils.getQueryResults(queryStr, vreq); + if (results.hasNext()) { + QuerySolution soln = results.nextSolution(); + String profileStr = soln.get("profile").toString(); + if ( profileStr.length() > 0 ) { + profileType = profileStr.substring(profileStr.indexOf("#")+1,profileStr.length()); + } + } + } catch (Exception e) { + log.error(e, e); + } + return profileType; + } } diff --git a/webapp/web/css/individual/individual-property-groups.css b/webapp/web/css/individual/individual-property-groups.css index 7edcb4011..b7cc8fa2f 100644 --- a/webapp/web/css/individual/individual-property-groups.css +++ b/webapp/web/css/individual/individual-property-groups.css @@ -5,6 +5,10 @@ span#toggleContainer { padding:10px 8px 0 0; font-size: 0.85em; } +section.property-group { + padding-top: 15px; + border-top:none; +} section.property-group h2 { padding: 8px 10px 4px 12px; } @@ -17,7 +21,7 @@ section.property-group h2 { } section.property-group div { margin-top:15px; - display:none; +/* display:none; */ } section.property-group h2 { font-size: 1.15em !important; @@ -25,8 +29,42 @@ section.property-group h2 { font-weight: normal !important; background: #fafaf9 !important; } -/* this class is referenced in java script; the important is needed to override the color in the previous selector */ -section.property-group h2.expandedPropGroupH2 { - background:#e4ecf3 !important; - color:#2485ae !important; +ul.propertyTabsList { + margin-left: 4px; + margin-top: 24px } +ul.propertyTabsList li { + font-size: 1.0em; +} +ul.propertyTabsList li:first-child { + width: 7px; +} +li.nonSelectedGroupTab { + float:left; + border: 1px solid #DFE6E5; + background-color:#E4ECF3; + padding: 6px 8px 6px 8px; + cursor:pointer; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; +} +li.selectedGroupTab { + float:left; + border: 1px solid #DFE6E5; + border-bottom-color:#fff; + background-color:#FFF; + padding: 6px 8px 6px 8px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; +} +li.groupTabSpacer { + float:left;border-bottom: 1px solid #DFE6E5;background-color:#fff;width:3px;height:37px +} \ No newline at end of file diff --git a/webapp/web/images/emailIconSmall.gif b/webapp/web/images/emailIconSmall.gif new file mode 100644 index 0000000000000000000000000000000000000000..272ee51ac7372a1c4cc70ac8bc7bf95905eb5d5c GIT binary patch literal 64 zcmZ?wbhEHbwc6x=<10~GS}6cQDD t6O$Pff3h$#FfcLbFaQBaHv^MUPyV7=+Itn8Iasn^9t?j!FO!wQ8UUB+AMF4D literal 0 HcmV?d00001 diff --git a/webapp/web/js/individual/propertyGroupControls.js b/webapp/web/js/individual/propertyGroupControls.js index 95cd1644b..6da441d5f 100644 --- a/webapp/web/js/individual/propertyGroupControls.js +++ b/webapp/web/js/individual/propertyGroupControls.js @@ -3,57 +3,65 @@ $(document).ready(function(){ $.extend(this, individualLocalName); - + adjustFontSize(); + padSectionBottoms(); retrieveLocalStorage(); + + // ensures that shorter property group sections don't cause the page to "jump around" + // when the tabs are clicked + function padSectionBottoms() { + $.each($('section.property-group'), function() { + var sectionHeight = $(this).height(); + if ( sectionHeight < 1000 ) { + $(this).css('margin-bottom', 1000-sectionHeight + "px"); + } + }); + } - // expands/collapses the div within each property group - $.each($('section.property-group'), function() { - var groupName = $(this).attr("id"); - $(this).children("nav").children("img").click(function() { - if ( $("div[id='" + groupName + "Group']").is(":visible") ) { - $("div[id='" + groupName + "Group']").slideUp(222); - $(this).attr("src", $(this).attr("src").replace("collapse-prop-group","expand-prop-group")); - $("section#" + groupName).children("h2").removeClass("expandedPropGroupH2"); + // controls the property group tabs + $.each($('li.clickable'), function() { + var groupName = $(this).attr("groupName"); + var $propertyGroupLi = $(this); + + $(this).click(function() { + + if ( $propertyGroupLi.attr("class") == "nonSelectedGroupTab clickable" ) { + $.each($('li.selectedGroupTab'), function() { + $(this).removeClass("selectedGroupTab clickable"); + $(this).addClass("nonSelectedGroupTab clickable"); + }); + $propertyGroupLi.removeClass("nonSelectedGroupTab clickable"); + $propertyGroupLi.addClass("selectedGroupTab clickable"); + } + if ( $propertyGroupLi.text() == "View All" ) { + processViewAllTab(); } else { - $("div[id='" + groupName + "Group']").slideDown(222); - $(this).attr("src", $(this).attr("src").replace("expand-prop-group","collapse-prop-group")); - $("section#" + groupName).children("h2").addClass("expandedPropGroupH2"); + padSectionBottoms(); + var $visibleSection = $('section.property-group:visible'); + $visibleSection.hide(); + $('h2[pgroup=tabs]').addClass("hidden"); + $('nav#scroller').addClass("hidden"); + $('section#' + groupName).show(); } manageLocalStorage(); + return false; }); }); - - - // expands/collapses all property groups together - $.each($('a#propertyGroupsToggle'), function() { - $('a#propertyGroupsToggle').click(function() { - var anchorHtml = $(this).html(); - if ( anchorHtml.indexOf('expand') > -1 ) { - $.each($('section.property-group'), function() { - $("div[id='" + $(this).attr("id") + "Group']").slideDown(222); - var innerSrc = $(this).children("nav").children("img").attr("src"); - $(this).children("nav").children("img").attr("src",innerSrc.replace("expand-prop-group","collapse-prop-group")); - $(this).children("h2").addClass("expandedPropGroupH2"); - }); - $(this).html("collapse all"); - } - else { - $.each($('section.property-group'), function() { - $("div[id='" + $(this).attr("id") + "Group']").slideUp(222); - var innerSrc = $(this).children("nav").children("img").attr("src"); - $(this).children("nav").children("img").attr("src",innerSrc.replace("collapse-prop-group","expand-prop-group")); - $(this).children("h2").removeClass("expandedPropGroupH2"); - }); - $(this).html("expand all"); - } - manageLocalStorage(); - }); - }); + + function processViewAllTab() { + $.each($('section.property-group'), function() { + $(this).css("margin-bottom", "1px"); + $(this).children('h2').css("margin-top", "-15px").css("border-bottom","1px solid #DFEBE5").css("padding","12px 25px 10px 20px"); + $(this).show(); + $('h2[pgroup=tabs]').removeClass("hidden"); + $('nav#scroller').removeClass("hidden"); + }); + } - // Next two functions -- keep track of which property group tabs have been expanded, + // Next two functions -- keep track of which property group tab was selected, // so if we return from a custom form or a related individual, even via the back button, - // the property groups will be expanded as before. + // the same property group will be selected as before. function manageLocalStorage() { var localName = this.individualLocalName; // is this individual already stored? If not, how many have been stored? @@ -78,13 +86,9 @@ $(document).ready(function(){ amplify.store("profiles", profiles) } } - var groups = []; - $.each($('section.property-group').children("nav").children("img"), function() { - if ( $(this).attr('src').indexOf('collapse-prop-group') > -1 ) { - groups.push($(this).attr('groupName')); - } - }); - amplify.store(localName, groups); + var selectedTab = []; + selectedTab.push($('li.selectedGroupTab').attr('groupName')); + amplify.store(localName, selectedTab); var checkLength = amplify.store(localName); if ( checkLength.length == 0 ) { amplify.store(localName, null); @@ -93,23 +97,81 @@ $(document).ready(function(){ function retrieveLocalStorage() { var localName = this.individualLocalName; - var groups = amplify.store(individualLocalName); - if ( groups != undefined ) { - for ( i = 0; i < groups.length; i++) { - var groupName = groups[i]; - // unlikely, but it's possible a group that was previously opened and stored won't be displayed - // because the object properties would have been deleted. So ensure that the group in local - // storage has been rendered on the page. More likely, a user navigated from a quick view to a full - // profile, opened a group, then navigated back to the quick view where the group isn't rendered. - if ($("section#" + groupName).length ) { - $("div[id='" + groupName + "Group']").slideDown(1); - $("img[groupName='" + groupName + "']").attr("src", $("img[groupName='" + groupName + "']").attr("src").replace("expand-prop-group","collapse-prop-group")); - $("section#" + groupName).children("h2").addClass("expandedPropGroupH2"); + var selectedTab = amplify.store(individualLocalName); + + if ( selectedTab != undefined ) { + var groupName = selectedTab[0]; + + // unlikely, but it's possible a tab that was previously selected and stored won't be displayed + // because the object properties would have been deleted (in non-edit mode). So ensure that the tab in local + // storage has been rendered on the page. + if ( $("ul.propertyTabsList li[groupName='" + groupName + "']").length ) { + // if the selected tab is the default first one, don't do anything + if ( $('li.clickable').first().attr("groupName") != groupName ) { + // deselect the default first tab + var $firstTab = $('li.clickable').first(); + $firstTab.removeClass("selectedGroupTab clickable"); + $firstTab.addClass("nonSelectedGroupTab clickable"); + // select the stored tab + $("li[groupName='" + groupName + "']").removeClass("nonSelectedGroupTab clickable"); + $("li[groupName='" + groupName + "']").addClass("selectedGroupTab clickable"); + // hide the first tab section + $('section.property-group:visible').hide(); + + if ( groupName == "viewAll" ) { + processViewAllTab(); } - } - if ( groups.length == $('section.property-group').length ) { - $('a#propertyGroupsToggle').html('collapse all'); + + // show the selected tab section + $('section#' + groupName).show(); } } } + } + // if there are so many tabs that they wrap to a second line, adjust the font size to + //prevent wrapping + function adjustFontSize() { + var width = 0; + $('ul.propertyTabsList li').each(function() { + width += $(this).outerWidth(); + }); + if ( width < 922 ) { + var diff = 926-width; + $('ul.propertyTabsList li:last-child').css('width', diff + 'px'); + } + else { + var diff = width-926; + if ( diff < 26 ) { + $('ul.propertyTabsList li').css('font-size', "0.96em"); + } + else if ( diff > 26 && diff < 50 ) { + $('ul.propertyTabsList li').css('font-size', "0.92em"); + } + else if ( diff > 50 && diff < 80 ) { + $('ul.propertyTabsList li').css('font-size', "0.9em"); + } + else if ( diff > 80 && diff < 130 ) { + $('ul.propertyTabsList li').css('font-size', "0.84em"); + } + else if ( diff > 130 && diff < 175 ) { + $('ul.propertyTabsList li').css('font-size', "0.8em"); + } + else if ( diff > 175 && diff < 260 ) { + $('ul.propertyTabsList li').css('font-size', "0.73em"); + } + else { + $('ul.propertyTabsList li').css('font-size', "0.7em"); + } + + // get the new width + var newWidth = 0 + $('ul.propertyTabsList li').each(function() { + newWidth += $(this).outerWidth(); + }); + var newDiff = 926-newWidth; + $('ul.propertyTabsList li:last-child').css('width', newDiff + 'px'); + } + } }); + + diff --git a/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl b/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl index 5811a727f..acb076fb3 100644 --- a/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl +++ b/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl @@ -6,7 +6,7 @@ <#-- Default individual profile page template --> <#--@dumpAll /-->
- <#-- Image --> + <#assign individualImage> <@p.image individual=individual propertyGroups=propertyGroups @@ -48,16 +48,18 @@ <#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl --> -<#-- Property group menu --> -<#-- With release 1.6 the property group is no longer used. The include statement - remains in the event a particular VIVO site still wants to use it with the new - collapsible groups. + +<#-- + With release 1.6 there are now two types of property group displays: the original property group + menu and the horizontal tab display, which is the default. If you prefer to use the property + group menu, simply substitute the include statement below with the one that appears after this + comment section. - <#include "individual-propertyGroupMenu.ftl"> + <#include "individual-property-group-menus.ftl"> --> -<#-- Ontology properties --> -<#include "individual-properties.ftl"> +<#include "individual-property-group-tabs.ftl"> + diff --git a/webapp/web/templates/freemarker/body/individual/individual.ftl b/webapp/web/templates/freemarker/body/individual/individual.ftl index c76ed4da5..62d979b8e 100644 --- a/webapp/web/templates/freemarker/body/individual/individual.ftl +++ b/webapp/web/templates/freemarker/body/individual/individual.ftl @@ -1,27 +1,7 @@ <#-- $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) --> +<#-- Default individual profile page template --> <#include "individual-setup.ftl"> -<#import "lib-vivo-properties.ftl" as vp> -<#assign individualProductExtension> - <#-- Include for any class specific template additions --> - ${classSpecificExtension!} - <@vp.webpages propertyGroups editable /> - - <#include "individual-overview.ftl"> -
- - - - -<#include "individual-vitro.ftl"> - -${stylesheets.add('', - '')} - -${headScripts.add('', - '')} -${scripts.add('', - '')} +<#include "individual-vitro.ftl"> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/partials/individual/individual-adminPanel.ftl b/webapp/web/templates/freemarker/body/partials/individual/individual-adminPanel.ftl index 175269b54..3dcca64cc 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/individual-adminPanel.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/individual-adminPanel.ftl @@ -6,7 +6,7 @@ <#if individual.showAdminPanel>
-

Admin Panel

Edit this individual +

Admin Panel

Edit this individual
<#if verbosePropertySwitch?has_content> diff --git a/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl index 9f0a0e643..48ceefded 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl @@ -2,83 +2,39 @@ <#-- Template for property listing on individual profile page --> -<#import "lib-properties.ftl" as p> -<#assign subjectUri = individual.controlPanelUrl()?split("=") > - -<#if ( propertyGroups.all?size > 1 ) > - - expand all - -<#else> -


- -<#list propertyGroups.all as group> - <#assign groupName = group.getName(nameForOtherGroup)> - <#assign verbose = (verbosePropertySwitch.currentValue)!false> - <#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) > - <#else> - <#assign groupName = "Properties"> - <#assign groupNameHtmlId = "properties" > - - -
- - - <#-- Display the group heading --> -

${groupName?capitalize}

- - <#-- List the properties in the group --> -
- <#list group.properties as property> -
- <#-- Property display name --> - <#if property.localName == "authorInAuthorship" && editable > -

${property.name} <@p.addLink property editable /> <@p.verboseDisplay property /> - style="padding-top:10px" > - manage publications - -

- <#elseif property.localName == "hasResearcherRole" && editable > -

${property.name} <@p.addLink property editable /> <@p.verboseDisplay property /> - style="padding-top:10px" > - manage grants & projects - -

- <#elseif property.localName == "organizationForPosition" && editable > -

${property.name} <@p.addLink property editable /> <@p.verboseDisplay property /> - style="padding-top:10px" > - manage affiliated people - -

+ <#list group.properties as property> +
+ <#-- Property display name --> + <#if property.localName == "authorInAuthorship" && editable > +

${property.name} <@p.addLink property editable /> <@p.verboseDisplay property /> + style="padding-top:10px" > + manage publications + +

+ <#elseif property.localName == "hasResearcherRole" && editable > +

${property.name} <@p.addLink property editable /> <@p.verboseDisplay property /> + style="padding-top:10px" > + manage grants & projects + +

+ <#elseif property.localName == "organizationForPosition" && editable > +

${property.name} <@p.addLink property editable /> <@p.verboseDisplay property /> + style="padding-top:10px" > + manage affiliated people + +

+ <#else> +

${property.name} <@p.addLink property editable /> <@p.verboseDisplay property />

+ + <#-- List the statements for each property --> +
    + <#-- data property --> + <#if property.type == "data"> + <@p.dataPropertyList property editable /> + <#-- object property --> <#else> -

    ${property.name} <@p.addLink property editable /> <@p.verboseDisplay property />

    + <@p.objectProperty property editable /> - <#-- List the statements for each property --> -
      - <#-- data property --> - <#if property.type == "data"> - <@p.dataPropertyList property editable /> - <#-- object property --> - <#else> - <@p.objectProperty property editable /> - -
    -
- -
-
- - \ No newline at end of file + + + diff --git a/webapp/web/templates/freemarker/body/partials/individual/individual-property-group-menus.ftl b/webapp/web/templates/freemarker/body/partials/individual/individual-property-group-menus.ftl new file mode 100644 index 000000000..8d5b013dc --- /dev/null +++ b/webapp/web/templates/freemarker/body/partials/individual/individual-property-group-menus.ftl @@ -0,0 +1,53 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Template for property listing on individual profile page --> + +<#import "lib-properties.ftl" as p> +<#assign subjectUri = individual.controlPanelUrl()?split("=") > +<#assign nameForOtherGroup = nameForOtherGroup!"other"> + +<#if (propertyGroups.all)??> + <#assign groups = propertyGroups.all> + <#if groups?has_content> + <#if (groups?size > 1) || (groups?first).getName(nameForOtherGroup)?has_content> + + + + +<#list propertyGroups.all as group> + <#assign groupName = group.getName(nameForOtherGroup)> + <#assign verbose = (verbosePropertySwitch.currentValue)!false> + +
+ + + <#-- Display the group heading --> + <#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}

+ <#else> +

Properties

+ + + <#-- List the properties in the group --> + <#include "individual-properties.ftl"> +
+ diff --git a/webapp/web/templates/freemarker/body/partials/individual/individual-property-group-tabs.ftl b/webapp/web/templates/freemarker/body/partials/individual/individual-property-group-tabs.ftl new file mode 100644 index 000000000..eb43419ca --- /dev/null +++ b/webapp/web/templates/freemarker/body/partials/individual/individual-property-group-tabs.ftl @@ -0,0 +1,65 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Template for property listing on individual profile page --> + +<#import "lib-properties.ftl" as p> +<#assign subjectUri = individual.controlPanelUrl()?split("=") > +<#assign tabCount = 1 > +<#assign sectionCount = 1 > + +
    +
  •  
  • +<#list propertyGroups.all as groupTabs> + <#assign groupName = groupTabs.getName(nameForOtherGroup)> + <#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) > + <#else> + <#assign groupName = "Properties"> + <#assign groupNameHtmlId = "properties" > + + <#if tabCount = 1 > +
  • ${groupName?capitalize}
  • +
  •  
  • + <#assign tabCount = 2> + <#else> +
  • ${groupName?capitalize}
  • +
  •  
  • + + +<#if (propertyGroups.all?size > 1) > +
  • View All
  • +
  •  
  • + +
+<#list propertyGroups.all as group> + <#assign groupName = group.getName(nameForOtherGroup)> + <#assign groupNameHtmlId = p.createPropertyGroupHtmlId(groupName) > + <#assign verbose = (verbosePropertySwitch.currentValue)!false> +
+ + + <#-- Display the group heading --> + <#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) > + + <#else> + + +
+ <#-- List the properties in the group --> + <#include "individual-properties.ftl"> +
+
+<#assign sectionCount = 2 > + + +${stylesheets.add('')} +${headScripts.add('')} +${scripts.add('')} + diff --git a/webapp/web/templates/freemarker/lib/lib-properties.ftl b/webapp/web/templates/freemarker/lib/lib-properties.ftl index 2d982b7fc..8dd2bd355 100644 --- a/webapp/web/templates/freemarker/lib/lib-properties.ftl +++ b/webapp/web/templates/freemarker/lib/lib-properties.ftl @@ -74,7 +74,7 @@ Assumes property is non-null. --> <#macro objectPropertyListing property editable template=property.template> <#local localName = property.localName> -

${property.name?capitalize} <@addLink property editable /> <@verboseDisplay property />

+

${property.name?capitalize} <@addLink property editable /> <@verboseDisplay property />

    <@objectProperty property editable />
@@ -188,21 +188,21 @@ name will be used as the label. --> Note that this macro has a side-effect in the call to propertyGroups.pullProperty(). --> -<#macro image individual propertyGroups namespaces editable showPlaceholder="never"> +<#macro image individual propertyGroups namespaces editable showPlaceholder="never" imageWidth=160 > <#local mainImage = propertyGroups.pullProperty("${namespaces.vitroPublic}mainImage")!> <#local thumbUrl = individual.thumbUrl!> <#-- Don't assume that if the mainImage property is populated, there is a thumbnail image (though that is the general case). If there's a mainImage statement but no thumbnail image, treat it as if there is no image. --> <#if (mainImage.statements)?has_content && thumbUrl?has_content> - ${individual.name} + ${individual.name} <@editingLinks "${mainImage.localName}" mainImage.first() editable /> <#else> <#local imageLabel><@addLinkWithLabel mainImage editable "Photo" /> ${imageLabel} <#if showPlaceholder == "always" || (showPlaceholder="with_add_link" && imageLabel?has_content)> - placeholder image + placeholder image @@ -213,7 +213,7 @@ name will be used as the label. --> ${label.value} <#if (labelCount > 1) && editable > - + manage labels @@ -223,12 +223,18 @@ name will be used as the label. --> <#-- Most specific types --> -<#macro mostSpecificTypes individual> +<#macro mostSpecificTypes individual > <#list individual.mostSpecificTypes as type> ${type} +<#macro mostSpecificTypesPerson individual editable> + <#list individual.mostSpecificTypes as type> +
${type}
+ + + <#--Property group names may have spaces in them, replace spaces with underscores for html id/hash--> <#function createPropertyGroupHtmlId propertyGroupName> <#return propertyGroupName?replace(" ", "_")>