Only show top add button on empty captcha question list page
authorMatthias Schmidt <gravatronics@live.com>
Wed, 14 Apr 2021 08:21:14 +0000 (10:21 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 14 Apr 2021 08:21:14 +0000 (10:21 +0200)
Close #4072

wcfsetup/install/files/acp/templates/captchaQuestionList.tpl

index ba1afe0e4d1dfa01c5d357a6003b1edec67d7253..4835179d0c47d24fa5534631aac57508677a2195 100644 (file)
@@ -39,7 +39,7 @@
        </div>
 {/hascontent}
 
-{hascontent}
+{if $objects|count}
        <div id="captchaQuestionTabelContainer" class="section tabularBox">
                <table class="table">
                        <thead>
                        </thead>
                        
                        <tbody>
-                               {content}
-                                       {foreach from=$objects item='question'}
-                                               <tr class="jsQuestionRow">
-                                                       <td class="columnIcon">
-                                                               <span class="icon icon16 fa-{if !$question->isDisabled}check-{/if}square-o jsToggleButton jsTooltip pointer" title="{lang}wcf.global.button.{if $question->isDisabled}enable{else}disable{/if}{/lang}" data-object-id="{@$question->questionID}"></span>
-                                                               <a href="{link controller='CaptchaQuestionEdit' id=$question->questionID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
-                                                               <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$question->questionID}" data-confirm-message-html="{lang __encode=true}wcf.acp.captcha.question.delete.confirmMessage{/lang}"></span>
-                                                               
-                                                               {event name='rowButtons'}
-                                                       </td>
-                                                       <td class="columnID columnQuestionID">{$question->questionID}</td>
-                                                       <td class="columnText columnQuestion"><a href="{link controller='CaptchaQuestionEdit' id=$question->questionID}{/link}">{$question->getQuestion()}</a></td>
+                               {foreach from=$objects item='question'}
+                                       <tr class="jsQuestionRow">
+                                               <td class="columnIcon">
+                                                       <span class="icon icon16 fa-{if !$question->isDisabled}check-{/if}square-o jsToggleButton jsTooltip pointer" title="{lang}wcf.global.button.{if $question->isDisabled}enable{else}disable{/if}{/lang}" data-object-id="{@$question->questionID}"></span>
+                                                       <a href="{link controller='CaptchaQuestionEdit' id=$question->questionID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
+                                                       <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$question->questionID}" data-confirm-message-html="{lang __encode=true}wcf.acp.captcha.question.delete.confirmMessage{/lang}"></span>
                                                        
-                                                       {event name='columns'}
-                                               </tr>
-                                       {/foreach}
-                               {/content}
+                                                       {event name='rowButtons'}
+                                               </td>
+                                               <td class="columnID columnQuestionID">{$question->questionID}</td>
+                                               <td class="columnText columnQuestion"><a href="{link controller='CaptchaQuestionEdit' id=$question->questionID}{/link}">{$question->getQuestion()}</a></td>
+                                               
+                                               {event name='columns'}
+                                       </tr>
+                               {/foreach}
                        </tbody>
                </table>
        </div>
-{hascontentelse}
-       <p class="info">{lang}wcf.global.noItems{/lang}</p>
-{/hascontent}
-
-<footer class="contentFooter">
-       {hascontent}
-               <div class="paginationBottom">
-                       {content}{@$pagesLinks}{/content}
-               </div>
-       {/hascontent}
        
-       <nav class="contentFooterNavigation">
-               <ul>
-                       <li><a href="{link controller='CaptchaQuestionAdd'}{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.captcha.question.add{/lang}</span></a></li>
-                       
-                       {event name='contentFooterNavigation'}
-               </ul>
-       </nav>
-</footer>
+       <footer class="contentFooter">
+               {hascontent}
+                       <div class="paginationBottom">
+                               {content}{@$pagesLinks}{/content}
+                       </div>
+               {/hascontent}
+               
+               <nav class="contentFooterNavigation">
+                       <ul>
+                               <li><a href="{link controller='CaptchaQuestionAdd'}{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.captcha.question.add{/lang}</span></a></li>
+                               
+                               {event name='contentFooterNavigation'}
+                       </ul>
+               </nav>
+       </footer>
+{else}
+       <p class="info">{lang}wcf.global.noItems{/lang}</p>
+{/if}
 
 {include file='footer'}