summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2018-01-27 13:04:05 (GMT)
committerxjm2018-01-27 13:04:29 (GMT)
commit780164e87904208675609ba056bca3e30ee33272 (patch)
treec28f2d06008f0893621e56e49789827d28901a87
parent490ad560342d9f2c8a8b653b8239338f4536b234 (diff)
Issue #2897132 by timmillwood, Sam152, amateescu, pameeela, xjm, Wim Leers, webchick, lauriii, esod: Mark Content Moderation module as stable
-rw-r--r--core/modules/content_moderation/content_moderation.info.yml4
-rw-r--r--core/modules/content_moderation/content_moderation.module17
-rw-r--r--core/modules/content_moderation/css/content_moderation.module.css16
-rw-r--r--core/modules/content_moderation/css/content_moderation.theme.css2
-rw-r--r--core/modules/content_moderation/templates/entity-moderation-form.html.twig8
-rw-r--r--core/themes/stable/css/content_moderation/content_moderation.module.css38
-rw-r--r--core/themes/stable/css/content_moderation/content_moderation.theme.css10
-rw-r--r--core/themes/stable/stable.info.yml7
-rw-r--r--core/themes/stable/templates/content-edit/entity-moderation-form.html.twig8
9 files changed, 89 insertions, 21 deletions
diff --git a/core/modules/content_moderation/content_moderation.info.yml b/core/modules/content_moderation/content_moderation.info.yml
index b25c7ce..335e92b 100644
--- a/core/modules/content_moderation/content_moderation.info.yml
+++ b/core/modules/content_moderation/content_moderation.info.yml
@@ -1,9 +1,9 @@
name: 'Content Moderation'
type: module
-description: 'Provides moderation states for content'
+description: 'Provides moderation states for content.'
version: VERSION
core: 8.x
-package: Core (Experimental)
+package: Core
configure: entity.workflow.collection
dependencies:
- workflows
diff --git a/core/modules/content_moderation/content_moderation.module b/core/modules/content_moderation/content_moderation.module
index 2ae1e0d..985f91f 100644
--- a/core/modules/content_moderation/content_moderation.module
+++ b/core/modules/content_moderation/content_moderation.module
@@ -20,10 +20,12 @@ use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\Url;
use Drupal\workflows\WorkflowInterface;
use Drupal\Core\Action\Plugin\Action\PublishAction;
use Drupal\Core\Action\Plugin\Action\UnpublishAction;
use Drupal\workflows\Entity\Workflow;
+use Drupal\views\Entity\View;
/**
* Implements hook_help().
@@ -34,13 +36,20 @@ function content_moderation_help($route_name, RouteMatchInterface $route_match)
case 'help.page.content_moderation':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
- $output .= '<p>' . t('The Content Moderation module provides moderation for content by applying workflows to content. For more information, see the <a href=":content_moderation">online documentation for the Content Moderation module</a>.', [':content_moderation' => 'https://www.drupal.org/documentation/modules/content_moderation']) . '</p>';
+ $output .= '<p>' . t('The Content Moderation module allows you to expand on Drupal\'s "unpublished" and "published" states for content. It allows you to have a published version that is live, but have a separate working copy that is undergoing review before it is published. This is achieved by using <a href=":workflows">Workflows</a> to apply different states and transitions to entities as needed. For more information, see the <a href=":content_moderation">online documentation for the Content Moderation module</a>.', [':content_moderation' => 'https://www.drupal.org/documentation/modules/content_moderation', ':workflows' => Url::fromRoute('help.page', ['name' => 'workflows'])->toString()]) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
- $output .= '<dt>' . t('Configuring workflows') . '</dt>';
- $output .= '<dd>' . t('Enable the Workflow UI module to create, edit and delete content moderation workflows.') . '</p>';
+ $output .= '<dt>' . t('Applying workflows') . '</dt>';
+ $output .= '<dd>' . t('Content Moderation allows you to apply <a href=":workflows">Workflows</a> to content, custom blocks, and other <a href=":field_help" title="Field module help, with background on content entities">content entities</a>, to provide more fine-grained publishing options. For example, a Basic page might have states such as Draft and Published, with allowed transitions such as Draft to Published (making the current revision "live"), and Published to Draft (making a new draft revision of published content).', [':workflows' => Url::fromRoute('help.page', ['name' => 'workflows'])->toString(), ':field_help' => Url::fromRoute('help.page', ['name' => 'field'])->toString()]) . '</dd>';
+ if (\Drupal::moduleHandler()->moduleExists('views')) {
+ $moderated_content_view = View::load('moderated_content');
+ if (isset($moderated_content_view) && $moderated_content_view->status() === TRUE) {
+ $output .= '<dt>' . t('Moderating content') . '</dt>';
+ $output .= '<dd>' . t('You can view a list of content awaiting moderation on the <a href=":moderated">moderated content page</a>. This will show any content in an unpublished state, such as Draft or Archived, to help surface content that requires more work from content editors.', [':moderated' => Url::fromRoute('view.moderated_content.moderated_content')->toString()]) . '</dd>';
+ }
+ }
$output .= '<dt>' . t('Configure Content Moderation permissions') . '</dt>';
- $output .= '<dd>' . t('Each transition is exposed as a permission. If a user has the permission for a transition, then they can move that node from the start state to the end state') . '</p>';
+ $output .= '<dd>' . t('Each transition is exposed as a permission. If a user has the permission for a transition, they can use the transition to change the state of the content item, from Draft to Published.') . '</dd>';
$output .= '</dl>';
return $output;
}
diff --git a/core/modules/content_moderation/css/content_moderation.module.css b/core/modules/content_moderation/css/content_moderation.module.css
index 4c6a0c1..1df1823 100644
--- a/core/modules/content_moderation/css/content_moderation.module.css
+++ b/core/modules/content_moderation/css/content_moderation.module.css
@@ -2,7 +2,7 @@
* @file
* Component styles for the content_moderation module.
*/
-ul.entity-moderation-form {
+.entity-moderation-form {
list-style: none;
display: -webkit-flex; /* Safari */
display: flex;
@@ -12,31 +12,27 @@ ul.entity-moderation-form {
align-items: flex-start;
}
-ul.entity-moderation-form li {
+.entity-moderation-form__item {
margin-right: 2em;
display: table;
}
-ul.entity-moderation-form li:last-child {
+.entity-moderation-form__item:last-child {
-webkit-align-self: flex-end; /* Safari */
align-self: flex-end;
margin-right: 0;
}
-ul.entity-moderation-form .form-item {
+.entity-moderation-form .form-item {
margin-top: 1em;
margin-bottom: 1em;
}
-ul.entity-moderation-form .form-item label {
+.entity-moderation-form .form-item label {
padding-bottom: 0.25em;
display: table;
}
-ul.entity-moderation-form input[type=submit] {
+.entity-moderation-form input[type=submit] {
margin-bottom: 1.2em;
}
-
-ul.entity-moderation-form .btn {
- margin-bottom: 1.1em;
-}
diff --git a/core/modules/content_moderation/css/content_moderation.theme.css b/core/modules/content_moderation/css/content_moderation.theme.css
index 36ebf04..827e911 100644
--- a/core/modules/content_moderation/css/content_moderation.theme.css
+++ b/core/modules/content_moderation/css/content_moderation.theme.css
@@ -2,7 +2,7 @@
* @file
* Theme styles for the content_moderation module.
*/
-ul.entity-moderation-form {
+.entity-moderation-form {
border: 1px dashed #bbb;
margin: 2em 0;
background: #fff;
diff --git a/core/modules/content_moderation/templates/entity-moderation-form.html.twig b/core/modules/content_moderation/templates/entity-moderation-form.html.twig
index b3665a7..7638e37 100644
--- a/core/modules/content_moderation/templates/entity-moderation-form.html.twig
+++ b/core/modules/content_moderation/templates/entity-moderation-form.html.twig
@@ -1,8 +1,8 @@
{{ attach_library('content_moderation/content_moderation') }}
<ul class="entity-moderation-form">
- <li>{{ form.current }}</li>
- <li>{{ form.new_state }}</li>
- <li>{{ form.revision_log }}</li>
- <li>{{ form.submit }}</li>
+ <li class="entity-moderation-form__item">{{ form.current }}</li>
+ <li class="entity-moderation-form__item">{{ form.new_state }}</li>
+ <li class="entity-moderation-form__item">{{ form.revision_log }}</li>
+ <li class="entity-moderation-form__item">{{ form.submit }}</li>
</ul>
{{ form|without('current', 'new_state', 'revision_log', 'submit') }}
diff --git a/core/themes/stable/css/content_moderation/content_moderation.module.css b/core/themes/stable/css/content_moderation/content_moderation.module.css
new file mode 100644
index 0000000..1df1823
--- /dev/null
+++ b/core/themes/stable/css/content_moderation/content_moderation.module.css
@@ -0,0 +1,38 @@
+/**
+ * @file
+ * Component styles for the content_moderation module.
+ */
+.entity-moderation-form {
+ list-style: none;
+ display: -webkit-flex; /* Safari */
+ display: flex;
+ -webkit-flex-wrap: wrap; /* Safari */
+ flex-wrap: wrap;
+ -webkit-align-items: flex-start; /* Safari */
+ align-items: flex-start;
+}
+
+.entity-moderation-form__item {
+ margin-right: 2em;
+ display: table;
+}
+
+.entity-moderation-form__item:last-child {
+ -webkit-align-self: flex-end; /* Safari */
+ align-self: flex-end;
+ margin-right: 0;
+}
+
+.entity-moderation-form .form-item {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.entity-moderation-form .form-item label {
+ padding-bottom: 0.25em;
+ display: table;
+}
+
+.entity-moderation-form input[type=submit] {
+ margin-bottom: 1.2em;
+}
diff --git a/core/themes/stable/css/content_moderation/content_moderation.theme.css b/core/themes/stable/css/content_moderation/content_moderation.theme.css
new file mode 100644
index 0000000..827e911
--- /dev/null
+++ b/core/themes/stable/css/content_moderation/content_moderation.theme.css
@@ -0,0 +1,10 @@
+/**
+ * @file
+ * Theme styles for the content_moderation module.
+ */
+.entity-moderation-form {
+ border: 1px dashed #bbb;
+ margin: 2em 0;
+ background: #fff;
+ padding-left: 1em;
+}
diff --git a/core/themes/stable/stable.info.yml b/core/themes/stable/stable.info.yml
index 957a65c..3f019d0 100644
--- a/core/themes/stable/stable.info.yml
+++ b/core/themes/stable/stable.info.yml
@@ -45,6 +45,13 @@ libraries-override:
theme:
css/content_translation.admin.css: css/content_translation/content_translation.admin.css
+ content_moderation/content_moderation:
+ css:
+ component:
+ css/content_moderation.module.css: css/content_moderation/content_moderation.module.css
+ theme:
+ css/content_moderation.theme.css: css/content_moderation/content_moderation.theme.css
+
contextual/drupal.contextual-links:
css:
component:
diff --git a/core/themes/stable/templates/content-edit/entity-moderation-form.html.twig b/core/themes/stable/templates/content-edit/entity-moderation-form.html.twig
new file mode 100644
index 0000000..7638e37
--- /dev/null
+++ b/core/themes/stable/templates/content-edit/entity-moderation-form.html.twig
@@ -0,0 +1,8 @@
+{{ attach_library('content_moderation/content_moderation') }}
+<ul class="entity-moderation-form">
+ <li class="entity-moderation-form__item">{{ form.current }}</li>
+ <li class="entity-moderation-form__item">{{ form.new_state }}</li>
+ <li class="entity-moderation-form__item">{{ form.revision_log }}</li>
+ <li class="entity-moderation-form__item">{{ form.submit }}</li>
+</ul>
+{{ form|without('current', 'new_state', 'revision_log', 'submit') }}