From 4a2890206f00710b719ed79655ca2186f67a959d Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 16 Nov 2011 21:04:26 +0000 Subject: [PATCH] NIHVIVO-3188 updates to template --- .../edit/forms/addRoleToPersonTwoStage.ftl | 11 +- .../edit/forms/personHasPositionHistory.ftl | 138 +++++++++++------- .../freemarker/lib/lib-vivo-form.ftl | 30 ++-- 3 files changed, 100 insertions(+), 79 deletions(-) diff --git a/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl b/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl index dd5ffc94..6348da39 100644 --- a/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl +++ b/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl @@ -144,17 +144,8 @@ + <@lvf.acSelection urls.base /> -
-

- - - (Verify this match) -

- - -
- <#if showRoleLabelField = true>

diff --git a/productMods/templates/freemarker/edit/forms/personHasPositionHistory.ftl b/productMods/templates/freemarker/edit/forms/personHasPositionHistory.ftl index ee4e87b0..c10c0436 100644 --- a/productMods/templates/freemarker/edit/forms/personHasPositionHistory.ftl +++ b/productMods/templates/freemarker/edit/forms/personHasPositionHistory.ftl @@ -2,9 +2,13 @@ <#-- 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"> <#else> <#assign editMode = "add"> @@ -15,14 +19,21 @@ <#assign submitButtonText="Edit Position"> <#else> <#assign formAction="Create"> - <#assign submitButtonText="Create"> + <#assign submitButtonText="Create Position"> +<#--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=" *"/> -<@lf.unsupportedBrowser> +<#-- <@lvf.unsupportedBrowser urls.base /> --> -

${formAction} position entry for ${subjectName}

+

${formAction} position entry for ${editConfiguration.subjectName}

<#if errorOrgType??> <#assign errorMessage = "You must supply an organization type." /> @@ -48,73 +59,88 @@
- - - + + <#list orgTypeOpts?keys as key> + <#if editConfiguration.objectUri?has_content && editConfiguration.objectUri = key> + + <#else> + + - - - Cancel + +

- <#if orgType??> - - +
+

+ + +

- - + <@lvf.acSelection urls.base /> - - <#--Should we do something like this <@widget name="SelectList" fieldName="orgType" />, have a macro where we specified - the type of form element and the type of list, in this case an organization type--> - - - (YYYY) + + - - - (YYYY) - - + + <#assign posnTypeOpts = editConfiguration.pageData.positionType /> + + + + (YYYY) + + + (YYYY) + + +
+

<#if editMode == "edit"> - + <#else> - + - or Cancel - -

* required fields

- + or Cancel +

+

* required fields

+
- - <#assign acUrl="//autocomplete?tokenize=true" > - + -${stylesheets.add('', - '')} +${stylesheets.add('')} +${stylesheets.add('')} +${stylesheets.add('')} -${scripts.add('', - '', - '')} + +${scripts.add('', + '', + '', + '', + '')} diff --git a/productMods/templates/freemarker/lib/lib-vivo-form.ftl b/productMods/templates/freemarker/lib/lib-vivo-form.ftl index c7602750..1892f3ba 100644 --- a/productMods/templates/freemarker/lib/lib-vivo-form.ftl +++ b/productMods/templates/freemarker/lib/lib-vivo-form.ftl @@ -1,28 +1,32 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Macros for form controls --> +<#-- Macros and functions for form controls --> -<#----------------------------------------------------------------------------> -<#-- - Macro: unsupportedBrowser - - Output: html notifying the user that the browser is an unsupported version - - Input: none. - - Usage: <@unsupportedBrowser /> ---> -<#macro unsupportedBrowser > +<#-- Output: html notifying the user that the browser is an unsupported version --> +<#macro unsupportedBrowser urlsBase>
- Alert Icon + Alert Icon

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.

+<#-- After selecting an individual via autocomplete, display highlighted and with verify link --> +<#macro acSelection urlsBase> +
+

+ + + (Verify this match) +

+ + +
+ + <#--Given an edit configuration template object, get the current value for a uri field using the field name-->