Skip to content

Commit ee9fed4

Browse files
Merge branch 'main' into v15/feature/validate-specific-cultures
2 parents 124cd8e + dfb8aef commit ee9fed4

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,24 +132,39 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement<
132132
`;
133133
}
134134

135+
#renderNoDocumentTypes() {
136+
if (this.data?.documentType?.unique) {
137+
return html`
138+
<umb-localize key="create_noDocumentTypes">
139+
There are no allowed Document Types available for creating content here. You must enable these in
140+
<strong>Document Types</strong> within the <strong>Settings</strong> section, by editing the
141+
<strong>Allowed child node types</strong> under <strong>Structure</strong>.
142+
</umb-localize>
143+
<br />
144+
<uui-button
145+
id="edit-permissions"
146+
look="secondary"
147+
href=${`/section/settings/workspace/document-type/edit/${this.data?.documentType?.unique}/view/structure`}
148+
label=${this.localize.term('create_noDocumentTypesEditPermissions')}
149+
@click=${() => this._rejectModal()}></uui-button>
150+
`;
151+
} else {
152+
return html`
153+
<umb-localize key="create_noDocumentTypesAllowedAtRoot">
154+
There are no allowed Document Types available for creating content here. You must enable these in
155+
<strong>Document Types</strong> within the <strong>Settings</strong> section, by changing the
156+
<strong>Allow as root</strong> option under <strong>Structure</strong>.
157+
</umb-localize>
158+
`;
159+
}
160+
}
161+
135162
#renderDocumentTypes() {
136163
return html`
137164
<uui-box .headline=${this._headline}>
138165
${when(
139166
this._allowedDocumentTypes.length === 0,
140-
() => html`
141-
<umb-localize key="create_noDocumentTypes">
142-
There are no allowed Document Types available for creating content here. You must enable these in
143-
<strong>Document Types</strong> within the <strong>Settings</strong> section, by editing the
144-
<strong>Allowed child node types</strong> under <strong>Permissions</strong>.<br />
145-
</umb-localize>
146-
<uui-button
147-
id="edit-permissions"
148-
look="secondary"
149-
href=${`/section/settings/workspace/document-type/edit/${this.data?.documentType?.unique}/view/structure`}
150-
label=${this.localize.term('create_noDocumentTypesEditPermissions')}
151-
@click=${() => this._rejectModal()}></uui-button>
152-
`,
167+
() => this.#renderNoDocumentTypes(),
153168
() =>
154169
repeat(
155170
this._allowedDocumentTypes,

0 commit comments

Comments
 (0)