Merge pull request #19 from purplespider/modified-state

Display a 'Modified' tag in the State column for modified pages
This commit is contained in:
Michael Strong 2014-06-13 13:25:41 +01:00
commit b894e0e31c
4 changed files with 29 additions and 2 deletions

View File

@ -33,3 +33,14 @@
float: left; float: left;
margin-right: 6px; 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) { public function getColumnContent($gridField, $record, $columnName) {
if($columnName == "State") { if($columnName == "State") {
if($record->hasMethod("isPublished")) { if($record->hasMethod("isPublished")) {
$modifiedLabel = "";
if($record->isModified()) {
$modifiedLabel = "<span class='modified'>" . _t("GridFieldBlogPostState.Modified") . "</span>";
}
$published = $record->isPublished(); $published = $record->isPublished();
if(!$published) { if(!$published) {
return _t("GridFieldBlogPostState.Draft", return _t("GridFieldBlogPostState.Draft",
@ -40,7 +45,7 @@ class GridFieldBlogPostState implements GridField_ColumnProvider {
"State for when a post is published.", array( "State for when a post is published.", array(
"date" => $record->dbObject("PublishDate")->Nice() "date" => $record->dbObject("PublishDate")->Nice()
) )
); ) . $modifiedLabel;
} else { } else {
return _t( return _t(
"GridFieldBlogPostState.Published", "GridFieldBlogPostState.Published",
@ -49,7 +54,7 @@ class GridFieldBlogPostState implements GridField_ColumnProvider {
array( array(
"date" => $record->dbObject("PublishDate")->Nice() "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' 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}' 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}' Timer: '<i class="blog-icon blog-icon-timer"></i> Publish at {date}'
Modified: 'Modified'
BlogPost: BlogPost:
PublishDate: 'Publish Date' PublishDate: 'Publish Date'
Categories: 'Categories' Categories: 'Categories'

View File

@ -39,6 +39,16 @@
float: left; float: left;
margin-right: 6px; 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;
}
} }
} }
} }