mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Display a 'Modified' tag in the State column for modified pages
This commit is contained in:
parent
17762568cf
commit
b380f4ac11
11
css/cms.css
11
css/cms.css
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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'
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user