NIHVIVO-2819 Rewrite accountAssociateProfile.js to improve the logic and enhance the function - mostly in preserving user choices in a re-display of the form.

This commit is contained in:
j2blake 2011-07-09 18:51:35 +00:00
parent 7f4e15256c
commit 424fc2b17e
5 changed files with 161 additions and 75 deletions

View file

@ -41,7 +41,7 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/auto
<select name="degreeUri" id="degreeUri" >
<option value="" selected="selected">Select one</option>
<#list profileTypes?keys as key>
<option value="${key}" >${profileTypes[key]}</option>
<option value="${key}" <#if degreeUri = key> selected </#if> >${profileTypes[key]}</option>
</#list>
</select>
</p>
@ -56,6 +56,18 @@ var associateProfileFieldsData = {
userUri: '' ,
</#if>
<#if associationIsReset??>
associationIsReset: 'true' ,
</#if>
<#if associatedProfileInfo??>
associatedProfileInfo: {
label: '${associatedProfileInfo.label}',
uri: '${associatedProfileInfo.uri}',
url: '${associatedProfileInfo.url}'
},
</#if>
<#if showAssociation??>
associationEnabled: true ,
ajaxUrl: '${formUrls.accountsAjax}'