Skip to content

Commit

Permalink
TASK: Improve new workspace template
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebobo committed Jul 18, 2024
1 parent b89b634 commit a075efb
Showing 1 changed file with 31 additions and 19 deletions.
50 changes: 31 additions & 19 deletions Neos.Workspace.Ui/Resources/Private/Fusion/Views/New.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,47 @@ Neos.Workspace.Ui.WorkspaceController.new = Neos.Fusion:Component {
flashMessages = ${flashMessages}
baseWorkspaceOptions = ${baseWorkspaceOptions}
workspace = ${workspace}
i18n = ${I18n.id('').source('Main').package('Neos.Workspace.Ui')}

prototype(Neos.Fusion.Form:LabelRenderer) {
translationPackage = 'Neos.Workspace.Ui'
translationSource = 'Main'
}

prototype(Neos.Fusion.Form:Neos.BackendModule.FieldContainer) {
translation.label {
package = 'Neos.Workspace.Ui'
source = 'Main'
}
}

renderer = afx`
<Neos.Workspace.Ui:Component.FlashMessages flashMessages={props.flashMessages}/>
<main>
<h2>{I18n.translate('workspaces.createNewWorkspace', 'Create new workspace', [], 'Main', 'Neos.Workspace.Ui')}</h2>
<Neos.Fusion.Form:Form form.data.workspace={props.workspace} form.target.action="create">
<h2>{props.i18n.id('workspaces.createNewWorkspace')}</h2>
<Neos.Fusion.Form:Form form.target.action="create">
<fieldset>
<Neos.Fusion.Form:FieldContainer
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer
field.name="title"
label="workspaces.workspace.title"
class="neos-control-group"
>
<Neos.Fusion.Form:Textfield/>
</Neos.Fusion.Form:FieldContainer>
<Neos.Fusion.Form:Textfield
attributes.required
attributes.pattern="/^[\p{L}\p{P}\d \.]{1,200}$/u"
attributes.autofocus
/>
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer>

<Neos.Fusion.Form:FieldContainer
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer
field.name="description"
label="workspaces.workspace.description"
class="neos-control-group"
>
<Neos.Fusion.Form:Textarea attributes.rows={3} />
</Neos.Fusion.Form:FieldContainer>
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer>

<Neos.Fusion.Form:FieldContainer
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer
field.name="baseWorkspace"
field.value="live"
label="workspaces.workspace.baseWorkspace"
Expand All @@ -42,38 +54,38 @@ Neos.Workspace.Ui.WorkspaceController.new = Neos.Fusion:Component {
option.value={workspaceName}>{workspaceTitle}</Neos.Fusion.Form:Select.Option>
</Neos.Fusion:Loop>
</Neos.Fusion.Form:Select>
</Neos.Fusion.Form:FieldContainer>
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer>
</fieldset>
<fieldset>
<Neos.Fusion:Fragment
@if={Security.hasAccess('Neos.Workspace.Ui:Backend.Module.Management.Workspace.ManageInternalWorkspaces')}>
<h3 class="neos-control-label">
{I18n.translate('workspaces.workspace.visibility', 'Visibility', [], 'Main', 'Neos.Workspace.Ui')}
{props.i18n.id('workspaces.workspace.visibility')}
</h3>
<Neos.Fusion.Form:FieldContainer
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer
field.name="visibility"
class="neos-control-group"
>
<Neos.Fusion.Form:Radio id="visibility.private" field.value="private" attributes.checked={true}>
<Neos.Fusion.Form:Radio id="visibility.private" field.value="private" attributes.checked>
<span></span>
<span>
{I18n.translate('workspaces.workspace.visibility.private', 'Private', [], 'Main', 'Neos.Workspace.Ui')}
{props.i18n.id('workspaces.workspace.visibility.private')}
<span class="neos-help-inline">
{I18n.translate('workspaces.workspace.visibility.private.help', 'Only reviewers and administrators can access and modify this workspace', [], 'Main', 'Neos.Workspace.Ui')}
{props.i18n.id('workspaces.workspace.visibility.private.help')}
</span>
</span>
</Neos.Fusion.Form:Radio>
<br/>
<Neos.Fusion.Form:Radio id="visibility.internal" field.value="internal">
<span></span>
<span>
{I18n.translate('workspaces.workspace.visibility.internal', 'Internal', [], 'Main', 'Neos.Workspace.Ui')}
{props.i18n.id('workspaces.workspace.visibility.internal')}
<span class="neos-help-inline">
{I18n.translate('workspaces.workspace.visibility.internal.help', 'Any logged in editor can see and modify this workspace.', [], 'Main', 'Neos.Workspace.Ui')}
{props.i18n.id('workspaces.workspace.visibility.internal.help')}
</span>
</span>
</Neos.Fusion.Form:Radio>
</Neos.Fusion.Form:FieldContainer>
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer>
</Neos.Fusion:Fragment>

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

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

<Neos.Workspace.Ui:Component.Footer>
<Neos.Fusion:Link.Action href.action="index" class="neos-button">
{I18n.translate('cancel', 'Cancel', [], 'Main', 'Neos.Workspace.Ui')}
{props.i18n.id('cancel')}
</Neos.Fusion:Link.Action>
</Neos.Workspace.Ui:Component.Footer>
</main>
Expand Down

0 comments on commit a075efb

Please sign in to comment.