FIX Show 'No preview available' message for pages with no state

This accompanies a logic patch in the admin module to ensure that when
no preview state is available for a pagetype, it renders a message
stating this. Previously a broken layout would appear instead.
This commit is contained in:
Steve Boyd 2021-06-23 12:04:17 +12:00
parent 4c8823f218
commit 9d77ff3b90
3 changed files with 6 additions and 3 deletions

View File

@ -19,7 +19,7 @@
} }
], ],
"require": { "require": {
"silverstripe/admin": "^1.7@dev", "silverstripe/admin": "^1.9@dev",
"silverstripe/campaign-admin": "^1.7@dev", "silverstripe/campaign-admin": "^1.7@dev",
"silverstripe/framework": "^4.7@dev", "silverstripe/framework": "^4.7@dev",
"silverstripe/reports": "^4.7@dev", "silverstripe/reports": "^4.7@dev",

View File

@ -83,6 +83,7 @@ en:
MENUTITLE: History MENUTITLE: History
MULTISELECT: 'Batch actions' MULTISELECT: 'Batch actions'
NOTPUBLISHED: 'Not published' NOTPUBLISHED: 'Not published'
NO_PREVIEW: 'No preview available'
PREVIEW: 'Website preview' PREVIEW: 'Website preview'
PUBLISHER: Publisher PUBLISHER: Publisher
REVERTTOTHISVERSION: 'Revert to this version' REVERTTOTHISVERSION: 'Revert to this version'

View File

@ -1,6 +1,9 @@
<div class="cms-preview fill-height flexbox-area-grow" data-layout-type="border"> <div class="cms-preview fill-height flexbox-area-grow" data-layout-type="border">
<div class="panel flexbox-area-grow fill-height"> <div class="panel flexbox-area-grow fill-height">
<div class="preview-note"><span><!-- --></span><%t SilverStripe\CMS\Controllers\CMSPageHistoryController.PREVIEW 'Website preview' %></div> <div class="preview-note">
<div class="icon font-icon-monitor display-1"></div>
<%t SilverStripe\CMS\Controllers\CMSPageHistoryController.NO_PREVIEW 'No preview available' %>
</div>
<div class="preview__device"> <div class="preview__device">
<div class="preview-device-outer"> <div class="preview-device-outer">
<div class="preview-device-inner"> <div class="preview-device-inner">
@ -10,5 +13,4 @@
</div> </div>
</div> </div>
<div class="toolbar toolbar--south cms-content-controls cms-preview-controls"></div> <div class="toolbar toolbar--south cms-content-controls cms-preview-controls"></div>
<div class="cms-preview-overlay ui-widget-overlay-light"></div>
</div> </div>