From b37ad24930ec0c52b3a38925807913dcf3bcdbab Mon Sep 17 00:00:00 2001 From: Raissa North Date: Wed, 24 Jan 2018 16:28:12 +1300 Subject: [PATCH 1/4] FIX Replace jQuery UI icons with admin font icons --- src/Forms/GridField/GridFieldBlogPostState.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Forms/GridField/GridFieldBlogPostState.php b/src/Forms/GridField/GridFieldBlogPostState.php index 58b8e95..8c9cd43 100644 --- a/src/Forms/GridField/GridFieldBlogPostState.php +++ b/src/Forms/GridField/GridFieldBlogPostState.php @@ -5,6 +5,7 @@ namespace SilverStripe\Blog\Forms\GridField; use SilverStripe\Blog\Model\BlogPost; use SilverStripe\Core\Manifest\ModuleLoader; use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeState; +use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\View\Requirements; /** @@ -20,7 +21,7 @@ class GridFieldBlogPostState extends GridFieldSiteTreeState public function getColumnContent($gridField, $record, $columnName) { if ($columnName == 'State') { - Requirements::css(ModuleLoader::getModule('silverstripe/blog')->getRelativeResourcePath('css/cms.css')); + Requirements::css('silverstripe/blog:css/cms.css'); if ($record instanceof BlogPost) { $modifiedLabel = ''; @@ -30,11 +31,11 @@ class GridFieldBlogPostState extends GridFieldSiteTreeState if (!$record->isPublished()) { /** - * @var SS_Datetime $lastEdited + * @var DBDatetime $lastEdited */ $lastEdited = $record->dbObject('LastEdited'); - return ' ' . _t( + return ' ' . _t( __CLASS__ . '.Draft', 'Saved as Draft on {date}', 'State for when a post is saved.', @@ -45,12 +46,12 @@ class GridFieldBlogPostState extends GridFieldSiteTreeState } /** - * @var SS_Datetime $publishDate + * @var DBDatetime $publishDate */ $publishDate = $record->dbObject('PublishDate'); if (strtotime($record->PublishDate) > time()) { - return ' ' . _t( + return ' ' . _t( __CLASS__ . '.Timer', 'Publish at {date}', 'State for when a post is published.', @@ -60,7 +61,7 @@ class GridFieldBlogPostState extends GridFieldSiteTreeState ) . $modifiedLabel; } - return ' ' . _t( + return ' ' . _t( __CLASS__ . '.Published', 'Published on {date}', 'State for when a post is published.', From f38630c89488895f5aee42fd6d421dea8d6ff225 Mon Sep 17 00:00:00 2001 From: Raissa North Date: Wed, 24 Jan 2018 16:54:54 +1300 Subject: [PATCH 2/4] FIX Auto publish a Member's profile image when saving --- src/Model/BlogMemberExtension.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Model/BlogMemberExtension.php b/src/Model/BlogMemberExtension.php index 0b9ce60..45da9e7 100644 --- a/src/Model/BlogMemberExtension.php +++ b/src/Model/BlogMemberExtension.php @@ -59,6 +59,11 @@ class BlogMemberExtension extends DataExtension $this->owner->URLSegment = preg_replace('/-[0-9]+$/', null, $this->owner->URLSegment) . '-' . $count; $count++; } + + // Auto publish profile images + if ($this->owner->BlogProfileImage() && $this->owner->BlogProfileImage()->exists()) { + $this->owner->BlogProfileImage()->publishSingle(); + } } /** From dd66125f3a7a7a261597bbe6f84b82e68d9d2cb8 Mon Sep 17 00:00:00 2001 From: Raissa North Date: Wed, 24 Jan 2018 16:57:09 +1300 Subject: [PATCH 3/4] FIX Remove timer icon image and associated CSS styles --- css/cms.css | 3 --- images/blog-icon/timer.png | Bin 844 -> 0 bytes scss/cms.scss | 4 ---- 3 files changed, 7 deletions(-) delete mode 100755 images/blog-icon/timer.png diff --git a/css/cms.css b/css/cms.css index a97b476..beb7395 100755 --- a/css/cms.css +++ b/css/cms.css @@ -7,9 +7,6 @@ /* * Sprite maps & Icons */ -.gridfield-icon.blog-icon-timer { - background: url("../images/blog-icon/timer.png") center no-repeat; } - #FeaturedImage .middleColumn { clear: none; float: left; } diff --git a/images/blog-icon/timer.png b/images/blog-icon/timer.png deleted file mode 100755 index 9a668f638a469f66b87cf0c18cde7dc01439e278..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 844 zcmV-S1GD^zP)gZM<3kO-b&(&TOb%ONeM|z_E%Z zh%NQ4rQ6eB48~xkjNzU-*w~n&s1)%JzDNgsnq@vXEVM{ls0GoaW=);59sR4#Z8O@T ziLsX?#|PIyY5l^1bKrMA=lst1dxVsdt#mvR`8Y4cUI10fse!@4(XHx~^@$KdG&MC< zt*;BvA)s48cL6%KJOvO^N`w$15{X<9LWG`I1;0#H)&D3J$9~&Yxf8%;uRaxpTztn$ z?5F!Ty5gGv;c$45swl&GwKVr<=!~n<4ElL=W0V=U*B^Dz$y>6 zE&GlHTm5MaLq|~*5{U$sWudAns;Z(W3WlN6>QA%mI})_YgKb3@GMYc&%T5xiHqmt* zAp}j0jr8~TuRDYg0$tY$Rh#&-lVmi1pa`&?m8Q2~kuT(n8?cthP0w(x^Ly-(QOIWB zw1dQ3u&|w#CV=CAn--F44MMCGdsa+?uTK5K#KZ(nzn`@SQK+auN=Z^R(CoQ|;tf2R znMcd+-HeV;lT0Ryk0zxg5D0*#;XK?x>fI_v$ER6#@5Ymvc~k_HEk%31i-Yl7DU;c` zdGh)EmSc8qo?9ss@8V#*Y$@8iF$ZnmwoKM`{CbG^JFWgS$HNU9axgG-m*3|++++WX z>c^KpkM(xl+yDRwes=nsMYHickK48Lp!gfZZ3D2FbrF>{q_g%@<5~atL{I0%O-Wo= zeM@`of7=iKytd8zVMg2aK7f{)pDlU0^rYh7=nt`*R~~Qr3vW|69QFYW4Gmdut9cC* W);r5QBhY{V0000 Date: Thu, 25 Jan 2018 08:46:05 +1300 Subject: [PATCH 4/4] FIX Use clock icon for scheduled posts --- src/Forms/GridField/GridFieldBlogPostState.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forms/GridField/GridFieldBlogPostState.php b/src/Forms/GridField/GridFieldBlogPostState.php index 8c9cd43..4b5a4de 100644 --- a/src/Forms/GridField/GridFieldBlogPostState.php +++ b/src/Forms/GridField/GridFieldBlogPostState.php @@ -51,7 +51,7 @@ class GridFieldBlogPostState extends GridFieldSiteTreeState $publishDate = $record->dbObject('PublishDate'); if (strtotime($record->PublishDate) > time()) { - return ' ' . _t( + return ' ' . _t( __CLASS__ . '.Timer', 'Publish at {date}', 'State for when a post is published.',