NIHVIVO 2465 and 2485 display and manage multiple rdfs labels
This commit is contained in:
parent
b9f3b35c7d
commit
3099c26c9a
9 changed files with 339 additions and 6 deletions
|
@ -1,4 +1,7 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
<#if !labelCount??>
|
||||
<#assign labelCount = 0 >
|
||||
</#if>
|
||||
|
||||
<#-- Default individual profile page template -->
|
||||
<#--@dumpAll /-->
|
||||
|
@ -28,8 +31,8 @@
|
|||
<#else>
|
||||
<h1 class="fn">
|
||||
<#-- Label -->
|
||||
<@p.label individual editable />
|
||||
|
||||
<@p.label individual editable labelCount />
|
||||
|
||||
<#-- Most-specific types -->
|
||||
<@p.mostSpecificTypes individual /><img id="uriIcon" title="${individual.uri}" class="middle" src="${urls.images}/individual/uriIcon.gif" alt="uri icon"/>
|
||||
</h1>
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<#-- Custom form for managing labels for individuals -->
|
||||
<#assign labelStr = "" >
|
||||
<#assign languageTag = "" >
|
||||
<#assign labelSeq = [] >
|
||||
<#if subjectName?? >
|
||||
<h2>Manage Labels for ${subjectName}</h2>
|
||||
<#else>
|
||||
<h2>Manage Labels</h2>
|
||||
</#if>
|
||||
<p id="mngLabelsText">
|
||||
Multiple labels exist for this profile but there should only be one. Select the label you want displayed on the profile page, and the others will be deleted.
|
||||
</p>
|
||||
|
||||
<section id="rdfsLabels" role="container">
|
||||
<ul>
|
||||
<#list labels as label>
|
||||
<#-- the query will return labels with their language tag or datatype, if any. So strip those out -->
|
||||
<#if label?? && ( label?index_of("@") > -1 ) >
|
||||
<#assign labelStr = label?substring(0, label?index_of("@")) >
|
||||
<#assign tagOrTypeStr = label?substring(label?index_of("@")) >
|
||||
<#elseif label?? && ( label?index_of("^^") > -1 ) >
|
||||
<#assign labelStr = label?substring(0, label?index_of("^^")) >
|
||||
<#assign tagOrTypeStr = label?substring(label?index_of("^^")) >
|
||||
<#assign tagOrTypeStr = tagOrTypeStr?replace("^^http","^^<http") >
|
||||
<#assign tagOrTypeStr = tagOrTypeStr?replace("#string","#string>") >
|
||||
<#else>
|
||||
<#assign labelStr = label >
|
||||
<#assign tagOrTypeStr = "" >
|
||||
</#if>
|
||||
<li>
|
||||
<input type="radio" class="labelCheckbox" name="labelCheckbox" id="${labelStr}" tagOrType="${tagOrTypeStr!}" role="radio" />
|
||||
<label class="inline">${labelStr}
|
||||
<#if labelSeq?seq_contains(labelStr)>
|
||||
(duplicate value)
|
||||
</#if>
|
||||
</label>
|
||||
</li>
|
||||
<#assign labelSeq = labelSeq + [labelStr]>
|
||||
</#list>
|
||||
</ul>
|
||||
|
||||
<br />
|
||||
<p>
|
||||
<input type="button" class="submit" id="submit" value="Save" role="button" role="input" />
|
||||
<span class="or"> or </span>
|
||||
<a href="${urls.referringPage}" class="cancel" title="cancel" >Cancel</a>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<script type="text/javascript">
|
||||
var customFormData = {
|
||||
processingUrl: '${urls.base}/edit/primitiveRdfEdit',
|
||||
individualUri: '${subjectUri!}'
|
||||
};
|
||||
</script>
|
||||
|
||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
|
||||
|
||||
${scripts.add('<script type="text/javascript" src="${urls.base}/js/utils.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/js/individual/manageLabelsForIndividual.js"></script>')}
|
||||
|
|
@ -28,13 +28,13 @@
|
|||
<#list group.properties as property>
|
||||
<article class="property" role="article">
|
||||
<#-- Property display name -->
|
||||
<#if property.localName == "authorInAuthorship" >
|
||||
<#if property.localName == "authorInAuthorship" && editable>
|
||||
<h3 id="${property.localName}">${property.name} <@p.addLink property editable /> <@p.verboseDisplay property />
|
||||
<a id="managePropLink" href="${urls.base}/managePublications?subjectUri=${subjectUri[1]!}" title="manage publications" <#if verbose>style="padding-top:10px"</#if> >
|
||||
manage publications
|
||||
</a>
|
||||
</h3>
|
||||
<#elseif property.localName == "hasResearcherRole">
|
||||
<#elseif property.localName == "hasResearcherRole" && editable>
|
||||
<h3 id="${property.localName}">${property.name} <@p.addLink property editable /> <@p.verboseDisplay property />
|
||||
<a id="managePropLink" href="${urls.base}/manageGrants?subjectUri=${subjectUri[1]!}" title="manage grants & projects" <#if verbose>style="padding-top:10px"</#if> >
|
||||
manage grants & projects
|
||||
|
|
|
@ -202,10 +202,18 @@ name will be used as the label. -->
|
|||
</#macro>
|
||||
|
||||
<#-- Label -->
|
||||
<#macro label individual editable>
|
||||
<#macro label individual editable labelCount>
|
||||
<#local label = individual.nameStatement>
|
||||
${label.value}
|
||||
<@editingLinks "label" label editable />
|
||||
<#if (labelCount > 1) && editable >
|
||||
<span class="inline">
|
||||
<a id="manageLabels" href="${urls.base}/manageLabels?subjectUri=${individual.uri!}" style="margin-left:20px;font-size:0.7em">
|
||||
manage labels
|
||||
</a>
|
||||
</span>
|
||||
<#else>
|
||||
<@editingLinks "label" label editable />
|
||||
</#if>
|
||||
</#macro>
|
||||
|
||||
<#-- Most specific types -->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue