updates for page management and adding rdfs prefix to menu.n3
This commit is contained in:
parent
34858fcadb
commit
b0f4e7e820
6 changed files with 101 additions and 3 deletions
95
webapp/web/templates/freemarker/lib/lib-vitro-form.ftl
Normal file
95
webapp/web/templates/freemarker/lib/lib-vitro-form.ftl
Normal file
|
@ -0,0 +1,95 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<#-- Macros and functions for form controls -->
|
||||
|
||||
<#-- Output: html notifying the user that the browser is an unsupported version -->
|
||||
<#macro unsupportedBrowser urlsBase>
|
||||
<div id="ie67DisableWrapper">
|
||||
<div id="ie67DisableContent">
|
||||
<img src="${urlsBase}/images/iconAlertBig.png" alt="Alert Icon"/>
|
||||
<p>This form is not supported in versions of Internet Explorer below version 8. Please upgrade your browser, or
|
||||
switch to another browser, such as FireFox.</p>
|
||||
</div>
|
||||
</div>
|
||||
</#macro>
|
||||
|
||||
<#--Given an edit configuration template object, get the current value for a uri field using the field name-->
|
||||
|
||||
|
||||
<#function getEditConfigLiteralValue config varName>
|
||||
<#local literalValues = config.existingLiteralValues >
|
||||
<#if (literalValues?keys?seq_contains(varName)) && (literalValues[varName]?size > 0)>
|
||||
<#return literalValues[varName][0] >
|
||||
</#if>
|
||||
<#return "">
|
||||
</#function>
|
||||
|
||||
<#--Given an edit configuration template object, get the current value for a literal field using the field name-->
|
||||
|
||||
<#function getEditConfigUriValue config varName>
|
||||
<#local uriValues = config.existingUriValues />
|
||||
<#if (uriValues?keys?seq_contains(varName)) && (uriValues[varName]?size > 0)>
|
||||
<#return uriValues[varName][0] >
|
||||
</#if>
|
||||
<#return "">
|
||||
</#function>
|
||||
|
||||
<#--Now check whether a given value returns either a uri or a literal value, if one empty then use other and
|
||||
return - returns empty string if no value found-->
|
||||
<#function getEditConfigValue config varName>
|
||||
<#local returnValue = getEditConfigUriValue(config, varName) />
|
||||
<#if (returnValue?length = 0)>
|
||||
<#local returnValue = getEditConfigLiteralValue(config, varName) />
|
||||
</#if>
|
||||
<#return returnValue>
|
||||
</#function>
|
||||
|
||||
|
||||
<#--Given edit submission object find values-->
|
||||
<#function getEditSubmissionLiteralValue submission varName>
|
||||
<#local literalValues = submission.literalsFromForm >
|
||||
<#if (literalValues?keys?seq_contains(varName)) && (literalValues[varName]?size > 0)>
|
||||
<#return literalValues[varName][0] >
|
||||
</#if>
|
||||
<#return "">
|
||||
</#function>
|
||||
|
||||
<#--Given an edit configuration template object, get the current value for a literal field using the field name-->
|
||||
|
||||
<#function getEditSubmissionUriValue submission varName>
|
||||
<#local uriValues = submission.urisFromForm />
|
||||
<#if (uriValues?keys?seq_contains(varName)) && (uriValues[varName]?size > 0)>
|
||||
<#return uriValues[varName][0] >
|
||||
</#if>
|
||||
<#return "">
|
||||
</#function>
|
||||
|
||||
<#--Get edit submission value for either literal or uri-->
|
||||
<#function getEditSubmissionValue submission varName>
|
||||
<#local returnValue = getEditSubmissionUriValue(submission, varName) />
|
||||
<#if (returnValue?length = 0)>
|
||||
<#local returnValue = getEditSubmissionLiteralValue(submission, varName) />
|
||||
</#if>
|
||||
<#return returnValue>
|
||||
</#function>
|
||||
|
||||
<#--Get the value for the form field, checking edit submission first and then edit configuration-->
|
||||
<#function getFormFieldValue submission config varName>
|
||||
<#local returnValue = "">
|
||||
<#if submission?has_content && submission.submissionExists = true>
|
||||
<#local returnValue = getEditSubmissionValue(submission varName)>
|
||||
<#else>
|
||||
<#local returnValue = getEditConfigValue(config varName)>
|
||||
</#if>
|
||||
<#return returnValue>
|
||||
</#function>
|
||||
|
||||
<#--Check if submission error exists for a field name-->
|
||||
<#function submissionErrorExists editSubmission fieldName>
|
||||
<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content>
|
||||
<#if editSubmission.validationErrors?keys?seq_contains(fieldName)>
|
||||
<#return true>
|
||||
</#if>
|
||||
</#if>
|
||||
<#return false>
|
||||
</#function>
|
Loading…
Add table
Add a link
Reference in a new issue