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
);
$view = _t('SilverStripe\\CMS\\Controllers\\CMSPageHistoryController.VIEW', "view");
$view = _t(__CLASS__ . '.VIEW', "view");
$message = _t(
'SilverStripe\\CMS\\Controllers\\CMSPageHistoryController.COMPARINGVERSION',
__CLASS__ . '.COMPARINGVERSION',
"Comparing versions {version1} and {version2}.",
array(
'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);
} else {
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 {
$message = _t(
'SilverStripe\\CMS\\Controllers\\CMSPageHistoryController.VIEWINGVERSION',
__CLASS__ . '.VIEWINGVERSION',
"Currently viewing version {version}.",
array('version' => $versionID)
);
@ -247,9 +247,9 @@ class CMSPageHistoryController extends CMSMain
/** @var Tab $mainTab */
$mainTab = $fields->fieldByName('Root.Main');
$mainTab->unshift(
new LiteralField('CurrentlyViewingMessage', ArrayData::create(array(
LiteralField::create('CurrentlyViewingMessage', ArrayData::create(array(
'Content' => DBField::create_field('HTMLFragment', $message),
'Classes' => 'notice'
'Classes' => 'alert alert-info'
))->renderWith($this->getTemplatesWithSuffix('_notice')))
);

View File

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