[TASK] Hide redirect table header when no records exist 43/55443/8
authorReiner Teubner <rteubner@me.com>
Wed, 24 Jan 2018 10:37:20 +0000 (11:37 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 24 Jan 2018 15:54:09 +0000 (16:54 +0100)
Resolves: #83661
Release: master
Change-Id: I8a7307986896fa2d68b5013d1defc235eff1d3e4
Reviewed-on: https://review.typo3.org/55443
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/redirects/Resources/Private/Language/locallang_module_redirect.xlf
typo3/sysext/redirects/Resources/Private/Templates/Management/Overview.html

index 42064f1..a674ba5 100644 (file)
                        <trans-unit id="redirect_add_text">
                                <source>Add redirect</source>
                        </trans-unit>
-                       <trans-unit id="redirect_refreshview">
-                               <source>Refresh view</source>
+                       <trans-unit id="redirect_not_found.title">
+                               <source>No redirects found!</source>
+                       </trans-unit>
+                       <trans-unit id="redirect_not_found.message">
+                               <source>There are currently no redirect records found in the database.</source>
+                       </trans-unit>
+                       <trans-unit id="redirect_create">
+                               <source>Create new redirect</source>
                        </trans-unit>
 
                        <trans-unit id="record_disabled">
index d49f85c..fe53350 100644 (file)
@@ -6,6 +6,18 @@
 </f:section>
 
 <f:section name="content">
+       <f:if condition="{redirects -> f:count()}">
+               <f:then><f:render section="table" arguments="{redirects: redirects}" /></f:then>
+               <f:else>
+                       <f:be.infobox state="-1" title="{f:translate(key: 'LLL:EXT:redirects/Resources/Private/Language/locallang_module_redirect.xlf:redirect_not_found.title')}">
+                               <p><f:translate key="LLL:EXT:redirects/Resources/Private/Language/locallang_module_redirect.xlf:redirect_not_found.message"/></p>
+                               <a class="btn btn-primary" href="{rd:editRecord(command: 'new', uid: 0)}"><f:translate key="LLL:EXT:redirects/Resources/Private/Language/locallang_module_redirect.xlf:redirect_create"/></a>
+                       </f:be.infobox>
+               </f:else>
+       </f:if>
+</f:section>
+
+<f:section name="table">
        <div class="table-fit">
                <table class="table table-striped table-hover">
                        <thead>