Skip to content

Commit 5f7e14b

Browse files
committed
TASK: Improve new workspace template
1 parent be3e161 commit 5f7e14b

File tree

1 file changed

+31
-19
lines changed
  • Neos.Workspace.Ui/Resources/Private/Fusion/Views

1 file changed

+31
-19
lines changed

Neos.Workspace.Ui/Resources/Private/Fusion/Views/New.fusion

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,47 @@ Neos.Workspace.Ui.WorkspaceController.new = Neos.Fusion:Component {
22
flashMessages = ${flashMessages}
33
baseWorkspaceOptions = ${baseWorkspaceOptions}
44
workspace = ${workspace}
5+
i18n = ${I18n.id('').source('Main').package('Neos.Workspace.Ui')}
56

67
prototype(Neos.Fusion.Form:LabelRenderer) {
78
translationPackage = 'Neos.Workspace.Ui'
89
translationSource = 'Main'
910
}
1011

12+
prototype(Neos.Fusion.Form:Neos.BackendModule.FieldContainer) {
13+
translation.label {
14+
package = 'Neos.Workspace.Ui'
15+
source = 'Main'
16+
}
17+
}
18+
1119
renderer = afx`
1220
<Neos.Workspace.Ui:Component.FlashMessages flashMessages={props.flashMessages}/>
1321
<main>
14-
<h2>{I18n.translate('workspaces.createNewWorkspace', 'Create new workspace', [], 'Main', 'Neos.Workspace.Ui')}</h2>
15-
<Neos.Fusion.Form:Form form.data.workspace={props.workspace} form.target.action="create">
22+
<h2>{props.i18n.id('workspaces.createNewWorkspace')}</h2>
23+
<Neos.Fusion.Form:Form form.target.action="create">
1624
<fieldset>
17-
<Neos.Fusion.Form:FieldContainer
25+
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer
1826
field.name="title"
1927
label="workspaces.workspace.title"
2028
class="neos-control-group"
2129
>
22-
<Neos.Fusion.Form:Textfield/>
23-
</Neos.Fusion.Form:FieldContainer>
30+
<Neos.Fusion.Form:Textfield
31+
attributes.required
32+
attributes.pattern="/^[\p{L}\p{P}\d \.]{1,200}$/u"
33+
attributes.autofocus
34+
/>
35+
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer>
2436

25-
<Neos.Fusion.Form:FieldContainer
37+
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer
2638
field.name="description"
2739
label="workspaces.workspace.description"
2840
class="neos-control-group"
2941
>
3042
<Neos.Fusion.Form:Textarea attributes.rows={3} />
31-
</Neos.Fusion.Form:FieldContainer>
43+
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer>
3244

33-
<Neos.Fusion.Form:FieldContainer
45+
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer
3446
field.name="baseWorkspace"
3547
field.value="live"
3648
label="workspaces.workspace.baseWorkspace"
@@ -42,38 +54,38 @@ Neos.Workspace.Ui.WorkspaceController.new = Neos.Fusion:Component {
4254
option.value={workspaceName}>{workspaceTitle}</Neos.Fusion.Form:Select.Option>
4355
</Neos.Fusion:Loop>
4456
</Neos.Fusion.Form:Select>
45-
</Neos.Fusion.Form:FieldContainer>
57+
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer>
4658
</fieldset>
4759
<fieldset>
4860
<Neos.Fusion:Fragment
4961
@if={Security.hasAccess('Neos.Workspace.Ui:Backend.Module.Management.Workspace.ManageInternalWorkspaces')}>
5062
<h3 class="neos-control-label">
51-
{I18n.translate('workspaces.workspace.visibility', 'Visibility', [], 'Main', 'Neos.Workspace.Ui')}
63+
{props.i18n.id('workspaces.workspace.visibility')}
5264
</h3>
53-
<Neos.Fusion.Form:FieldContainer
65+
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer
5466
field.name="visibility"
5567
class="neos-control-group"
5668
>
57-
<Neos.Fusion.Form:Radio id="visibility.private" field.value="private" attributes.checked={true}>
69+
<Neos.Fusion.Form:Radio id="visibility.private" field.value="private" attributes.checked>
5870
<span></span>
5971
<span>
60-
{I18n.translate('workspaces.workspace.visibility.private', 'Private', [], 'Main', 'Neos.Workspace.Ui')}
72+
{props.i18n.id('workspaces.workspace.visibility.private')}
6173
<span class="neos-help-inline">
62-
{I18n.translate('workspaces.workspace.visibility.private.help', 'Only reviewers and administrators can access and modify this workspace', [], 'Main', 'Neos.Workspace.Ui')}
74+
{props.i18n.id('workspaces.workspace.visibility.private.help')}
6375
</span>
6476
</span>
6577
</Neos.Fusion.Form:Radio>
6678
<br/>
6779
<Neos.Fusion.Form:Radio id="visibility.internal" field.value="internal">
6880
<span></span>
6981
<span>
70-
{I18n.translate('workspaces.workspace.visibility.internal', 'Internal', [], 'Main', 'Neos.Workspace.Ui')}
82+
{props.i18n.id('workspaces.workspace.visibility.internal')}
7183
<span class="neos-help-inline">
72-
{I18n.translate('workspaces.workspace.visibility.internal.help', 'Any logged in editor can see and modify this workspace.', [], 'Main', 'Neos.Workspace.Ui')}
84+
{props.i18n.id('workspaces.workspace.visibility.internal.help')}
7385
</span>
7486
</span>
7587
</Neos.Fusion.Form:Radio>
76-
</Neos.Fusion.Form:FieldContainer>
88+
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer>
7789
</Neos.Fusion:Fragment>
7890

7991
<Neos.Fusion.Form:Hidden
@@ -83,14 +95,14 @@ Neos.Workspace.Ui.WorkspaceController.new = Neos.Fusion:Component {
8395
/>
8496

8597
<Neos.Fusion.Form:Button attributes.class="neos-button neos-button-primary">
86-
{I18n.translate('workspaces.createWorkspace', 'Create workspace', [], 'Main', 'Neos.Workspace.Ui')}
98+
{props.i18n.id('workspaces.createWorkspace')}
8799
</Neos.Fusion.Form:Button>
88100
</fieldset>
89101
</Neos.Fusion.Form:Form>
90102

91103
<Neos.Workspace.Ui:Component.Footer>
92104
<Neos.Fusion:Link.Action href.action="index" class="neos-button">
93-
{I18n.translate('cancel', 'Cancel', [], 'Main', 'Neos.Workspace.Ui')}
105+
{props.i18n.id('cancel')}
94106
</Neos.Fusion:Link.Action>
95107
</Neos.Workspace.Ui:Component.Footer>
96108
</main>

0 commit comments

Comments
 (0)