mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge pull request #697 from halkyon/cms_showing_latest_version_message
Page history panel: show appropriate message when viewing latest version
This commit is contained in:
commit
a196933e05
@ -142,13 +142,16 @@ class CMSPageHistoryController extends CMSMain {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$revert->setReadonly(true);
|
$revert->setReadonly(true);
|
||||||
}
|
} else {
|
||||||
else {
|
if($record->isLatestVersion()) {
|
||||||
$message = _t(
|
$message = _t('CMSPageHistoryController.VIEWINGLATEST', 'Currently viewing the latest version.');
|
||||||
'CMSPageHistoryController.VIEWINGVERSION',
|
} else {
|
||||||
"Currently viewing version {version}.",
|
$message = _t(
|
||||||
array('version' => $versionID)
|
'CMSPageHistoryController.VIEWINGVERSION',
|
||||||
);
|
"Currently viewing version {version}.",
|
||||||
|
array('version' => $versionID)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields->addFieldToTab('Root.Main',
|
$fields->addFieldToTab('Root.Main',
|
||||||
|
@ -52,7 +52,7 @@ class CMSPageHistoryControllerTest extends FunctionalTest {
|
|||||||
$this->assertEquals($this->versionPublishCheck2, $form->Fields()->dataFieldByName('Version')->Value());
|
$this->assertEquals($this->versionPublishCheck2, $form->Fields()->dataFieldByName('Version')->Value());
|
||||||
|
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
sprintf("Currently viewing version %s.", $this->versionPublishCheck2),
|
'Currently viewing the latest version',
|
||||||
$form->Fields()->fieldByName('Root.Main.CurrentlyViewingMessage')->getContent()
|
$form->Fields()->fieldByName('Root.Main.CurrentlyViewingMessage')->getContent()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user