VIVO-425, VIVO-422 and VIVO-424
This commit is contained in:
parent
f0844317a4
commit
239d075127
10 changed files with 466 additions and 7 deletions
|
@ -0,0 +1,26 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<#--
|
||||
|
||||
This template must be self-contained and not rely on other variables set for the individual page, because it
|
||||
is also used to generate the property statement during a deletion.
|
||||
-->
|
||||
<#import "lib-sequence.ftl" as s>
|
||||
<#import "lib-datetime.ftl" as dt>
|
||||
<@showAdministrator statement />
|
||||
|
||||
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
|
||||
next statement -->
|
||||
<#macro showAdministrator statement>
|
||||
|
||||
<#local linkedIndividual>
|
||||
<#if statement.organization??>
|
||||
<a href="${profileUrl(statement.uri("organization"))}" title="${i18n().organization_name}">${statement.organizationLabel!""}</a>
|
||||
<#else>
|
||||
<a href="${profileUrl(statement.uri("administratorRole"))}" title="${i18n().administering_organization_for}">${i18n().missing_organization}</a>
|
||||
</#if>
|
||||
</#local>
|
||||
|
||||
${linkedIndividual!}
|
||||
|
||||
</#macro>
|
|
@ -17,7 +17,7 @@
|
|||
<#if statement.credential??>
|
||||
<a href="${profileUrl(statement.uri("credential"))}" title="${i18n().credential_name}">${statement.credentialLabel!statement.issuedCredentialLabel!statement.credentialLocal!}</a>
|
||||
<#else>
|
||||
<a href="${profileUrl(statement.uri("issuedCredential"))}" title="${i18n().credential_name}">${statement.issuedCredentialLabel!"missing credential"}</a>
|
||||
<a href="${profileUrl(statement.uri("issuedCredential"))}" title="${i18n().credential_name}">${statement.issuedCredentialLabel!"${i18n().missing_credential}"}</a>
|
||||
</#if>
|
||||
</#local>
|
||||
|
||||
|
|
|
@ -0,0 +1,136 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<#-- this is in request.subject.name -->
|
||||
|
||||
<#-- leaving this edit/add mode code in for reference in case we decide we need it -->
|
||||
|
||||
<#import "lib-vivo-form.ftl" as lvf>
|
||||
|
||||
<#--Retrieve certain edit configuration information-->
|
||||
<#if editConfiguration.objectUri?has_content>
|
||||
<#assign editMode = "edit">
|
||||
<#else>
|
||||
<#assign editMode = "add">
|
||||
</#if>
|
||||
|
||||
<#--The blank sentinel indicates what value should be put in a URI when no autocomplete result has been selected.
|
||||
If the blank value is non-null or non-empty, n3 editing for an existing object will remove the original relationship
|
||||
if nothing is selected for that object-->
|
||||
<#assign blankSentinel = "" />
|
||||
<#if editConfigurationConstants?has_content && editConfigurationConstants?keys?seq_contains("BLANK_SENTINEL")>
|
||||
<#assign blankSentinel = editConfigurationConstants["BLANK_SENTINEL"] />
|
||||
</#if>
|
||||
|
||||
<#--This flag is for clearing the label field on submission for an existing object being selected from autocomplete.
|
||||
Set this flag on the input acUriReceiver where you would like this behavior to occur. -->
|
||||
<#assign flagClearLabelForExisting = "flagClearLabelForExisting" />
|
||||
|
||||
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
|
||||
|
||||
<#--Retrieve variables needed-->
|
||||
<#assign existingOrgValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingOrganization") />
|
||||
<#assign orgLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgLabel") />
|
||||
<#assign orgLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgLabelDisplay") />
|
||||
|
||||
<#--If edit submission exists, then retrieve validation errors if they exist-->
|
||||
<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content>
|
||||
<#assign submissionErrors = editSubmission.validationErrors/>
|
||||
</#if>
|
||||
|
||||
<#if editMode == "edit">
|
||||
<#assign titleVerb="${i18n().edit_capitalized}">
|
||||
<#assign submitButtonText="${i18n().save_changes}">
|
||||
<#assign disabledVal="disabled">
|
||||
<#else>
|
||||
<#assign titleVerb="${i18n().create_capitalized}">
|
||||
<#assign submitButtonText="${i18n().create_entry}">
|
||||
<#assign disabledVal=""/>
|
||||
</#if>
|
||||
|
||||
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
|
||||
|
||||
<h2>${titleVerb} ${i18n().administering_organization_for} ${editConfiguration.subjectName}</h2>
|
||||
|
||||
<#--Display error messages if any-->
|
||||
<#if submissionErrors?has_content>
|
||||
<#if orgLabelDisplayValue?has_content >
|
||||
<#assign orgLabelValue = orgLabelDisplayValue />
|
||||
</#if>
|
||||
|
||||
<section id="error-alert" role="alert">
|
||||
<img src="${urls.images}/iconAlert.png" width="24" height="24" alt="${i18n().error_alert_icon}" />
|
||||
<p>
|
||||
<#--Checking if any required fields are empty-->
|
||||
<#if lvf.submissionErrorExists(editSubmission, "orgLabel")>
|
||||
${i18n().select_or_create_organization}
|
||||
</#if>
|
||||
</p>
|
||||
</section>
|
||||
</#if>
|
||||
|
||||
<@lvf.unsupportedBrowser urls.base />
|
||||
|
||||
<section id="grantAdministeredBy" role="region">
|
||||
|
||||
<form id="grantAdministeredBy" class="customForm noIE67" action="${submitUrl}" role="add/edit AdministeredGrant">
|
||||
<p>
|
||||
<label for="relatedIndLabel">${i18n().organization_capitalized} ${requiredHint}</label>
|
||||
<input class="acSelector" size="50" type="text" id="organization" acGroupName="organization" name="orgLabel" value="${orgLabelValue}">
|
||||
<input class="display" type="hidden" id="organizationDisplay" acGroupName="organization" name="orgLabelDisplay" value="${orgLabelDisplayValue}">
|
||||
</p>
|
||||
|
||||
<div class="acSelection" acGroupName="organization" id="organizationAcSelection">
|
||||
<p class="inline">
|
||||
<label>${i18n().selected_organization}:</label>
|
||||
<span class="acSelectionInfo"></span>
|
||||
<a href="" class="verifyMatch" title="${i18n().verify_match_capitalized}">(${i18n().verify_match_capitalized}</a> ${i18n().or}
|
||||
<a href="#" class="changeSelection" id="changeSelection">${i18n().change_selection})</a>
|
||||
</p>
|
||||
<input class="acUriReceiver" type="hidden" id="orgUri" name="existingOrganization" value="${existingOrgValue}" ${flagClearLabelForExisting}="true" />
|
||||
</div>
|
||||
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
|
||||
|
||||
<input type="hidden" id="editKey" name="editKey" value="${editKey}"/>
|
||||
|
||||
<p class="submit">
|
||||
<input type="submit" class="submit" value="${submitButtonText}"/><span class="or"> ${i18n().or} </span>
|
||||
<a class="cancel" href="${cancelUrl}" title="${i18n().cancel_title}">${i18n().cancel_link}</a>
|
||||
</p>
|
||||
|
||||
<p id="requiredLegend" class="requiredHint">* ${i18n().required_fields}</p>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var customFormData = {
|
||||
acUrl: '${urls.base}/autocomplete?tokenize=true&stem=true',
|
||||
acTypes: {organization: 'http://xmlns.com/foaf/0.1/Organization'},
|
||||
editMode: '${editMode}',
|
||||
defaultTypeName: 'organization',
|
||||
baseHref: '${urls.base}/individual?uri=',
|
||||
blankSentinel: '${blankSentinel}',
|
||||
flagClearLabelForExisting: '${flagClearLabelForExisting}'
|
||||
};
|
||||
var i18nStrings = {
|
||||
selectAnExisting: '${i18n().select_an_existing}',
|
||||
orCreateNewOne: '${i18n().or_create_new_one}',
|
||||
selectedString: '${i18n().selected}',
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
|
||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customForm.css" />')}
|
||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customFormWithAutocomplete.css" />')}
|
||||
|
||||
${scripts.add('<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/customFormUtils.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/js/extensions/String.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/js/browserUtils.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.bgiframe.pack.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js"></script>')}
|
||||
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
|||
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
|
||||
<#assign yearHint = "<span class='hint'>(${i18n().year_hint_format})</span>" />
|
||||
|
||||
<h2>${titleVerb} ${i18n().credentials} ${editConfiguration.subjectName}</h2>
|
||||
<h2>${titleVerb} ${i18n().credentials} ${i18n().for} ${editConfiguration.subjectName}</h2>
|
||||
|
||||
<#--Display error messages if any-->
|
||||
<#if submissionErrors?has_content>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue