NIHVIVO-3188 updates to template
This commit is contained in:
parent
f3fc43deaa
commit
4a2890206f
3 changed files with 100 additions and 79 deletions
|
@ -144,16 +144,7 @@
|
||||||
<input type="hidden" id="roleActivityType" name="roleActivityType" value="${activityTypeValue}"/>
|
<input type="hidden" id="roleActivityType" name="roleActivityType" value="${activityTypeValue}"/>
|
||||||
<input type="hidden" id="activityLabel" name="activityLabel" value="${activityLabelValue}"/>
|
<input type="hidden" id="activityLabel" name="activityLabel" value="${activityLabelValue}"/>
|
||||||
</#if>
|
</#if>
|
||||||
|
<@lvf.acSelection urls.base />
|
||||||
<div class="acSelection">
|
|
||||||
<p class="inline">
|
|
||||||
<label>Selected ${roleDescriptor?capitalize}:</label>
|
|
||||||
<span class="acSelectionInfo"></span>
|
|
||||||
<a href="/vivo/individual?uri=" class="verifyMatch">(Verify this match)</a>
|
|
||||||
</p>
|
|
||||||
<input class="acUriReceiver" type="hidden" id="roleActivityUri" name="roleActivity" value="" />
|
|
||||||
<!-- Field value populated by JavaScript -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<#if showRoleLabelField = true>
|
<#if showRoleLabelField = true>
|
||||||
<p><label for="roleLabel">Role in ### ${requiredHint} ${roleExamples}</label>
|
<p><label for="roleLabel">Role in ### ${requiredHint} ${roleExamples}</label>
|
||||||
|
|
|
@ -2,9 +2,13 @@
|
||||||
|
|
||||||
<#-- Template for adding a position history-->
|
<#-- Template for adding a position history-->
|
||||||
|
|
||||||
<#import "lib-vivo-form.ftl" as lf>
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
<#if editConfig.object?has_content>
|
<#-- Template for adding a position history-->
|
||||||
|
|
||||||
|
<#import "lib-vivo-form.ftl" as lvf>
|
||||||
|
|
||||||
|
<#if editConfiguration.objectUri?has_content>
|
||||||
<#assign editMode = "edit">
|
<#assign editMode = "edit">
|
||||||
<#else>
|
<#else>
|
||||||
<#assign editMode = "add">
|
<#assign editMode = "add">
|
||||||
|
@ -15,14 +19,21 @@
|
||||||
<#assign submitButtonText="Edit Position">
|
<#assign submitButtonText="Edit Position">
|
||||||
<#else>
|
<#else>
|
||||||
<#assign formAction="Create">
|
<#assign formAction="Create">
|
||||||
<#assign submitButtonText="Create">
|
<#assign submitButtonText="Create Position">
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
<#--Get existing value for specific data literals and uris-->
|
||||||
|
|
||||||
|
<#assign orgLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgLabel")/>
|
||||||
|
<#assign positionTitle = lvf.getFormFieldValue(editSubmission, editConfiguration, "positionTitle")/>
|
||||||
|
<#assign startField = lvf.getFormFieldValue(editSubmission, editConfiguration, "startField") />
|
||||||
|
<#assign endField = lvf.getFormFieldValue(editSubmission, editConfiguration, "endField") />
|
||||||
|
|
||||||
<#assign requiredHint="<span class='requiredHint'> *</span>"/>
|
<#assign requiredHint="<span class='requiredHint'> *</span>"/>
|
||||||
|
|
||||||
<@lf.unsupportedBrowser>
|
<#-- <@lvf.unsupportedBrowser urls.base /> -->
|
||||||
|
|
||||||
<h2>${formAction} position entry for ${subjectName}</h2>
|
<h2>${formAction} position entry for ${editConfiguration.subjectName}</h2>
|
||||||
|
|
||||||
<#if errorOrgType??>
|
<#if errorOrgType??>
|
||||||
<#assign errorMessage = "You must supply an organization type." />
|
<#assign errorMessage = "You must supply an organization type." />
|
||||||
|
@ -48,60 +59,71 @@
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<form class="customForm" action ="${submitUrl}" class="customForm" role="${formAction} position entry">
|
<form class="customForm" action ="${submitUrl}" class="customForm" role="${formAction} position entry">
|
||||||
<label for="typeSelector">Organization Type ${requiredHint}</label>
|
<p class="inline">
|
||||||
|
<label for="orgType">Organization Type ${requiredHint}</label>
|
||||||
|
<#assign orgTypeOpts = editConfiguration.pageData.orgType />
|
||||||
<select id="typeSelector" name="orgType" >
|
<select id="typeSelector" name="orgType" >
|
||||||
<option value="" <#if typeSelector = "">selected</#if> >Select one</option>
|
<option value="" selected="selected">Select one</option>
|
||||||
<#list orgType as key>
|
<#list orgTypeOpts?keys as key>
|
||||||
<option value="${key.uri}" <#if key = key.uri>selected</#if> >${key.label}</option>
|
<#if editConfiguration.objectUri?has_content && editConfiguration.objectUri = key>
|
||||||
|
<option value="${key}" selected >${orgTypeOpts[key]}</option>
|
||||||
|
<#else>
|
||||||
|
<option value="${key}">${orgTypeOpts[key]}</option>
|
||||||
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
</select>
|
</select>
|
||||||
|
</p>
|
||||||
|
|
||||||
<a title="Cancel" href="${formUrl}" class="cancel <#if key??>hidden</#>">Cancel</a>
|
<div class="fullViewOnly">
|
||||||
|
<p>
|
||||||
|
<label for="relatedIndLabel">### Name ${requiredHint}</label>
|
||||||
|
<input type="text" name="orgLabel" id="relatedIndLabel" size="50" class="acSelector" value="${orgLabel}" >
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<@lvf.acSelection urls.base />
|
||||||
|
|
||||||
<#if orgType??>
|
|
||||||
<label for="relatedIndLabel">${organizationType.label} ${requiredHint}</label>
|
|
||||||
<input type="text" value="Select an existing ${orgType.label} or create a new one." name="orgLabel" id="relatedIndLabel" size="50" class="acSelector ui-autocomplete-input" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true">
|
|
||||||
|
|
||||||
<label for="positionTitle">Position Title ${requiredHint}</label>
|
<label for="positionTitle">Position Title ${requiredHint}</label>
|
||||||
<input size="30" type="text" id="positionTitle" name="positionTitle" value="${positionTitle}" role="input" />
|
<input size="30" type="text" id="positionTitle" name="positionTitle" value="${positionTitle}" role="input" />
|
||||||
|
|
||||||
<label for="positionType">Position Type ${requiredHint}</label>
|
<label for="positionType">Position Type ${requiredHint}</label>
|
||||||
<select id="positionType" name="positionType" role="select">
|
<#assign posnTypeOpts = editConfiguration.pageData.positionType />
|
||||||
<option value="" role="option" <#if positionType = "">selected</#if> >Select one</option>
|
<select id="typeSelector" name="positionType" style="margin-top:-2px" >
|
||||||
<#list positionTypes as positionType>
|
<option value="" selected="selected">Select one</option>
|
||||||
<option value="${positionType.uri}" role="option" <#if positionType = positionType.uri>selected</#if> >${positionType.label}</option>
|
<#list posnTypeOpts?keys as key>
|
||||||
|
<#if editConfiguration.objectUri?has_content && editConfiguration.objectUri = key>
|
||||||
|
<option value="${key}" selected >${posnTypeOpts[key]}</option>
|
||||||
|
<#else>
|
||||||
|
<option value="${key}">${posnTypeOpts[key]}</option>
|
||||||
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
</select> <#--Should we do something like this <@widget name="SelectList" fieldName="orgType" />, have a macro where we specified
|
</select>
|
||||||
the type of form element and the type of list, in this case an organization type-->
|
|
||||||
|
|
||||||
<label for="startField">Start Year</label>
|
<label for="startField">Start Year</label>
|
||||||
<input class="text-field" name="startField-year" id="startField-year" type="textxt" value="<#if startField-year??>${startField-year}</#if>" size="4" maxlength="4" role="input" />
|
<input class="text-field" name="startField-year" id="startField-year" type="text" value="${startField}" size="4" maxlength="4" role="input" />
|
||||||
<span class='hint'>(YYYY)</span>
|
<span class='hint'>(YYYY)</span>
|
||||||
|
|
||||||
<label for="endField">End Year</label>
|
<label for="endField">End Year</label>
|
||||||
<input class="text-field" name="endField-year" id="endField-year" type="text" value="<#if endField-year??>${endField-year}</#if>" size="4" maxlength="4" role="input" />
|
<input class="text-field" name="endField-year" id="endField-year" type="text" value="${endField}" size="4" maxlength="4" role="input" />
|
||||||
<span class='hint'>(YYYY)</span>
|
<span class='hint'>(YYYY)</span>
|
||||||
|
|
||||||
<input type="hidden" name = "editKey" value="${editKey}" role="input"/>
|
<input type="hidden" name = "editKey" value="${editKey}" role="input"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<p class="submit">
|
||||||
<#if editMode == "edit">
|
<#if editMode == "edit">
|
||||||
<input type="submit" name="submit-${titleAction}" value="${submitButtonText}" class="submit" />
|
<input type="submit" id="submit" name="submit-${formAction}" value="${submitButtonText}" class="submit" />
|
||||||
<#else>
|
<#else>
|
||||||
<input type="submit" name="submit-${titleAction}" value="${submitButtonText} ${positionType.uri} and Position" class="submit" />
|
<input type="submit" id="submit" name="submit-${formAction}" value="${submitButtonText}" class="submit" />
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
or <a class="cancel" href="${formUrl.cancel}">Cancel</a>
|
<span class="or"> or </span><a class="cancel" href="${editConfiguration.cancelUrl}">Cancel</a>
|
||||||
|
</p>
|
||||||
|
<p class="requiredHint" id="requiredLegend" >* required fields</p>
|
||||||
|
|
||||||
<p class="requiredHint">* required fields</p>
|
|
||||||
</#if>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<#assign acUrl="//autocomplete?tokenize=true" >
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var customFormData = {
|
var customFormData = {
|
||||||
acUrl: '${acUrl?url}',
|
acUrl: '${urls.base}/autocomplete?tokenize=true',
|
||||||
editMode: '${editMode}',
|
editMode: '${editMode}',
|
||||||
submitButtonTextType: 'compound',
|
submitButtonTextType: 'compound',
|
||||||
defaultTypeName: 'organization' // used in repair mode, to generate button text and org name field label
|
defaultTypeName: 'organization' // used in repair mode, to generate button text and org name field label
|
||||||
|
@ -109,11 +131,15 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />',
|
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
|
||||||
'<link rel="stylesheet" href="${urls.base}/edit/forms/css/personHasEducationalTraining.css" />')}
|
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')}
|
||||||
|
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customFormWithAutocomplete.css" />')}
|
||||||
|
|
||||||
${scripts.add('<script type="text/javascript" src="${urls.base}/js/utils.js"></script>',
|
|
||||||
|
${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/customFormUtils.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/extensions/String.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.bgiframe.pack.js"></script>',
|
||||||
'<script type="text/javascript" src="${urls.base}/edit/forms/js/customFormWithAutocomplete.js"></script>')}
|
'<script type="text/javascript" src="${urls.base}/edit/forms/js/customFormWithAutocomplete.js"></script>')}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,32 @@
|
||||||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
<#-- Macros for form controls -->
|
<#-- Macros and functions for form controls -->
|
||||||
|
|
||||||
<#---------------------------------------------------------------------------->
|
|
||||||
|
|
||||||
<#--
|
<#-- Output: html notifying the user that the browser is an unsupported version -->
|
||||||
Macro: unsupportedBrowser
|
<#macro unsupportedBrowser urlsBase>
|
||||||
|
|
||||||
Output: html notifying the user that the browser is an unsupported version
|
|
||||||
|
|
||||||
Input: none.
|
|
||||||
|
|
||||||
Usage: <@unsupportedBrowser />
|
|
||||||
-->
|
|
||||||
<#macro unsupportedBrowser >
|
|
||||||
<div id="ie67DisableWrapper">
|
<div id="ie67DisableWrapper">
|
||||||
<div id="ie67DisableContent">
|
<div id="ie67DisableContent">
|
||||||
<img src="/vivo/site_icons/iconAlertBig.png" alt="Alert Icon"/>
|
<img src="${urlsBase}/site_icons/iconAlertBig.png" alt="Alert Icon"/>
|
||||||
<p>This form is not supported in versions of Internet Explorer below version 8. Please upgrade your browser, or
|
<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>
|
switch to another browser, such as FireFox.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
<#-- After selecting an individual via autocomplete, display highlighted and with verify link -->
|
||||||
|
<#macro acSelection urlsBase>
|
||||||
|
<div class="acSelection">
|
||||||
|
<p class="inline">
|
||||||
|
<label></label>
|
||||||
|
<span class="acSelectionInfo"></span>
|
||||||
|
<a href="${urlsBase}/individual?uri=" class="verifyMatch">(Verify this match)</a>
|
||||||
|
</p>
|
||||||
|
<input class="acUriReceiver" type="hidden" id="org" name="org" value="" />
|
||||||
|
<!-- Field value populated by JavaScript -->
|
||||||
|
</div>
|
||||||
|
</#macro>
|
||||||
|
|
||||||
<#--Given an edit configuration template object, get the current value for a uri field using the field name-->
|
<#--Given an edit configuration template object, get the current value for a uri field using the field name-->
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue