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[$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 = new AjaxResponse();
|
||||||
$response->addCommand(new CloseDialogCommand());
|
$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;
|
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()] = [
|
$form['entity_types_container']['entity_types'][$entity_type->id()] = [
|
||||||
'type' => [
|
'type' => [
|
||||||
'label' => ['#markup' => '<strong>' . $this->t('@bundle types', ['@bundle' => $entity_type->getLabel()]) . '</strong>'],
|
'#type' => 'inline_template',
|
||||||
'selected' => [
|
'#template' => '<strong>{{ label }}</strong></br><span id="selected-{{ entity_type_id }}">{{ selected_bundles }}</span>',
|
||||||
'#prefix' => '<br/><span id="selected-' . $entity_type->id() . '">',
|
'#context' => [
|
||||||
'#markup' => !empty($selected_bundles) ? implode(', ', $selected_bundles) : $this->t('none'),
|
'label' => $this->t('@bundle types', ['@bundle' => $entity_type->getLabel()]),
|
||||||
'#suffix' => '</span>',
|
'entity_type_id' => $entity_type->id(),
|
||||||
],
|
'selected_bundles' => $selected_bundles_list,
|
||||||
|
]
|
||||||
],
|
],
|
||||||
'operations' => [
|
'operations' => [
|
||||||
'#type' => 'operations',
|
'#type' => 'operations',
|
||||||
|
|
Loading…
Reference in New Issue