From adabc623f67eed8ae0e00d912be9480c6b8cb3ad Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Tue, 21 Apr 2015 09:24:00 +1200 Subject: [PATCH] Updated for new GridField API --- code/admin/CommentsGridField.php | 27 ++++++--------------------- css/Comments.css | 6 +++++- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/code/admin/CommentsGridField.php b/code/admin/CommentsGridField.php index 94c307b..b434820 100644 --- a/code/admin/CommentsGridField.php +++ b/code/admin/CommentsGridField.php @@ -1,33 +1,18 @@ IsSpam) { + $attributes['class'] .= ' spam'; } - $classes[] = ($index % 2) ? 'even' : 'odd'; - - if ($record->IsSpam) { - $classes[] = 'spam'; - } - - $attributes = array( - 'class' => implode(' ', $classes), - 'data-id' => $record->ID, - 'data-class' => $record->ClassName, - ); - return FormField::create_tag( 'tr', $attributes, diff --git a/css/Comments.css b/css/Comments.css index 63f9284..63d6cac 100644 --- a/css/Comments.css +++ b/css/Comments.css @@ -1,3 +1,7 @@ .cms table.ss-gridfield-table tr.spam { - background-color: #FFD8D8 ; + background-color: #FFD8D8; +} + +.cms table.ss-gridfield-table tr.spam:hover { + background-color: #FFF2F2; }