mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
NEW Convert page history notice to use Bootstrap 4 info alert
This commit is contained in:
parent
1d67f75dc8
commit
b084fe8177
@ -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')))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<div class="message $Classes">
|
<div class="$Classes">
|
||||||
<p>$Content</p>
|
$Content
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user