Issue #2898886 by Sam152, timmillwood: ContentModerationConfigureForm should use inline list in place of concatenated markup
parent
d1227108d2
commit
e64d7536a6
|
@ -178,9 +178,15 @@ class ContentModerationConfigureEntityTypesForm extends FormBase {
|
|||
$selected_bundles[$bundle_id] = $bundle['label'];
|
||||
}
|
||||
}
|
||||
$selected_bundles_list = [
|
||||
'#theme' => 'item_list',
|
||||
'#items' => $selected_bundles,
|
||||
'#context' => ['list_style' => 'comma-list'],
|
||||
'#empty' => $this->t('none'),
|
||||
];
|
||||
$response = new AjaxResponse();
|
||||
$response->addCommand(new CloseDialogCommand());
|
||||
$response->addCommand(new HtmlCommand('#selected-' . $this->entityType->id(), !empty($selected_bundles) ? implode(', ', $selected_bundles) : $this->t('none')));
|
||||
$response->addCommand(new HtmlCommand('#selected-' . $this->entityType->id(), $selected_bundles_list));
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,14 +94,21 @@ class ContentModerationConfigureForm extends WorkflowTypeConfigureFormBase imple
|
|||
}
|
||||
}
|
||||
|
||||
$selected_bundles_list = [
|
||||
'#theme' => 'item_list',
|
||||
'#items' => $selected_bundles,
|
||||
'#context' => ['list_style' => 'comma-list'],
|
||||
'#empty' => $this->t('none'),
|
||||
];
|
||||
$form['entity_types_container']['entity_types'][$entity_type->id()] = [
|
||||
'type' => [
|
||||
'label' => ['#markup' => '<strong>' . $this->t('@bundle types', ['@bundle' => $entity_type->getLabel()]) . '</strong>'],
|
||||
'selected' => [
|
||||
'#prefix' => '<br/><span id="selected-' . $entity_type->id() . '">',
|
||||
'#markup' => !empty($selected_bundles) ? implode(', ', $selected_bundles) : $this->t('none'),
|
||||
'#suffix' => '</span>',
|
||||
],
|
||||
'#type' => 'inline_template',
|
||||
'#template' => '<strong>{{ label }}</strong></br><span id="selected-{{ entity_type_id }}">{{ selected_bundles }}</span>',
|
||||
'#context' => [
|
||||
'label' => $this->t('@bundle types', ['@bundle' => $entity_type->getLabel()]),
|
||||
'entity_type_id' => $entity_type->id(),
|
||||
'selected_bundles' => $selected_bundles_list,
|
||||
]
|
||||
],
|
||||
'operations' => [
|
||||
'#type' => 'operations',
|
||||
|
|
Loading…
Reference in New Issue