From e80c7e712b916712d4ec7b6b8359ccf71dc9da04 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Fri, 13 Jul 2018 10:59:28 +1200 Subject: [PATCH] FIX Restore button now has warning colour and correct icon --- code/Model/SiteTree.php | 6 +++++- tests/php/Controllers/CMSMainTest.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/Model/SiteTree.php b/code/Model/SiteTree.php index a3815a8a..f9e1a72c 100755 --- a/code/Model/SiteTree.php +++ b/code/Model/SiteTree.php @@ -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 diff --git a/tests/php/Controllers/CMSMainTest.php b/tests/php/Controllers/CMSMainTest.php index bec418aa..3056cb31 100644 --- a/tests/php/Controllers/CMSMainTest.php +++ b/tests/php/Controllers/CMSMainTest.php @@ -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('/]+name="action_(restore|revert)"/i', $response->getBody()); + $this->assertRegExp('/