Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ i18n sprint ] I18n fixes for edit forms #3783

Merged
merged 3 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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'}" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ Set this flag on the input acUriReceiver where you would like this behavior to o

<@lvf.unsupportedBrowser urls.base />

<section id="add${roleDescriptor?capitalize}RoleToPersonTwoStage" role="region">
<section id="add${roleDescriptor?cap_first}RoleToPersonTwoStage" role="region">

<form id="add${roleDescriptor?capitalize}RoleToPersonTwoStage" class="customForm noIE67" action="${submitUrl}" role="add/edit grant role">
<form id="add${roleDescriptor?cap_first}RoleToPersonTwoStage" class="customForm noIE67" action="${submitUrl}" role="add/edit grant role">

<p class="inline">
<label for="typeSelector">${typeSelectorLabel?capitalize}<#if editMode != "edit"> ${requiredHint}<#else>:</#if></label>
<label for="typeSelector">${typeSelectorLabel?cap_first}<#if editMode != "edit"> ${requiredHint}<#else>:</#if></label>
<#--Code below allows for selection of first 'select one' option if no activity type selected-->
<#if activityTypeValue?has_content>
<#assign selectedActivityType = activityTypeValue />
Expand Down Expand Up @@ -160,7 +160,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o

<#-- <div class="fullViewOnly"> -->
<p>
<label for="activity">${genericLabel?capitalize} ${i18n().name_capitalized} ${requiredHint}</label>
<label for="activity">${genericLabel?cap_first} ${i18n().name_capitalized} ${requiredHint}</label>
<input class="acSelector" size="50" type="text" id="activity" name="activityLabel" acGroupName="activity" value="${activityLabelValue}" />
<input class="display" type="hidden" id="activityDisplay" acGroupName="activity" name="activityLabelDisplay" value="${activityLabelDisplayValue}">
</p>
Expand All @@ -170,7 +170,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o

<div class="acSelection" acGroupName="activity">
<p class="inline">
<label></label>
<label>${i18n().selected}</label>
<span class="acSelectionInfo"></span>
<a href="/vivo/individual?uri=" class="verifyMatch" title="${i18n().verify_match_capitalized}">(${i18n().verify_match_capitalized}</a> ${i18n().or}
<a href="#" class="changeSelection" id="changeSelection">${i18n().change_selection})</a>
Expand All @@ -181,7 +181,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
</div>

<#if showRoleLabelField = true>
<p><label for="roleLabel">${i18n().role_in} ${genericLabel?capitalize} ${roleExamples}</label>
<p><label for="roleLabel">${i18n().role_in} ${genericLabel?cap_first} ${roleExamples}</label>
<input size="50" type="text" id="roleLabel" name="roleLabel" value="${roleLabel}" />
</p>
</#if>
Expand All @@ -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")>
<label class="dateTimeLabel" for="startField">${i18n().start_year}</label>
${htmlForElements["startField"]} ${yearHint}
<@lvf.printYearField "startField" /> ${yearHint}
</#if>
<#else>
<h4 class="label">${i18n().years_participating} </h4>
<#if htmlForElements?keys?seq_contains("startField")>
<label class="dateTime" for="startField">${i18n().start_capitalized}</label>
${htmlForElements["startField"]} ${yearHint}
<label class="dateTime" for="startField">${i18n().start_year}</label>
<@lvf.printYearField "startField" /> ${yearHint}
</#if>
<p></p>
<#if htmlForElements?keys?seq_contains("endField")>
<label class="dateTime" for="endField">${i18n().end_capitalized}</label>
${htmlForElements["endField"]} ${yearHint}
<label class="dateTime" for="endField">${i18n().end_year}</label>
<@lvf.printYearField "endField" /> ${yearHint}
</#if>
</#if>
<#-- </div> -->
Expand All @@ -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!},</#if>
// used in repair mode: button text and org name label
defaultTypeName: <#if genericLabel??>'${genericLabel}'<#else>'activity'</#if>,
defaultTypeName: <#if genericLabel??>'${genericLabel?js_string}'<#else>'activity'</#if>,
baseHref: '${urls.base}/individual?uri=',
blankSentinel: '${blankSentinel}',
flagClearLabelForExisting: '${flagClearLabelForExisting}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
</#assign>
<#if editConfiguration.objectUri?has_content>
<#assign formTitle>${i18n().edit_capitalized} ${formTitle} </#assign>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,10 @@ return - returns empty string if no value found-->
</#if>
<#return false>
</#function>

<#macro printYearField fieldName required=false>
<fieldset class="dateTime">
<input class="text-field" name="${fieldName}-year" id="${fieldName}-year" type="text" value="${year!}" size="4" maxlength="4" <#if required>required </#if> />
</fieldset>
</#macro>