NEW Convert page history notice to use Bootstrap 4 info alert

This commit is contained in:
Robbie Averill 2018-02-07 16:47:24 +13:00
parent 1d67f75dc8
commit b084fe8177
2 changed files with 8 additions and 8 deletions

View File

@ -220,10 +220,10 @@ class CMSPageHistoryController extends CMSMain
$id $id
); );
$view = _t('SilverStripe\\CMS\\Controllers\\CMSPageHistoryController.VIEW', "view"); $view = _t(__CLASS__ . '.VIEW', "view");
$message = _t( $message = _t(
'SilverStripe\\CMS\\Controllers\\CMSPageHistoryController.COMPARINGVERSION', __CLASS__ . '.COMPARINGVERSION',
"Comparing versions {version1} and {version2}.", "Comparing versions {version1} and {version2}.",
array( array(
'version1' => sprintf('%s (<a href="%s">%s</a>)', $versionID, Controller::join_links($link, $versionID), $view), 'version1' => sprintf('%s (<a href="%s">%s</a>)', $versionID, Controller::join_links($link, $versionID), $view),
@ -234,10 +234,10 @@ class CMSPageHistoryController extends CMSMain
$revert->setReadonly(true); $revert->setReadonly(true);
} else { } else {
if ($record->isLatestVersion()) { if ($record->isLatestVersion()) {
$message = _t('SilverStripe\\CMS\\Controllers\\CMSPageHistoryController.VIEWINGLATEST', 'Currently viewing the latest version.'); $message = _t(__CLASS__ . '.VIEWINGLATEST', 'Currently viewing the latest version.');
} else { } else {
$message = _t( $message = _t(
'SilverStripe\\CMS\\Controllers\\CMSPageHistoryController.VIEWINGVERSION', __CLASS__ . '.VIEWINGVERSION',
"Currently viewing version {version}.", "Currently viewing version {version}.",
array('version' => $versionID) array('version' => $versionID)
); );
@ -247,9 +247,9 @@ class CMSPageHistoryController extends CMSMain
/** @var Tab $mainTab */ /** @var Tab $mainTab */
$mainTab = $fields->fieldByName('Root.Main'); $mainTab = $fields->fieldByName('Root.Main');
$mainTab->unshift( $mainTab->unshift(
new LiteralField('CurrentlyViewingMessage', ArrayData::create(array( LiteralField::create('CurrentlyViewingMessage', ArrayData::create(array(
'Content' => DBField::create_field('HTMLFragment', $message), 'Content' => DBField::create_field('HTMLFragment', $message),
'Classes' => 'notice' 'Classes' => 'alert alert-info'
))->renderWith($this->getTemplatesWithSuffix('_notice'))) ))->renderWith($this->getTemplatesWithSuffix('_notice')))
); );

View File

@ -1,3 +1,3 @@
<div class="message $Classes"> <div class="$Classes">
<p>$Content</p> $Content
</div> </div>