updates for page management security, labels
This commit is contained in:
parent
8d520895ac
commit
3e5c770506
10 changed files with 60 additions and 17 deletions
|
@ -1,10 +1,16 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
<#--Number of labels present-->
|
||||
<#if !labelCount??>
|
||||
<#assign labelCount = 0 >
|
||||
</#if>
|
||||
<#--Number of available locales-->
|
||||
<#if !localesCount??>
|
||||
<#assign localesCount = 1>
|
||||
</#if>
|
||||
<#--Number of distinct languages represented, with no language tag counting as a language, across labels-->
|
||||
<#if !languageCount??>
|
||||
<#assign languageCount = 1>
|
||||
</#if>
|
||||
|
||||
<#-- Default individual profile page template -->
|
||||
<#--@dumpAll /-->
|
||||
|
@ -35,7 +41,7 @@
|
|||
<#else>
|
||||
<h1 class="fn">
|
||||
<#-- Label -->
|
||||
<@p.label individual editable labelCount localesCount/>
|
||||
<@p.label individual editable labelCount localesCount languageCount/>
|
||||
|
||||
<#-- Most-specific types -->
|
||||
<@p.mostSpecificTypes individual />
|
||||
|
|
|
@ -14,7 +14,11 @@
|
|||
<#assign label = labelLiteral />
|
||||
<#assign labelLang = labelObject.languageName />
|
||||
<#assign languageCode = labelObject.languageCode />
|
||||
<#assign labelEditLink = labelObject.editLinkURL />
|
||||
<#assign labelEditLink = ""/>
|
||||
<#if labelObject.editLinkURL?has_content>
|
||||
<#assign labelEditLink = labelObject.editLinkURL/>
|
||||
</#if>
|
||||
|
||||
<#if label?? && ( label?index_of("@") > -1 ) >
|
||||
<#assign labelStr = label?substring(0, label?index_of("@")) >
|
||||
<#assign tagOrTypeStr = label?substring(label?index_of("@")) >
|
||||
|
@ -52,7 +56,10 @@
|
|||
<#assign label = labelLiteral />
|
||||
<#assign labelLang = labelObject.languageName />
|
||||
<#assign languageCode = labelObject.languageCode />
|
||||
<#assign labelEditLink = labelObject.editLinkURL />
|
||||
<#assign labelEditLink = ""/>
|
||||
<#if labelObject.editLinkURL?has_content>
|
||||
<#assign labelEditLink = labelObject.editLinkURL/>
|
||||
</#if>
|
||||
<#if label?? && ( label?index_of("@") > -1 ) >
|
||||
<#assign labelStr = label?substring(0, label?index_of("@")) >
|
||||
<#assign tagOrTypeStr = label?substring(label?index_of("@")) >
|
||||
|
@ -75,7 +82,7 @@
|
|||
<#macro displayLabel labelSeq labelStr languageCode labelEditLink tagOrTypeStr editGenerator editable displayRemoveLink>
|
||||
<li>${labelStr} <#if labelSeq?seq_contains(labelStr)> (duplicate value) </#if>
|
||||
<#if editable> <#if labelEditLink?has_content> <a href="${labelEditLink}&${editGenerator}">Edit</a></#if>
|
||||
<#if displayRemoveLink = true>
|
||||
<#if displayRemoveLink>
|
||||
<a href="${urls.base}/edit/primitiveRdfEdit" languageName="${labelLang}" languageCode="${languageCode}"
|
||||
labelValue="${labelStr}" tagOrType="${tagOrTypeStr!}" class="remove" title="${i18n().remove_capitalized}">${i18n().remove_capitalized}</a>
|
||||
</#if>
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
<#assign labelStr = "" >
|
||||
<#assign languageTag = "" >
|
||||
<#assign labelSeq = [] >
|
||||
<#assign editable = "false"/>
|
||||
<#assign displayRemoveLink = "false"/>
|
||||
<#assign editable = false/>
|
||||
<#assign displayRemoveLink = false/>
|
||||
|
||||
<#if subjectName?? >
|
||||
<h2>${i18n().view_labels_for} ${editConfiguration.pageData.subjectName}</h2>
|
||||
<h2>${i18n().view_labels_for} ${subjectName}</h2>
|
||||
<#else>
|
||||
<h2>${i18n().view_labels_capitalized}</h2>
|
||||
</#if>
|
||||
|
@ -21,9 +21,9 @@
|
|||
<section id="rdfsLabels" role="container">
|
||||
|
||||
<ul id="existingLabelsList" name="existingLabelsList">
|
||||
<#if editConfiguration.pageData.labelsSortedByLanguageName?has_content>
|
||||
<#if labelsSortedByLanguageName?has_content>
|
||||
<#--List of labelInformation objects as value where key = language name -->
|
||||
<#assign labelsSorted = editConfiguration.pageData.labelsSortedByLanguageName />
|
||||
<#assign labelsSorted = labelsSortedByLanguageName />
|
||||
<#--Keys would be the actual names of languages-->
|
||||
<#assign labelLanguages = labelsSorted?keys?sort />
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ name will be used as the label. -->
|
|||
</#macro>
|
||||
|
||||
<#-- Label -->
|
||||
<#macro label individual editable labelCount localesCount=1>
|
||||
<#macro label individual editable labelCount localesCount=1 languageCount=1>
|
||||
<#assign labelPropertyUri = ("http://www.w3.org/2000/01/rdf-schema#label"?url) />
|
||||
<#assign useEditLink = false />
|
||||
<#--edit link used if in edit mode and only one label and one language-->
|
||||
|
@ -249,8 +249,8 @@ name will be used as the label. -->
|
|||
${label.value}
|
||||
<#if useEditLink>
|
||||
<@editingLinks "label" "" label editable />
|
||||
<#elseif editable || (labelCount > 1)>
|
||||
<#--We display the link even when the user is not logged in case of multiple labels-->
|
||||
<#elseif editable || (languageCount > 1)>
|
||||
<#--We display the link even when the user is not logged in case of multiple labels with different languages-->
|
||||
<#assign labelLink = ""/>
|
||||
<#-- Manage labels now goes to generator -->
|
||||
<#assign individualUri = individual.uri!""/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue