VIVO-112: updates for educational training and awards
This commit is contained in:
parent
5d2e44c08f
commit
15168eb8ea
12 changed files with 417 additions and 249 deletions
|
@ -29,12 +29,12 @@
|
|||
</#if>
|
||||
</#local>
|
||||
|
||||
<#local conferredByOrg>
|
||||
<#if statement.conferredBy?has_content && statement.conferredByLabel?has_content>
|
||||
${i18n().conferred_by} <a href="${profileUrl(statement.uri("conferredBy"))}" title="${i18n().conferred_by}">${statement.conferredByLabel}</a>
|
||||
<#local assignedByOrg>
|
||||
<#if statement.assignedBy?has_content && statement.assignedByLabel?has_content>
|
||||
${i18n().conferred_by} <a href="${profileUrl(statement.uri("assignedBy"))}" title="${i18n().conferred_by}">${statement.assignedByLabel}</a>
|
||||
</#if>
|
||||
</#local>
|
||||
|
||||
<@s.join [ linkedIndividual, conferredByOrg!, dateTimeVal! ] />
|
||||
<@s.join [ linkedIndividual, assignedByOrg!, dateTimeVal! ] />
|
||||
|
||||
</#macro>
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
<#--Two stage form for service provider role-->
|
||||
|
||||
<#--
|
||||
Required Values to be set for each form that includes addRoleToPersonTwoStage.ftl are:
|
||||
roleDescriptor.
|
||||
The other required values (roleType, optionsType, objectClassUri, and literalOptions are
|
||||
set in the JAVA class corresponding to the form, e.g. AddOrganizerRoleToPersonGenerator.java.
|
||||
|
||||
Optional values can be set, but each of these has default values
|
||||
set in addRoleToPersonTwoStage.ftl:
|
||||
|
||||
buttonText
|
||||
typeSelectorLabel
|
||||
numDateFields
|
||||
showRoleLAbelField
|
||||
roleExamples-->
|
||||
|
||||
|
||||
<#--Variable assignments-->
|
||||
<#assign roleDescriptor = "${i18n().organizer_of}" />
|
||||
<#assign typeSelectorLabel = "${i18n().organizer_of}" />
|
||||
<#assign genericLabel = "${i18n().event_capitalized}" />
|
||||
<#assign acMultipleTypes = "'true'" />
|
||||
<#assign acTypes = "{activity: 'http://vivoweb.org/ontology/core#EventSeries,http://purl.org/NET/c4dm/event.owl#Event'}"
|
||||
|
||||
<#--Each of the two stage forms will include the form below-->
|
||||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
<#--Two stage form for service provider role-->
|
||||
|
||||
<#--
|
||||
Required Values to be set for each form that includes addRoleToPersonTwoStage.ftl are:
|
||||
roleDescriptor.
|
||||
The other required values (roleType, optionsType, objectClassUri, and literalOptions are
|
||||
set in the JAVA class corresponding to the form, e.g. AddOrganizerRoleToPersonGenerator.java.
|
||||
|
||||
Optional values can be set, but each of these has default values
|
||||
set in addRoleToPersonTwoStage.ftl:
|
||||
|
||||
buttonText
|
||||
typeSelectorLabel
|
||||
numDateFields
|
||||
showRoleLAbelField
|
||||
roleExamples-->
|
||||
|
||||
|
||||
<#--Variable assignments-->
|
||||
<#assign roleDescriptor = "${i18n().organizer_of}" />
|
||||
<#assign typeSelectorLabel = "${i18n().organizer_of}" />
|
||||
<#assign genericLabel = "${i18n().event_capitalized}" />
|
||||
<#assign acMultipleTypes = "'true'" />
|
||||
<#assign acTypes = "{activity: 'http://vivoweb.org/ontology/core#EventSeries,http://purl.org/NET/c4dm/event.owl#Event'}">
|
||||
|
||||
<#--Each of the two stage forms will include the form below-->
|
||||
<#include "addRoleToPersonTwoStage.ftl">
|
|
@ -91,8 +91,14 @@ var awardReceiptUtils = {
|
|||
|
||||
buildAwardReceiptLabel: function() {
|
||||
var rdfsLabel = "";
|
||||
var $acSelection = $("div.acSelection[acGroupName='award']")
|
||||
if ( this.editMode == "edit" ) {
|
||||
rdfsLabel = this.awardDisplay.val();
|
||||
if ( $acSelection.find("span.acSelectionInfo").text().length > 0 ) {
|
||||
rdfsLabel = $("span.acSelectionInfo").text();
|
||||
}
|
||||
else {
|
||||
rdfsLabel = this.award.val();
|
||||
}
|
||||
}
|
||||
else {
|
||||
rdfsLabel = this.award.val();
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
|
||||
var educationalTrainingUtils = {
|
||||
|
||||
onLoad: function(href, blankSentinel) {
|
||||
this.initObjectReferences();
|
||||
this.bindEventListeners();
|
||||
$.extend(this, customFormData);
|
||||
},
|
||||
|
||||
initObjectReferences: function() {
|
||||
|
||||
this.form = $('#personHasEducationalTraining');
|
||||
this.aDLabel = $('#awardedDegreeLabel');
|
||||
this.degreeSelector = $('#degreeUri');
|
||||
},
|
||||
|
||||
bindEventListeners: function() {
|
||||
|
||||
this.degreeSelector.change(function() {
|
||||
educationalTrainingUtils.setAwardedDegreeLabel();
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
setAwardedDegreeLabel: function() {
|
||||
var degreeLabel = this.subjectName + ": " + this.degreeSelector.find(":selected").text();
|
||||
this.aDLabel.val(degreeLabel);
|
||||
}
|
||||
}
|
|
@ -33,9 +33,11 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
|||
<#assign deptValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "dept") />
|
||||
<#assign infoValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "info") />
|
||||
<#assign majorFieldValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "majorField") />
|
||||
<#assign degreeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "degree") />
|
||||
<#assign degreeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "degreeType") />
|
||||
<#assign awardedDegreeLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "awardedDegreeLabel") />
|
||||
<#assign existingOrgValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingOrg") />
|
||||
<#assign trainingTypeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "trainingType")/>
|
||||
<#assign existingADLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingAwardedDegreeLabel") />
|
||||
|
||||
<#--If edit submission exists, then retrieve validation errors if they exist-->
|
||||
<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content>
|
||||
|
@ -56,7 +58,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
|||
<#assign yearHint = "<span class='hint'>(${i18n().year_hint_format})</span>" />
|
||||
|
||||
|
||||
<h2>${titleVerb} ${i18n().educational_training_for} ${subjectName}${editConfiguration.subjectName}</h2>
|
||||
<h2>${titleVerb} ${i18n().educational_training_for} ${editConfiguration.subjectName}</h2>
|
||||
|
||||
<#--Display error messages if any-->
|
||||
<#if submissionErrors?has_content>
|
||||
|
@ -155,13 +157,19 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
|||
<div class="entry">
|
||||
<label for="degreeUri">${i18n().degree}</label>
|
||||
|
||||
<#assign degreeOpts = editConfiguration.pageData.degree />
|
||||
<select name="degree" id="degreeUri" >
|
||||
<#assign degreeOpts = editConfiguration.pageData.degreeType />
|
||||
<select name="degreeType" id="degreeUri" >
|
||||
<option value="" <#if degreeValue = "">selected</#if>>${i18n().select_one}</option>
|
||||
<#list degreeOpts?keys as key>
|
||||
<option value="${key}" <#if degreeValue = key>selected</#if>>${degreeOpts[key]}</option>
|
||||
</#list>
|
||||
</select>
|
||||
</select>
|
||||
<#if editMode == "edit">
|
||||
<input type="hidden" id="newAwardedDegreeLabel" name="awardedDegreeLabel" value=""/>
|
||||
<input type="hidden" id="awardedDegreeLabel" name="existingAwardedDegreeLabel" value="${existingADLabelValue!}"/>
|
||||
<#else>
|
||||
<input type="hidden" id="awardedDegreeLabel" name="awardedDegreeLabel" value=""/>
|
||||
</#if>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
|
@ -208,13 +216,18 @@ var customFormData = {
|
|||
defaultTypeName: 'organization',
|
||||
baseHref: '${urls.base}/individual?uri=',
|
||||
blankSentinel: '${blankSentinel}',
|
||||
flagClearLabelForExisting: '${flagClearLabelForExisting}'
|
||||
flagClearLabelForExisting: '${flagClearLabelForExisting}',
|
||||
subjectName: '${editConfiguration.subjectName}'
|
||||
};
|
||||
var i18nStrings = {
|
||||
selectAnExisting: '${i18n().select_an_existing}',
|
||||
orCreateNewOne: '${i18n().or_create_new_one}',
|
||||
selectedString: '${i18n().selected}'
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
educationalTrainingUtils.onLoad();
|
||||
});
|
||||
</script>
|
||||
|
||||
</section>
|
||||
|
@ -229,6 +242,7 @@ ${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/
|
|||
'<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/educationalTrainingUtils.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js"></script>')}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue