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

pkp/pkp-lib#1807 b) locale placeholder for keyword form input fields #2499

Merged
merged 1 commit into from
May 10, 2017

Conversation

bozana
Copy link
Collaborator

@bozana bozana commented May 8, 2017

s. b) here: #1807

@bozana bozana mentioned this pull request May 8, 2017
5 tasks
@NateWr
Copy link
Contributor

NateWr commented May 10, 2017

This looks good. Placeholders aren't totally reliable as labels for a field due to some accessibility issues, but I think that doesn't matter here because I'm not sure the tag-it component itself is very accessible anyway.

I had just a couple of changes. The first uses the locale name instead of the code. The second fixes an unrelated issue with two globe icons appearing in the tag-it fields:

diff --git a/templates/form/keywordInput.tpl b/templates/form/keywordInput.tpl
index b225890..df52a58f 100755
--- a/templates/form/keywordInput.tpl
+++ b/templates/form/keywordInput.tpl
@@ -14,7 +14,7 @@
                        $(document).ready(function(){ldelim}
                                $("#{$thisFormLocale|escape:jqselector}-{$FBV_id}{$uniqId}").tagit({ldelim}
                                        fieldName: "keywords[{$thisFormLocale|escape}-{$FBV_id|escape}][]",
-                                       {if !$smarty.foreach.formLocales.first && empty($FBV_currentKeywords.$thisFormLocale)}placeholderText: "{$thisFormLocale|escape}",{/if}
+                                       {if !$smarty.foreach.formLocales.first && empty($FBV_currentKeywords.$thisFormLocale)}placeholderText: "{$thisFormLocaleName|escape}",{/if}
                                        allowSpaces: true,
                                        {if $FBV_sourceUrl && !$FBV_disabled}
                                                tagSource: function(search, showChoices) {ldelim}
@@ -47,7 +47,7 @@
                {rdelim});
                </script>
                <span id="{$FBV_id|escape}-localization-popover-container{$uniqId}" class="localization_popover_container pkpTagit">
-                       <ul class="localization_popover_container localizable {if $formLocale != $currentLocale} flag flag_{$formLocale|escape}{/if}" id="{$formLocale|escape}-{$FBV_id|escape}{$uniqId}">
+                       <ul class="localizable {if $formLocale != $currentLocale} flag flag_{$formLocale|escape}{/if}" id="{$formLocale|escape}-{$FBV_id|escape}{$uniqId}">
                                {if $FBV_currentKeywords}{foreach from=$FBV_currentKeywords.$formLocale item=currentKeyword}<li>{$currentKeyword|escape}</li>{/foreach}{/if}
                        </ul>
                        {if $FBV_label_content}<span>{$FBV_label_content}</span>{/if}

@bozana
Copy link
Collaborator Author

bozana commented May 10, 2017

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants