[TASK] Add hint to Site Configuration without pages 59/57659/2
authorMathias Brodala <mbrodala@pagemachine.de>
Mon, 23 Jul 2018 12:53:09 +0000 (14:53 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 13 Aug 2018 09:36:05 +0000 (11:36 +0200)
Resolves: #85620
Releases: master
Change-Id: I71185161afc5b50ed7b27a8f6298bcf32809a5a4
Reviewed-on: https://review.typo3.org/57659
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration.xlf
typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Overview.html

index cf076de..e3b79b8 100644 (file)
                        <trans-unit id="overview.configuration">
                                <source>Configuration Folder</source>
                        </trans-unit>
+                       <trans-unit id="overview.noPages.title">
+                               <source>No pages found!</source>
+                       </trans-unit>
+                       <trans-unit id="overview.noPages.message">
+                               <source>Please add at least one page through the Page module.</source>
+                       </trans-unit>
                        <trans-unit id="overview.noSiteConfiguration">
                                <source>This site does not have a configuration, yet.</source>
                        </trans-unit>
index 0ff56b6..3ad92fd 100644 (file)
@@ -1,86 +1,93 @@
-<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" data-namespace-typo3-fluid="true">
+<html
+       xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
+       xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
+       xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
+       data-namespace-typo3-fluid="true">
 <h1><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.title" /></h1>
 
-<div class="table-fit">
-    <table class="table table-striped table-hover table-condensed">
-        <thead>
-        <tr>
-            <th><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.site" /></th>
-            <th><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.configuration" /></th>
-            <th><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.baseUrl" /></th>
-            <th>&nbsp;</th>
-        </tr>
-        </thead>
-        <tbody>
-        <f:for each="{pages}" as="page">
-            <tr>
-                <td nowrap valign="top">
-                    <f:for each="{page.rootline}" as="rootLinePage" iteration="i">
-                        <span style="width: 1px; height: 1px; display:inline-block; margin-left: {rootLinePage.margin}px"></span>
-                        <f:if condition="{rootLinePage.uid} == {page.uid}">
-                            <f:then>
-                                <a href="#" class="t3js-contextmenutrigger" data-table="pages" data-uid="{rootLinePage.uid}">
-                                    <core:iconForRecord table="pages" row="{rootLinePage}" />
-                                </a> {rootLinePage.title} [ID: {page.uid}]
-                            </f:then>
-                            <f:else>
-                                <core:iconForRecord table="pages" row="{rootLinePage}" />
-                                {rootLinePage.title}<br>
-                            </f:else>
-                        </f:if>
-                    </f:for>
-                </td>
-                <td>
-                    <f:if condition="{page.siteIdentifier}">
-                        <f:then>
-                            <code>{page.siteIdentifier}</code>
-                        </f:then>
-                        <f:else>
-                            <div>
-                                <f:be.link route="site_configuration" parameters="{action: 'edit', pageUid: page.uid}" title="Create configuration" class="btn btn-primary">
-                                    <f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.addSiteConfiguration" />
-                                </f:be.link>
-                            </div>
-                        </f:else>
-                    </f:if>
-                </td>
-                <td>
-                    <f:if condition="{page.siteConfiguration}">
-                        <table class="table table-striped table-no-borders">
-                            <tr>
-                                <th>Language Name</th>
-                                <th>Full URL Prefix</th>
-                            </tr>
-                        <f:for each="{page.siteConfiguration.languages}" as="siteLanguage">
-                            <tr>
-                                <td><core:icon identifier="flags-{siteLanguage.flagIdentifier}" /> {siteLanguage.title}</td>
-                                <td><a href="{siteLanguage.base}" target="_blank">{siteLanguage.base}</a></td>
-                            </tr>
-                        </f:for>
-                        </table>
-                    </f:if>
-                </td>
-                <td>
-                    <div class="btn-group">
-                        <f:if condition="{page.siteIdentifier}">
-                            <f:be.link route="site_configuration" parameters="{action: 'edit', site: page.siteIdentifier}" title="Edit" class="btn btn-default">
-                                <core:icon identifier="actions-open" />
-                            </f:be.link>
-                            <f:be.link route="site_configuration" parameters="{action: 'delete', site:page.siteIdentifier}" title="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.deleteSiteConfiguration')}" class="btn btn-default t3js-modal-trigger"
-                                       data="{
-                                            toggle:'tooltip',
-                                            severity: 'error',
-                                            title:'{f:translate(key:\'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.deleteSiteConfiguration\')}',
-                                            button-ok-text:'{f:translate(key:\'LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:button.delete\')}'
-                                            }">
-                                <core:icon identifier="actions-delete" />
-                            </f:be.link>
-                        </f:if>
-                    </div>
-                </td>
-            </tr>
-        </f:for>
-        </tbody>
-    </table>
-    </div>
+<f:if condition="{pages}">
+       <f:then>
+               <div class="table-fit">
+                       <table class="table table-striped table-hover table-condensed">
+                               <thead>
+                               <tr>
+                                       <th><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.site" /></th>
+                                       <th><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.configuration" /></th>
+                                       <th><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.baseUrl" /></th>
+                                       <th>&nbsp;</th>
+                               </tr>
+                               </thead>
+                               <tbody>
+                               <f:for each="{pages}" as="page">
+                                       <tr>
+                                               <td nowrap valign="top">
+                                                       <f:for each="{page.rootline}" as="rootLinePage" iteration="i">
+                                                               <span style="width: 1px; height: 1px; display:inline-block; margin-left: {rootLinePage.margin}px"></span>
+                                                               <f:if condition="{rootLinePage.uid} == {page.uid}">
+                                                                       <f:then>
+                                                                               <a href="#" class="t3js-contextmenutrigger" data-table="pages" data-uid="{rootLinePage.uid}">
+                                                                                       <core:iconForRecord table="pages" row="{rootLinePage}" />
+                                                                               </a> {rootLinePage.title} [ID: {page.uid}]
+                                                                       </f:then>
+                                                                       <f:else>
+                                                                               <core:iconForRecord table="pages" row="{rootLinePage}" />
+                                                                               {rootLinePage.title}<br>
+                                                                       </f:else>
+                                                               </f:if>
+                                                       </f:for>
+                                               </td>
+                                               <td>
+                                                       <f:if condition="{page.siteIdentifier}">
+                                                               <f:then>
+                                                                       <code>{page.siteIdentifier}</code>
+                                                               </f:then>
+                                                               <f:else>
+                                                                       <div>
+                                                                               <f:be.link route="site_configuration" parameters="{action: 'edit', pageUid: page.uid}" title="Create configuration" class="btn btn-primary">
+                                                                                       <f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.addSiteConfiguration" />
+                                                                               </f:be.link>
+                                                                       </div>
+                                                               </f:else>
+                                                       </f:if>
+                                               </td>
+                                               <td>
+                                                       <f:if condition="{page.siteConfiguration}">
+                                                               <table class="table table-striped table-no-borders">
+                                                                       <tr>
+                                                                               <th>Language Name</th>
+                                                                               <th>Full URL Prefix</th>
+                                                                       </tr>
+                                                               <f:for each="{page.siteConfiguration.languages}" as="siteLanguage">
+                                                                       <tr>
+                                                                               <td><core:icon identifier="flags-{siteLanguage.flagIdentifier}" /> {siteLanguage.title}</td>
+                                                                               <td><a href="{siteLanguage.base}" target="_blank">{siteLanguage.base}</a></td>
+                                                                       </tr>
+                                                               </f:for>
+                                                               </table>
+                                                       </f:if>
+                                               </td>
+                                               <td>
+                                                       <div class="btn-group">
+                                                               <f:if condition="{page.siteIdentifier}">
+                                                                       <f:be.link route="site_configuration" parameters="{action: 'edit', site: page.siteIdentifier}" title="Edit" class="btn btn-default">
+                                                                               <core:icon identifier="actions-open" />
+                                                                       </f:be.link>
+                                                                       <f:be.link route="site_configuration" parameters="{action: 'delete', site:page.siteIdentifier}" title="Delete configuration" class="btn btn-default">
+                                                                               <core:icon identifier="actions-delete" />
+                                                                       </f:be.link>
+                                                               </f:if>
+                                                       </div>
+                                               </td>
+                                       </tr>
+                               </f:for>
+                               </tbody>
+                       </table>
+               </div>
+       </f:then>
+       <f:else>
+               <f:be.infobox state="-1" title="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.noPages.title')}">
+                       <p><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.noPages.message"/></p>
+               </f:be.infobox>
+       </f:else>
+</f:if>
 </html>