multiple updates and new files to support multiple foaf person profile pages
This commit is contained in:
parent
b6bab121c5
commit
589cc245a6
12 changed files with 385 additions and 183 deletions
|
@ -82,6 +82,7 @@ class IndividualResponseBuilder {
|
||||||
body.put("relatedSubject", getRelatedSubject());
|
body.put("relatedSubject", getRelatedSubject());
|
||||||
body.put("namespaces", namespaces);
|
body.put("namespaces", namespaces);
|
||||||
body.put("temporalVisualizationEnabled", getTemporalVisualizationFlag());
|
body.put("temporalVisualizationEnabled", getTemporalVisualizationFlag());
|
||||||
|
body.put("profilePageTypesEnabled", getprofilePageTypesFlag());
|
||||||
body.put("verbosePropertySwitch", getVerbosePropertyValues());
|
body.put("verbosePropertySwitch", getVerbosePropertyValues());
|
||||||
|
|
||||||
//Execute data getters that might apply to this individual, e.g. because of the class of the individual
|
//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);
|
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
|
//Individual template model
|
||||||
IndividualTemplateModel itm = getIndividualTemplateModel(individual);
|
IndividualTemplateModel itm = getIndividualTemplateModel(individual);
|
||||||
/* We need to expose non-getters in displaying the individual's property list,
|
/* 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("individual", wrap(itm, BeansWrapper.EXPOSE_SAFE));
|
||||||
body.put("labelCount", getLabelCount(itm.getUri(), vreq));
|
body.put("labelCount", getLabelCount(itm.getUri(), vreq));
|
||||||
|
body.put("profileType", getProfileType(itm.getUri(), vreq));
|
||||||
body.put("individual", wrap(itm, new ReadOnlyBeansWrapper()));
|
body.put("individual", wrap(itm, new ReadOnlyBeansWrapper()));
|
||||||
|
|
||||||
body.put("headContent", getRdfLinkTag(itm));
|
body.put("headContent", getRdfLinkTag(itm));
|
||||||
|
@ -169,6 +178,12 @@ class IndividualResponseBuilder {
|
||||||
return "enabled".equals(property);
|
return "enabled".equals(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean getprofilePageTypesFlag() {
|
||||||
|
String property = ConfigurationProperties.getBean(vreq).getProperty(
|
||||||
|
"MultiViews.profilePageTypes");
|
||||||
|
return "enabled".equals(property);
|
||||||
|
}
|
||||||
|
|
||||||
private Map<String, Object> getVerbosePropertyValues() {
|
private Map<String, Object> getVerbosePropertyValues() {
|
||||||
Map<String, Object> map = null;
|
Map<String, Object> map = null;
|
||||||
|
|
||||||
|
@ -275,4 +290,29 @@ class IndividualResponseBuilder {
|
||||||
}
|
}
|
||||||
return theCount;
|
return theCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String PROFILE_TYPE_QUERY = ""
|
||||||
|
+ "PREFIX display: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> \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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,10 @@ span#toggleContainer {
|
||||||
padding:10px 8px 0 0;
|
padding:10px 8px 0 0;
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
}
|
}
|
||||||
|
section.property-group {
|
||||||
|
padding-top: 15px;
|
||||||
|
border-top:none;
|
||||||
|
}
|
||||||
section.property-group h2 {
|
section.property-group h2 {
|
||||||
padding: 8px 10px 4px 12px;
|
padding: 8px 10px 4px 12px;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +21,7 @@ section.property-group h2 {
|
||||||
}
|
}
|
||||||
section.property-group div {
|
section.property-group div {
|
||||||
margin-top:15px;
|
margin-top:15px;
|
||||||
display:none;
|
/* display:none; */
|
||||||
}
|
}
|
||||||
section.property-group h2 {
|
section.property-group h2 {
|
||||||
font-size: 1.15em !important;
|
font-size: 1.15em !important;
|
||||||
|
@ -25,8 +29,42 @@ section.property-group h2 {
|
||||||
font-weight: normal !important;
|
font-weight: normal !important;
|
||||||
background: #fafaf9 !important;
|
background: #fafaf9 !important;
|
||||||
}
|
}
|
||||||
/* this class is referenced in java script; the important is needed to override the color in the previous selector */
|
ul.propertyTabsList {
|
||||||
section.property-group h2.expandedPropGroupH2 {
|
margin-left: 4px;
|
||||||
background:#e4ecf3 !important;
|
margin-top: 24px
|
||||||
color:#2485ae !important;
|
}
|
||||||
|
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
|
||||||
}
|
}
|
BIN
webapp/web/images/emailIconSmall.gif
Normal file
BIN
webapp/web/images/emailIconSmall.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 64 B |
BIN
webapp/web/images/phoneIconSmall.gif
Normal file
BIN
webapp/web/images/phoneIconSmall.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 B |
|
@ -3,57 +3,65 @@
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
$.extend(this, individualLocalName);
|
$.extend(this, individualLocalName);
|
||||||
|
adjustFontSize();
|
||||||
|
padSectionBottoms();
|
||||||
retrieveLocalStorage();
|
retrieveLocalStorage();
|
||||||
|
|
||||||
// expands/collapses the div within each property group
|
// 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() {
|
$.each($('section.property-group'), function() {
|
||||||
var groupName = $(this).attr("id");
|
var sectionHeight = $(this).height();
|
||||||
$(this).children("nav").children("img").click(function() {
|
if ( sectionHeight < 1000 ) {
|
||||||
if ( $("div[id='" + groupName + "Group']").is(":visible") ) {
|
$(this).css('margin-bottom', 1000-sectionHeight + "px");
|
||||||
$("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 {
|
else {
|
||||||
$("div[id='" + groupName + "Group']").slideDown(222);
|
padSectionBottoms();
|
||||||
$(this).attr("src", $(this).attr("src").replace("expand-prop-group","collapse-prop-group"));
|
var $visibleSection = $('section.property-group:visible');
|
||||||
$("section#" + groupName).children("h2").addClass("expandedPropGroupH2");
|
$visibleSection.hide();
|
||||||
|
$('h2[pgroup=tabs]').addClass("hidden");
|
||||||
|
$('nav#scroller').addClass("hidden");
|
||||||
|
$('section#' + groupName).show();
|
||||||
}
|
}
|
||||||
manageLocalStorage();
|
manageLocalStorage();
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function processViewAllTab() {
|
||||||
// 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() {
|
$.each($('section.property-group'), function() {
|
||||||
$("div[id='" + $(this).attr("id") + "Group']").slideDown(222);
|
$(this).css("margin-bottom", "1px");
|
||||||
var innerSrc = $(this).children("nav").children("img").attr("src");
|
$(this).children('h2').css("margin-top", "-15px").css("border-bottom","1px solid #DFEBE5").css("padding","12px 25px 10px 20px");
|
||||||
$(this).children("nav").children("img").attr("src",innerSrc.replace("expand-prop-group","collapse-prop-group"));
|
$(this).show();
|
||||||
$(this).children("h2").addClass("expandedPropGroupH2");
|
$('h2[pgroup=tabs]').removeClass("hidden");
|
||||||
|
$('nav#scroller').removeClass("hidden");
|
||||||
});
|
});
|
||||||
$(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();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 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,
|
// 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() {
|
function manageLocalStorage() {
|
||||||
var localName = this.individualLocalName;
|
var localName = this.individualLocalName;
|
||||||
// is this individual already stored? If not, how many have been stored?
|
// is this individual already stored? If not, how many have been stored?
|
||||||
|
@ -78,13 +86,9 @@ $(document).ready(function(){
|
||||||
amplify.store("profiles", profiles)
|
amplify.store("profiles", profiles)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var groups = [];
|
var selectedTab = [];
|
||||||
$.each($('section.property-group').children("nav").children("img"), function() {
|
selectedTab.push($('li.selectedGroupTab').attr('groupName'));
|
||||||
if ( $(this).attr('src').indexOf('collapse-prop-group') > -1 ) {
|
amplify.store(localName, selectedTab);
|
||||||
groups.push($(this).attr('groupName'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
amplify.store(localName, groups);
|
|
||||||
var checkLength = amplify.store(localName);
|
var checkLength = amplify.store(localName);
|
||||||
if ( checkLength.length == 0 ) {
|
if ( checkLength.length == 0 ) {
|
||||||
amplify.store(localName, null);
|
amplify.store(localName, null);
|
||||||
|
@ -93,23 +97,81 @@ $(document).ready(function(){
|
||||||
|
|
||||||
function retrieveLocalStorage() {
|
function retrieveLocalStorage() {
|
||||||
var localName = this.individualLocalName;
|
var localName = this.individualLocalName;
|
||||||
var groups = amplify.store(individualLocalName);
|
var selectedTab = amplify.store(individualLocalName);
|
||||||
if ( groups != undefined ) {
|
|
||||||
for ( i = 0; i < groups.length; i++) {
|
if ( selectedTab != undefined ) {
|
||||||
var groupName = groups[i];
|
var groupName = selectedTab[0];
|
||||||
// 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
|
// unlikely, but it's possible a tab that was previously selected and stored won't be displayed
|
||||||
// storage has been rendered on the page. More likely, a user navigated from a quick view to a full
|
// because the object properties would have been deleted (in non-edit mode). So ensure that the tab in local
|
||||||
// profile, opened a group, then navigated back to the quick view where the group isn't rendered.
|
// storage has been rendered on the page.
|
||||||
if ($("section#" + groupName).length ) {
|
if ( $("ul.propertyTabsList li[groupName='" + groupName + "']").length ) {
|
||||||
$("div[id='" + groupName + "Group']").slideDown(1);
|
// if the selected tab is the default first one, don't do anything
|
||||||
$("img[groupName='" + groupName + "']").attr("src", $("img[groupName='" + groupName + "']").attr("src").replace("expand-prop-group","collapse-prop-group"));
|
if ( $('li.clickable').first().attr("groupName") != groupName ) {
|
||||||
$("section#" + groupName).children("h2").addClass("expandedPropGroupH2");
|
// 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
// show the selected tab section
|
||||||
|
$('section#' + groupName).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( groups.length == $('section.property-group').length ) {
|
|
||||||
$('a#propertyGroupsToggle').html('collapse all');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 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');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<#-- Default individual profile page template -->
|
<#-- Default individual profile page template -->
|
||||||
<#--@dumpAll /-->
|
<#--@dumpAll /-->
|
||||||
<section id="individual-intro" class="vcard" role="region">
|
<section id="individual-intro" class="vcard" role="region">
|
||||||
<#-- Image -->
|
<!-- Image -->
|
||||||
<#assign individualImage>
|
<#assign individualImage>
|
||||||
<@p.image individual=individual
|
<@p.image individual=individual
|
||||||
propertyGroups=propertyGroups
|
propertyGroups=propertyGroups
|
||||||
|
@ -48,16 +48,18 @@
|
||||||
|
|
||||||
<#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl -->
|
<#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl -->
|
||||||
|
|
||||||
<#-- Property group menu -->
|
<!-- Property group menu or tabs -->
|
||||||
<#-- 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
|
With release 1.6 there are now two types of property group displays: the original property group
|
||||||
collapsible groups.
|
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-property-group-tabs.ftl">
|
||||||
<#include "individual-properties.ftl">
|
|
||||||
<script>
|
<script>
|
||||||
var individualLocalName = "${individual.localName}";
|
var individualLocalName = "${individual.localName}";
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,27 +1,7 @@
|
||||||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
<#-- $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">
|
<#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 />
|
|
||||||
<!--PREINDIVIDUAL OVERVIEW.FTL-->
|
|
||||||
<#include "individual-overview.ftl">
|
|
||||||
</section> <!-- #individual-info -->
|
|
||||||
</section> <!-- #individual-intro -->
|
|
||||||
<!--postindiviudal overiew tfl-->
|
|
||||||
</#assign>
|
|
||||||
|
|
||||||
<#include "individual-vitro.ftl">
|
<#include "individual-vitro.ftl">
|
||||||
|
|
||||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/individual/individual-vivo.css" />',
|
|
||||||
'<link rel="stylesheet" href="${urls.base}/css/individual/individual-property-groups.css" />')}
|
|
||||||
|
|
||||||
${headScripts.add('<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.truncator.js"></script>',
|
|
||||||
'<script type="text/javascript" src="${urls.base}/js/amplify/amplify.store.min.js"></script>')}
|
|
||||||
${scripts.add('<script type="text/javascript" src="${urls.base}/js/individual/individualUtils.js"></script>',
|
|
||||||
'<script type="text/javascript" src="${urls.base}/js/individual/propertyGroupControls.js"></script>')}
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<#if individual.showAdminPanel>
|
<#if individual.showAdminPanel>
|
||||||
<section id="admin">
|
<section id="admin">
|
||||||
<h3>Admin Panel</h3><a class="edit-individual" href="${individual.controlPanelUrl()}" title="edit this individual">Edit this individual</a>
|
<h3 id="adminPanel">Admin Panel</h3><a class="edit-individual" href="${individual.controlPanelUrl()}" title="edit this individual">Edit this individual</a>
|
||||||
|
|
||||||
<section id = "verbose-mode">
|
<section id = "verbose-mode">
|
||||||
<#if verbosePropertySwitch?has_content>
|
<#if verbosePropertySwitch?has_content>
|
||||||
|
|
|
@ -2,37 +2,6 @@
|
||||||
|
|
||||||
<#-- Template for property listing on individual profile page -->
|
<#-- Template for property listing on individual profile page -->
|
||||||
|
|
||||||
<#import "lib-properties.ftl" as p>
|
|
||||||
<#assign subjectUri = individual.controlPanelUrl()?split("=") >
|
|
||||||
|
|
||||||
<#if ( propertyGroups.all?size > 1 ) >
|
|
||||||
<span id="toggleContainer">
|
|
||||||
<a id="propertyGroupsToggle" href="javascript:" title="expand all groups">expand all</a>
|
|
||||||
</span>
|
|
||||||
<#else>
|
|
||||||
<p style="clear:both"><br /></p>
|
|
||||||
</#if>
|
|
||||||
<#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" >
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<section id="${groupNameHtmlId}" class="property-group" role="region">
|
|
||||||
<nav class="scroll-up" role="navigation">
|
|
||||||
<img src="${urls.images}/individual/expand-prop-group.png" groupName="${groupNameHtmlId}" alt="expand property group" title="expand this property group"/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<#-- Display the group heading -->
|
|
||||||
<h2 id="${groupNameHtmlId}">${groupName?capitalize}</h2>
|
|
||||||
|
|
||||||
<#-- List the properties in the group -->
|
|
||||||
<div id="${groupNameHtmlId}Group" >
|
|
||||||
<#list group.properties as property>
|
<#list group.properties as property>
|
||||||
<article class="property" role="article">
|
<article class="property" role="article">
|
||||||
<#-- Property display name -->
|
<#-- Property display name -->
|
||||||
|
@ -69,16 +38,3 @@
|
||||||
</ul>
|
</ul>
|
||||||
</article> <!-- end property -->
|
</article> <!-- end property -->
|
||||||
</#list>
|
</#list>
|
||||||
</div>
|
|
||||||
</section> <!-- end property-group -->
|
|
||||||
</#list>
|
|
||||||
<script>
|
|
||||||
var propGroupCount = ${propertyGroups.all?size};
|
|
||||||
if ( propGroupCount == 1 ) {
|
|
||||||
$('section.property-group').find('div').show();
|
|
||||||
$('section.property-group').find("h2").addClass("expandedPropGroupH2");
|
|
||||||
$('section.property-group').children("nav").children("img").hide();
|
|
||||||
// var innerSrc = $('section.property-group').children("nav").children("img").attr("src");
|
|
||||||
// $('section.property-group').children("nav").children("img").attr("src",innerSrc.replace("expand-prop-group","collapse-prop-group"));
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -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>
|
||||||
|
<nav id="property-group-menu" role="navigation">
|
||||||
|
<ul role="list">
|
||||||
|
<#list groups as group>
|
||||||
|
<#assign groupname = group.getName(nameForOtherGroup)>
|
||||||
|
<#if groupname?has_content>
|
||||||
|
<#--create property group html id is the function that will replace all spaces with underscore to make a valid id-->
|
||||||
|
<#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. -->
|
||||||
|
<li role="listitem"><a href="#${groupnameHtmlId}" title="group name">${groupname?capitalize}</a></li>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
<#list propertyGroups.all as group>
|
||||||
|
<#assign groupName = group.getName(nameForOtherGroup)>
|
||||||
|
<#assign verbose = (verbosePropertySwitch.currentValue)!false>
|
||||||
|
|
||||||
|
<section class="property-group" role="region">
|
||||||
|
<nav class="scroll-up" role="navigation">
|
||||||
|
<a href="#branding" title="scroll up">
|
||||||
|
<img src="${urls.images}/individual/scroll-up.gif" alt="scroll to property group menus" />
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<#-- 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) >
|
||||||
|
<h2 id="${groupNameHtmlId}">${groupName?capitalize}</h2>
|
||||||
|
<#else>
|
||||||
|
<h2 id="properties">Properties</h2>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#-- List the properties in the group -->
|
||||||
|
<#include "individual-properties.ftl">
|
||||||
|
</section> <!-- end property-group -->
|
||||||
|
</#list>
|
|
@ -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 >
|
||||||
|
<!-- ${propertyGroups.all?size} -->
|
||||||
|
<ul class="propertyTabsList">
|
||||||
|
<li class="groupTabSpacer"> </li>
|
||||||
|
<#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>
|
||||||
|
<#if tabCount = 1 >
|
||||||
|
<li class="selectedGroupTab clickable" groupName="${groupNameHtmlId}">${groupName?capitalize}</li>
|
||||||
|
<li class="groupTabSpacer"> </li>
|
||||||
|
<#assign tabCount = 2>
|
||||||
|
<#else>
|
||||||
|
<li class="nonSelectedGroupTab clickable" groupName="${groupNameHtmlId}">${groupName?capitalize}</li>
|
||||||
|
<li class="groupTabSpacer"> </li>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
<#if (propertyGroups.all?size > 1) >
|
||||||
|
<li class="nonSelectedGroupTab clickable" groupName="viewAll">View All</li>
|
||||||
|
<li class="groupTabSpacer"> </li>
|
||||||
|
</#if>
|
||||||
|
</ul>
|
||||||
|
<#list propertyGroups.all as group>
|
||||||
|
<#assign groupName = group.getName(nameForOtherGroup)>
|
||||||
|
<#assign groupNameHtmlId = p.createPropertyGroupHtmlId(groupName) >
|
||||||
|
<#assign verbose = (verbosePropertySwitch.currentValue)!false>
|
||||||
|
<section id="${groupNameHtmlId}" class="property-group" role="region" style="<#if (sectionCount > 1) >display:none<#else>display:block</#if>">
|
||||||
|
<nav id="scroller" class="scroll-up hidden" role="navigation">
|
||||||
|
<a href="#branding" title="scroll up" >
|
||||||
|
<img src="${urls.images}/individual/scroll-up.gif" alt="scroll to property group menus" />
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<#-- 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) >
|
||||||
|
<h2 id="${groupNameHtmlId}" pgroup="tabs" class="hidden">${groupName?capitalize}</h2>
|
||||||
|
<#else>
|
||||||
|
<h2 id="properties" pgroup="tabs" class="hidden">Properties</h2>
|
||||||
|
</#if>
|
||||||
|
<div id="${groupNameHtmlId}Group" >
|
||||||
|
<#-- List the properties in the group -->
|
||||||
|
<#include "individual-properties.ftl">
|
||||||
|
</div>
|
||||||
|
</section> <!-- end property-group -->
|
||||||
|
<#assign sectionCount = 2 >
|
||||||
|
</#list>
|
||||||
|
|
||||||
|
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/individual/individual-property-groups.css" />')}
|
||||||
|
${headScripts.add('<script type="text/javascript" src="${urls.base}/js/amplify/amplify.store.min.js"></script>')}
|
||||||
|
${scripts.add('<script type="text/javascript" src="${urls.base}/js/individual/propertyGroupControls.js"></script>')}
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
Assumes property is non-null. -->
|
Assumes property is non-null. -->
|
||||||
<#macro objectPropertyListing property editable template=property.template>
|
<#macro objectPropertyListing property editable template=property.template>
|
||||||
<#local localName = property.localName>
|
<#local localName = property.localName>
|
||||||
<h2 id="${localName}">${property.name?capitalize} <@addLink property editable /> <@verboseDisplay property /></h2>
|
<h2 id="${localName}" class="mainPropGroup">${property.name?capitalize} <@addLink property editable /> <@verboseDisplay property /></h2>
|
||||||
<ul id="individual-${localName}" role="list">
|
<ul id="individual-${localName}" role="list">
|
||||||
<@objectProperty property editable />
|
<@objectProperty property editable />
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -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().
|
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 mainImage = propertyGroups.pullProperty("${namespaces.vitroPublic}mainImage")!>
|
||||||
<#local thumbUrl = individual.thumbUrl!>
|
<#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).
|
<#-- 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 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>
|
<#if (mainImage.statements)?has_content && thumbUrl?has_content>
|
||||||
<a href="${individual.imageUrl}" title="individual photo">
|
<a href="${individual.imageUrl}" title="individual photo">
|
||||||
<img class="individual-photo" src="${thumbUrl}" title="click to view larger image" alt="${individual.name}" width="160" />
|
<img class="individual-photo" src="${thumbUrl}" title="click to view larger image" alt="${individual.name}" width="${imageWidth!}" />
|
||||||
</a>
|
</a>
|
||||||
<@editingLinks "${mainImage.localName}" mainImage.first() editable />
|
<@editingLinks "${mainImage.localName}" mainImage.first() editable />
|
||||||
<#else>
|
<#else>
|
||||||
<#local imageLabel><@addLinkWithLabel mainImage editable "Photo" /></#local>
|
<#local imageLabel><@addLinkWithLabel mainImage editable "Photo" /></#local>
|
||||||
${imageLabel}
|
${imageLabel}
|
||||||
<#if showPlaceholder == "always" || (showPlaceholder="with_add_link" && imageLabel?has_content)>
|
<#if showPlaceholder == "always" || (showPlaceholder="with_add_link" && imageLabel?has_content)>
|
||||||
<img class="individual-photo" src="${placeholderImageUrl(individual.uri)}" title = "no image" alt="placeholder image" width="160" />
|
<img class="individual-photo" src="${placeholderImageUrl(individual.uri)}" title = "no image" alt="placeholder image" width="${imageWidth!}" />
|
||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
@ -213,7 +213,7 @@ name will be used as the label. -->
|
||||||
${label.value}
|
${label.value}
|
||||||
<#if (labelCount > 1) && editable >
|
<#if (labelCount > 1) && editable >
|
||||||
<span class="inline">
|
<span class="inline">
|
||||||
<a id="manageLabels" href="${urls.base}/manageLabels?subjectUri=${individual.uri!}" style="margin-left:20px;font-size:0.7em">
|
<a id="manageLabels" href="${urls.base}/manageLabels?subjectUri=${individual.uri!}">
|
||||||
manage labels
|
manage labels
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -229,6 +229,12 @@ name will be used as the label. -->
|
||||||
</#list>
|
</#list>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
<#macro mostSpecificTypesPerson individual editable>
|
||||||
|
<#list individual.mostSpecificTypes as type>
|
||||||
|
<div id="titleContainer"><span class="<#if editable>display-title-editable<#else>display-title-not-editable</#if>">${type}</span></div>
|
||||||
|
</#list>
|
||||||
|
</#macro>
|
||||||
|
|
||||||
<#--Property group names may have spaces in them, replace spaces with underscores for html id/hash-->
|
<#--Property group names may have spaces in them, replace spaces with underscores for html id/hash-->
|
||||||
<#function createPropertyGroupHtmlId propertyGroupName>
|
<#function createPropertyGroupHtmlId propertyGroupName>
|
||||||
<#return propertyGroupName?replace(" ", "_")>
|
<#return propertyGroupName?replace(" ", "_")>
|
||||||
|
|
Loading…
Add table
Reference in a new issue