From d9c197d7a98fb16162384f0e49e8ea0bcbcc830f Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Fri, 14 Oct 2022 17:58:25 +0200 Subject: [PATCH 1/3] from fr_CA lang files --- .../edit/forms/addEditorRoleToPerson.ftl | 4 +++- .../edit/forms/addRoleToPersonTwoStage.ftl | 18 +++++++++--------- .../forms/defaultAddMissingIndividualForm.ftl | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/addEditorRoleToPerson.ftl b/webapp/src/main/webapp/templates/freemarker/edit/forms/addEditorRoleToPerson.ftl index 0f519adc4..bf5b9f1e9 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/addEditorRoleToPerson.ftl +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/addEditorRoleToPerson.ftl @@ -18,9 +18,11 @@ roleExamples--> <#--Variable assignments for Add Clinical Role To Person--> +<#setting url_escaping_charset="UTF-8"> +<#setting output_encoding="UTF-8"> <#assign roleDescriptor = "${i18n().collection_series_editor_role}" /> <#assign typeSelectorLabel = "${i18n().editor_role_in}" /> -<#assign genericLabel = "Collection or Series" /> +<#assign genericLabel = "${i18n().collection_or_series}" /> <#assign acTypes = "{activity: 'http://purl.org/ontology/bibo/Collection'}" /> diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl b/webapp/src/main/webapp/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl index fa2ea79a4..c0a07cf0f 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl @@ -126,12 +126,12 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <@lvf.unsupportedBrowser urls.base /> -
+
-
+

- + <#--Code below allows for selection of first 'select one' option if no activity type selected--> <#if activityTypeValue?has_content> <#assign selectedActivityType = activityTypeValue /> @@ -160,7 +160,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <#--

-->

- +

@@ -170,7 +170,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o

- + (${i18n().verify_match_capitalized} ${i18n().or} ${i18n().change_selection}) @@ -181,7 +181,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o

<#if showRoleLabelField = true> -

+

@@ -195,12 +195,12 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <#else>

${i18n().years_participating}

<#if htmlForElements?keys?seq_contains("startField")> - + ${htmlForElements["startField"]} ${yearHint}

<#if htmlForElements?keys?seq_contains("endField")> - + ${htmlForElements["endField"]} ${yearHint} @@ -222,7 +222,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o acTypes: ${acTypes!}, <#if acMultipleTypes??>acMultipleTypes: ${acMultipleTypes!}, // used in repair mode: button text and org name label - defaultTypeName: <#if genericLabel??>'${genericLabel}'<#else>'activity', + defaultTypeName: <#if genericLabel??>'${genericLabel?js_string}'<#else>'activity', baseHref: '${urls.base}/individual?uri=', blankSentinel: '${blankSentinel}', flagClearLabelForExisting: '${flagClearLabelForExisting}' diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/defaultAddMissingIndividualForm.ftl b/webapp/src/main/webapp/templates/freemarker/edit/forms/defaultAddMissingIndividualForm.ftl index 429f1e7bc..5121571c5 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/defaultAddMissingIndividualForm.ftl +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/defaultAddMissingIndividualForm.ftl @@ -3,7 +3,7 @@ <#import "lib-vivo-form.ftl" as lvf> <#assign formTitle> - "${editConfiguration.propertyPublicDomainTitle}" entry for ${editConfiguration.subjectName} +${i18n.new_entry_for(editConfiguration.propertyPublicDomainTitle, editConfiguration.subjectName)} <#if editConfiguration.objectUri?has_content> <#assign formTitle>${i18n().edit_capitalized} ${formTitle} From 071846900ba41bc651f887fec5b43677fc82e072 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Thu, 20 Oct 2022 17:51:30 +0200 Subject: [PATCH 2/3] use new macro without predefined label for year fields --- .../freemarker/edit/forms/addRoleToPersonTwoStage.ftl | 10 +++++----- .../webapp/templates/freemarker/lib/lib-vivo-form.ftl | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl b/webapp/src/main/webapp/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl index c0a07cf0f..ee4cd83e2 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl @@ -190,18 +190,18 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <#--Generated html is a map with key name mapping to html string--> <#if htmlForElements?keys?seq_contains("startField")> - ${htmlForElements["startField"]} ${yearHint} + <@lvf.printYearField "startField" /> ${yearHint} <#else>

${i18n().years_participating}

<#if htmlForElements?keys?seq_contains("startField")> - - ${htmlForElements["startField"]} ${yearHint} + + <@lvf.printYearField "startField" /> ${yearHint}

<#if htmlForElements?keys?seq_contains("endField")> - - ${htmlForElements["endField"]} ${yearHint} + + <@lvf.printYearField "endField" /> ${yearHint} <#--
--> diff --git a/webapp/src/main/webapp/templates/freemarker/lib/lib-vivo-form.ftl b/webapp/src/main/webapp/templates/freemarker/lib/lib-vivo-form.ftl index 368ceb7dc..4a5a975c9 100644 --- a/webapp/src/main/webapp/templates/freemarker/lib/lib-vivo-form.ftl +++ b/webapp/src/main/webapp/templates/freemarker/lib/lib-vivo-form.ftl @@ -107,3 +107,10 @@ return - returns empty string if no value found--> <#return false> + +<#macro printYearField fieldName required=false> +
+ required /> +
+ + From 31bd30ebf40c2cda6611addd01c9d2b0173164e9 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Mon, 7 Nov 2022 16:50:35 +0100 Subject: [PATCH 3/3] fixed wrong call for i18n bundle --- .../freemarker/edit/forms/defaultAddMissingIndividualForm.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/defaultAddMissingIndividualForm.ftl b/webapp/src/main/webapp/templates/freemarker/edit/forms/defaultAddMissingIndividualForm.ftl index 5121571c5..61e80d600 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/defaultAddMissingIndividualForm.ftl +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/defaultAddMissingIndividualForm.ftl @@ -3,7 +3,7 @@ <#import "lib-vivo-form.ftl" as lvf> <#assign formTitle> -${i18n.new_entry_for(editConfiguration.propertyPublicDomainTitle, editConfiguration.subjectName)} +${i18n().new_entry_for(editConfiguration.propertyPublicDomainTitle, editConfiguration.subjectName)} <#if editConfiguration.objectUri?has_content> <#assign formTitle>${i18n().edit_capitalized} ${formTitle}