Template synchronization was off
authorAlexander Ebert <ebert@woltlab.com>
Thu, 27 Jun 2019 09:33:38 +0000 (11:33 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 27 Jun 2019 09:33:38 +0000 (11:33 +0200)
com.woltlab.wcf/templates/__devtoolsLanguageChooser.tpl
com.woltlab.wcf/templates/__iconFormField.tpl
com.woltlab.wcf/templates/articleAdd.tpl
com.woltlab.wcf/templates/formError.tpl
com.woltlab.wcf/templates/optionFieldList.tpl
syncTemplates.json
wcfsetup/install/files/acp/templates/formError.tpl

index fe8e59f50bff6b2b74f4f0904f51391124d62925..91864470ccbe7bc2163fa685e07fb6ac85262b6d 100644 (file)
                        };
                        
                        var callback = function(listItem) {
+                               var languageCode = elData(listItem, 'language-code');
+                               if (languageCode === '{$__wcf->getLanguage()->getFixedLanguageCode()}') {
+                                       window.location.reload();
+                                       return;
+                               }
+                               
+                               var alternateLink = elBySel('link[rel="alternate"][hreflang="' + languageCode + '"]');
+                               if (alternateLink) {
+                                       // Check if the page does not have unique links per language, such as for the landing page.
+                                       var currentLink = elBySel('link[rel="alternate"][hreflang="{$__wcf->getLanguage()->getFixedLanguageCode()}"]');
+                                       if (!currentLink || currentLink.href !== alternateLink.href) {
+                                               window.location = alternateLink.href;
+                                               return;
+                                       }
+                               }
+                               
                                Ajax.apiOnce({
                                        data: {
                                                actionName: 'devtoolsSetLanguage',
index fe3cecf0a4f531b2b1ba20eeaa5b9a8f97b85492..b8c8d2535de661cb879692d7a91f53c73c966bae 100644 (file)
@@ -22,7 +22,9 @@
                                input.value = iconName;
                        };
                        
-                       button.addEventListener('click', function() {
+                       button.addEventListener('click', function(event) {
+                               event.preventDefault();
+                               
                                UiStyleFontAwesome.open(callback);
                        });
                });
index f149a9eeeb68f9e522af7b210956443e0654c075..355012dcdc4d0414ccee4ac081b3fe05b6211da9 100644 (file)
 {include file='formError'}
 
 {if $success|isset}
-       <p class="success">{lang}wcf.global.success.{$action}{/lang}</p>
+       <p class="success" role="status">{lang}wcf.global.success.{$action}{/lang}</p>
 {/if}
 
 {if $action == 'edit'}
        <p class="info jsArticleNoticeTrash"{if !$article->isDeleted} style="display: none;"{/if}>{lang}wcf.acp.article.trash.notice{/lang}</p>
        
-       {if $lastVersion}<p class="info">{lang}wcf.acp.article.lastVersion{/lang}</p>{/if}
+       {if $lastVersion}<p class="info" role="status">{lang}wcf.acp.article.lastVersion{/lang}</p>{/if}
 {/if}
 
 <form class="articleAddForm" method="post" action="{if $action == 'add'}{link controller='ArticleAdd'}{/link}{else}{link controller='ArticleEdit' id=$articleID}{/link}{/if}">
index 3e8987cc86b6dfaae78f824c03141211e48c7151..3afcdc6925e5363df274c6b023d85bcbc8aab335 100644 (file)
@@ -4,4 +4,4 @@
        {else}
                <p class="error" role="alert">{lang}wcf.global.form.error{/lang}</p>
        {/if}
-{/if}
\ No newline at end of file
+{/if}
index 4ed68fe6ba2488874e03465db15e6914eba39606..740eed8e1fd247263a518f82a5bf675c25a0dbb2 100644 (file)
@@ -1,5 +1,4 @@
 {if !$isGuestGroup|isset}{assign var=isGuestGroup value=false}{/if}
-{if !$groupIsOwner|isset}{assign var=groupIsOwner value=false}{/if}
 {foreach from=$options item=optionData}
        {assign var=option value=$optionData[object]}
        {if $errorType|is_array && $errorType[$option->optionName]|isset}
@@ -8,16 +7,7 @@
                {assign var=error value=''}
        {/if}
        <dl class="{$option->optionName}Input{if $error} formError{/if}">
-               <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}>
-                       {if $isSearchMode|empty || !$optionData[hideLabelInSearch]}
-                               <label for="{$option->optionName}">
-                                       {if VISITOR_USE_TINY_BUILD && $isGuestGroup && $option->excludedInTinyBuild}<span class="icon icon16 fa-bolt red jsTooltip" title="{lang}wcf.acp.group.excludedInTinyBuild{/lang}"></span> {/if}
-                                       {if $groupIsOwner && $option->optionName|in_array:$ownerGroupPermissions}<span class="icon icon16 fa-shield jsTooltip" title="{lang}wcf.acp.group.ownerGroupPermission{/lang}"></span> {/if}
-                                       
-                                       {lang}{@$langPrefix}{$option->optionName}{/lang}
-                               </label>
-                       {/if}
-               </dt>
+               <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}>{if $isSearchMode|empty || !$optionData[hideLabelInSearch]}<label for="{$option->optionName}">{if VISITOR_USE_TINY_BUILD && $isGuestGroup && $option->excludedInTinyBuild}<span class="icon icon16 fa-bolt red jsTooltip" title="{lang}wcf.acp.group.excludedInTinyBuild{/lang}"></span> {/if}{lang}{@$langPrefix}{$option->optionName}{/lang}</label>{/if}</dt>
                <dd>{@$optionData[html]}
                        {if $error}
                                <small class="innerError">
@@ -31,4 +21,4 @@
                        <small>{lang __optional=true}{@$langPrefix}{$option->optionName}.description{/lang}</small>
                </dd>
        </dl>
-{/foreach}
+{/foreach}
\ No newline at end of file
index a4f0245991ead25abd99e0eae82e07aff3a9c0f1..75370394fbac9ccdafb5512708352bb4fb56a5a2 100644 (file)
@@ -8,7 +8,6 @@
     "__booleanFormField",
     "__contentLanguageFormField",
     "__dateFormField",
-    "__devtoolsLanguageChooser",
     "__form",
     "__formButton",
     "__formContainer",
@@ -66,7 +65,6 @@
     "mediaBBCodeTag",
     "mediaManager",
     "multipleLanguageInputJavascript",
-    "optionFieldList",
     "radioButtonSearchableOptionType",
     "recaptcha",
     "scrollablePageCheckboxList",
@@ -80,4 +78,4 @@
     "wysiwyg",
     "wysiwygToolbar"
   ]
-}
\ No newline at end of file
+}
index 3e8987cc86b6dfaae78f824c03141211e48c7151..3afcdc6925e5363df274c6b023d85bcbc8aab335 100644 (file)
@@ -4,4 +4,4 @@
        {else}
                <p class="error" role="alert">{lang}wcf.global.form.error{/lang}</p>
        {/if}
-{/if}
\ No newline at end of file
+{/if}