Display a 'Modified' tag in the State column for modified pages

This commit is contained in:
James Cocker 2014-06-12 20:42:32 +01:00
parent 17762568cf
commit b380f4ac11
4 changed files with 28 additions and 1 deletions

View File

@ -33,3 +33,14 @@
float: left;
margin-right: 6px;
}
/* line 42, ../scss/cms.scss */
.cms table.ss-gridfield-table tr td .modified {
margin-left: 5px;
color: #7E7470;
background-color: #fff0bc;
padding: 1px 3px;
border: 1px solid #C9B800;
font-size: 80%;
border-radius: 3px;
text-transform: uppercase;
}

View File

@ -29,6 +29,11 @@ class GridFieldBlogPostState implements GridField_ColumnProvider {
public function getColumnContent($gridField, $record, $columnName) {
if($columnName == "State") {
if($record->hasMethod("isPublished")) {
$modifiedLabel = "";
if($record->isModified()) {
$modifiedLabel = "<span class='modified'>"._t("GridFieldBlogPostState.Modified")."</span>";
}
$published = $record->isPublished();
if(!$published) {
return _t("GridFieldBlogPostState.Draft",
@ -49,7 +54,7 @@ class GridFieldBlogPostState implements GridField_ColumnProvider {
array(
"date" => $record->dbObject("PublishDate")->Nice()
)
);
).$modifiedLabel;
}
}
}

View File

@ -9,6 +9,7 @@ en:
Draft: '<i class="btn-icon blog-icon btn-icon-pencil"></i> Saved as Draft'
Published: '<i class="btn-icon blog-icon btn-icon-accept"></i> Published on {date}'
Timer: '<i class="blog-icon blog-icon-timer"></i> Publish at {date}'
Modified: 'Modified'
BlogPost:
PublishDate: 'Publish Date'
Categories: 'Categories'

View File

@ -39,6 +39,16 @@
float: left;
margin-right: 6px;
}
.modified {
margin-left: 5px;
color: #7E7470;
background-color: #fff0bc;
padding: 1px 3px;
border: 1px solid #C9B800;
font-size: 80%;
border-radius: 3px;
text-transform: uppercase;
}
}
}
}