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:
Ingo Schommer 2013-05-07 15:02:17 -07:00
commit a196933e05
2 changed files with 11 additions and 8 deletions

View File

@ -142,13 +142,16 @@ class CMSPageHistoryController extends CMSMain {
);
$revert->setReadonly(true);
}
else {
$message = _t(
'CMSPageHistoryController.VIEWINGVERSION',
"Currently viewing version {version}.",
array('version' => $versionID)
);
} else {
if($record->isLatestVersion()) {
$message = _t('CMSPageHistoryController.VIEWINGLATEST', 'Currently viewing the latest version.');
} else {
$message = _t(
'CMSPageHistoryController.VIEWINGVERSION',
"Currently viewing version {version}.",
array('version' => $versionID)
);
}
}
$fields->addFieldToTab('Root.Main',

View File

@ -52,7 +52,7 @@ class CMSPageHistoryControllerTest extends FunctionalTest {
$this->assertEquals($this->versionPublishCheck2, $form->Fields()->dataFieldByName('Version')->Value());
$this->assertContains(
sprintf("Currently viewing version %s.", $this->versionPublishCheck2),
'Currently viewing the latest version',
$form->Fields()->fieldByName('Root.Main.CurrentlyViewingMessage')->getContent()
);