Commit 780164e8 authored by xjm's avatar xjm
Browse files

Issue #2897132 by timmillwood, Sam152, amateescu, pameeela, xjm, Wim Leers,...

Issue #2897132 by timmillwood, Sam152, amateescu, pameeela, xjm, Wim Leers, webchick, lauriii, esod: Mark Content Moderation module as stable
parent 490ad560
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
......@@ -20,10 +20,12 @@
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;
}
......
......@@ -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;
}
......@@ -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;
......
{{ 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') }}
/**
* @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;
}
/**
* @file
* Theme styles for the content_moderation module.
*/
.entity-moderation-form {
border: 1px dashed #bbb;
margin: 2em 0;
background: #fff;
padding-left: 1em;
}
......@@ -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:
......
{{ 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') }}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment