From 330401683a7a56b9981641601efa17517453fe29 Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Thu, 9 Apr 2015 13:03:16 +1200 Subject: [PATCH] Added role help --- code/model/Blog.php | 41 ++++++++++++++++++++-- css/cms.css | 69 +++++++++++++++++++++++++++---------- images/information.png | Bin 0 -> 778 bytes js/expandable-help-text.js | 49 ++++++++++++++++++++++++++ scss/cms.scss | 33 ++++++++++++++++-- 5 files changed, 167 insertions(+), 25 deletions(-) create mode 100755 images/information.png create mode 100644 js/expandable-help-text.js diff --git a/code/model/Blog.php b/code/model/Blog.php index 99180e0..8381cda 100644 --- a/code/model/Blog.php +++ b/code/model/Blog.php @@ -79,6 +79,10 @@ class Blog extends Page implements PermissionProvider { private static $description = 'Adds a blog to your website.'; public function getCMSFields() { + Requirements::css(BLOGGER_DIR . '/css/cms.css'); + + Requirements::javascript(BLOGGER_DIR . '/js/expandable-help-text.js'); + $self =& $this; $this->beforeUpdateCMSFields(function($fields) use ($self) { @@ -260,7 +264,19 @@ class Blog extends Page implements PermissionProvider { // Editors $editorField = ListboxField::create('Editors', 'Editors', $members) ->setMultiple(true) - ->setDescription('Editors are able to manage this blog and its posts'); + ->setRightTitle('help') + ->setDescription(' + An editor has control over specific Blogs, and all posts included within it. Short of being able to assign other editors to a blog, they are able to handle most changes assigned to their section.
+
+ Editors have these permissions:
+
+ Update or publish any BlogPost in their Blog
+ Update or publish their Blog
+ Assign/unassign writers to their Blog
+ Assign/unassign contributors to their Blog
+ Assign/unassign any member as an author of a particular BlogPost + '); + if(!$this->canEditEditors()) { $editorField = $editorField->performDisabledTransformation(); } @@ -268,7 +284,17 @@ class Blog extends Page implements PermissionProvider { // Writers $writerField = ListboxField::create('Writers', 'Writers', $members) ->setMultiple(true) - ->setDescription('Writers are able to write and publish posts'); + ->setRightTitle('help') + ->setDescription(' + A writer has control over specific BlogPosts. They are able to handle many changes to the BlogPost they are assigned to.
+
+ Writers have these permissions:
+
+ Update or publish any BlogPost to which they are assigned
+ Assign/unassign contributors to their Blog
+ Assign/unassign any member as an author of a particular BlogPost + '); + if(!$this->canEditWriters()) { $writerField = $writerField->performDisabledTransformation(); } @@ -276,7 +302,16 @@ class Blog extends Page implements PermissionProvider { // Contributors $contributorField = ListboxField::create('Contributors', 'Contributors', $members) ->setMultiple(true) - ->setDescription('Contributors are able to write, but not publish, posts'); + ->setRightTitle('help') + ->setDescription(' + A contributor has control over specific BlogPosts. They are able to contribute but not publish or remove BlogPosts.
+
+ Contributors have these permissions:
+
+ Update any BlogPost to which they are assigned
+ Assign/unassign any member as an author of a particular BlogPost + '); + if(!$this->canEditContributors()) { $contributorField = $contributorField->performDisabledTransformation(); } diff --git a/css/cms.css b/css/cms.css index 89bed44..727fd8e 100755 --- a/css/cms.css +++ b/css/cms.css @@ -1,28 +1,30 @@ /** * CMS Styles -**/ + */ /** - * Include Compass framework */ + * Include Compass framework + */ /* - * Sprite maps & Icons */ + * Sprite maps & Icons + */ /* line 48, blog-icon/*.png */ .blog-icon-sprite, .gridfield-icon .blog-icon-timer { background-image: url('../images/blog-icon-s0a5ab5f851.png'); background-repeat: no-repeat; } -/* line 84, ../../../../home/vagrant/.rvm/gems/ruby-2.1.5/gems/compass-core-1.0.1/stylesheets/compass/utilities/sprites/_base.scss */ +/* line 84, ../../../../../../../usr/local/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/utilities/sprites/_base.scss */ .gridfield-icon .blog-icon-timer { background-position: 0 0; } -/* line 18, ../scss/cms.scss */ +/* line 20, ../scss/cms.scss */ #FeaturedImage .middleColumn { clear: none; float: left; } -/* line 23, ../scss/cms.scss */ +/* line 25, ../scss/cms.scss */ .blog-admin-sidebar { width: 280px; border-right: none; @@ -32,11 +34,11 @@ bottom: 0px; height: 100%; } -/* line 32, ../scss/cms.scss */ +/* line 34, ../scss/cms.scss */ .blog-admin-sidebar .cms-panel-toggle a { text-align: left; } -/* line 36, ../scss/cms.scss */ +/* line 38, ../scss/cms.scss */ .blog-admin-sidebar ~ .blog-admin-outer { width: 100%; padding-right: 280px; @@ -46,54 +48,83 @@ overflow-x: hidden; box-sizing: border-box; } -/* line 45, ../scss/cms.scss */ +/* line 47, ../scss/cms.scss */ .blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset { position: relative; overflow: auto; height: 100%; width: 100%; } -/* line 52, ../scss/cms.scss */ +/* line 54, ../scss/cms.scss */ .blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset #Title label { float: none; } -/* line 55, ../scss/cms.scss */ +/* line 57, ../scss/cms.scss */ .blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset #Title .middleColumn, .blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset #Title input { width: 100%; max-width: 100%; margin-left: 0; } -/* line 66, ../scss/cms.scss */ +/* line 68, ../scss/cms.scss */ .blog-admin-sidebar .cms-content-view > .field + .field { margin-top: 10px; } -/* line 71, ../scss/cms.scss */ +/* line 73, ../scss/cms.scss */ .blog-admin-sidebar .cms-content-view > .field.urlsegment .preview { padding-top: 0; line-height: 25px; } -/* line 76, ../scss/cms.scss */ +/* line 78, ../scss/cms.scss */ .blog-admin-sidebar .cms-content-view > .field.urlsegment .edit { float: right; } -/* line 83, ../scss/cms.scss */ +/* line 85, ../scss/cms.scss */ .blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn > .date { width: 60%; } -/* line 87, ../scss/cms.scss */ +/* line 89, ../scss/cms.scss */ .blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn > .time { width: 36%; float: right; } -/* line 92, ../scss/cms.scss */ +/* line 94, ../scss/cms.scss */ .blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn .middleColumn, .blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn input { width: 100%; } -/* line 101, ../scss/cms.scss */ +/* line 103, ../scss/cms.scss */ .blog-admin-sidebar.collapsed ~ .blog-admin-outer { padding-right: 41px; } -/* line 107, ../scss/cms.scss */ +/* line 109, ../scss/cms.scss */ .blog-admin-sidebar.cms-content-tools .cms-panel-content { width: auto; } + +/* line 115, ../scss/cms.scss */ +.toggle-description { + text-indent: -1000000px; + display: inline-block; + background: url("../images/information.png") no-repeat center center; + width: 20px; + height: 20px; + margin-left: 4px; +} + +/* line 124, ../scss/cms.scss */ +.toggle-description-correct-middle { + margin-left: 0 !important; + float: left !important; + width: 416px !important; +} + +/* line 130, ../scss/cms.scss */ +.toggle-description-correct-right { + display: inline-block !important; + margin-left: 0 !important; + clear: none !important; +} + +/* line 136, ../scss/cms.scss */ +.toggle-description-correct-description { + width: 416px !important; +} diff --git a/images/information.png b/images/information.png new file mode 100755 index 0000000000000000000000000000000000000000..12cd1aef900803abba99b26920337ec01ad5c267 GIT binary patch literal 778 zcmV+l1NHogP)BVme|mWaqy4$_pJm?y9KM{-*hp?1+Ey3e-CEDooTa!B;e(Q>TSF?bj>5At13y1p zriN3w3x~5SfZj{@J4M{kp{?=M_Lh2bV+5LH)Q)5W!-ePA$RgE1@5f1cyHki0Y}JyVEYZF(LD$xXlt$7A5CgE@ zpV-&l%vf;=5kZ2-2gi@Y6J&=cuwt>!vJ^#(&n|LcZyUzi6Duj$$hJ1s*HD-#;k-w@ zpdrwAuoDG_N2bvb07G$Zk*?Hc)JLtW4yqOnic_$zO7NZ#l>Fm){;fE?b$IbOaX2fe z0la4g0Dfw2xk7Wi7NapVD8YMPCZu?A1QCK*67dgsvRKBLFtrM>?$%&_lD1882mzdO zWPdw5KWw6IT`m1b_8=lS5jt8D3=RDa=&jWzR-)S@56WMslZ~mKu1)-wpXB>rNBQ>N zU#K`#1B&v|_AQK;7I~B}OdGiUT9LX>f0xm6<;LeP!=vFjPsUQF*wCJ*dO)4YBypgdiuF!=i@6Zyi7F|q#K zz?tlSZULa@t1D?$e;f@b36&N!V2mjOHw|*