Merge pull request #2212 from creative-commoners/pulls/4.1/revert-button-class

FIX Restore button now has warning colour and correct icon
This commit is contained in:
Loz Calver 2018-07-13 09:28:21 +01:00 committed by GitHub
commit 9dce915d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -2267,7 +2267,11 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
// "restore"
if ($canEdit && !$isOnDraft && $isPublished) {
$majorActions->push(FormAction::create('revert', _t('SilverStripe\\CMS\\Controllers\\CMSMain.RESTORE', 'Restore')));
$majorActions->push(
FormAction::create('revert', _t('SilverStripe\\CMS\\Controllers\\CMSMain.RESTORE', 'Restore'))
->addExtraClass('btn-warning font-icon-back-in-time')
->setUseButtonTag(true)
);
}
// Check if we can restore a deleted page

View File

@ -218,7 +218,7 @@ class CMSMainTest extends FunctionalTest
$this->assertTrue($livePage->canDelete());
// Check that the 'restore' button exists as a simple way of checking that the correct page is returned.
$this->assertRegExp('/<input type="submit"[^>]+name="action_(restore|revert)"/i', $response->getBody());
$this->assertRegExp('/<button type="submit"[^>]+name="action_(restore|revert)"/i', $response->getBody());
}
/**