{namespace neos=Neos\Neos\ViewHelpers}
<f:layout name="BackendSubModule"/>

<f:section name="subtitle">
	<h2>{neos:backend.translate(id: 'workspaces.editWorkspace', source: 'Main', package: 'Neos.Workspace.Ui', arguments: {0: workspace.workspaceTitle.value})}</h2>
</f:section>

<f:section name="content">
	<f:form action="update" name="workspace">
		<f:form.hidden name="workspaceName" value="{workspace.workspaceName.value}"/>
		<fieldset>
			<div class="neos-control-group">
				<label class="neos-control-label" for="title">{neos:backend.translate(id: 'workspaces.workspace.title', source: 'Main', package: 'Neos.Workspace.Ui')}</label>
				<div class="neos-controls">
					<f:form.textfield name="title" value="{workspace.workspaceTitle.value}" id="title" class="neos-span3" autofocus="true" required="required" maxlength="200" />
				</div>
			</div>

			<div class="neos-control-group">
				<label class="neos-control-label" for="description">{neos:backend.translate(id: 'workspaces.workspace.description', source: 'Main', package: 'Neos.Workspace.Ui')}</label>
				<div class="neos-controls">
					<f:form.textfield name="description" value="{workspace.workspaceDescription.value}" id="description" class="neos-span10"/>
				</div>
			</div>

			<div class="neos-control-group{f:validation.ifHasErrors(for: 'baseWorkspace', then: ' neos-error')}">
				<label class="neos-control-label" for="baseWorkspace">{neos:backend.translate(id: 'workspaces.workspace.baseWorkspace', source: 'Main', package: 'Neos.Workspace.Ui')}</label>
				<div class="neos-controls">
					<f:form.select name="baseWorkspace" value="{workspace.baseWorkspaceName.value}" id="baseWorkspace" options="{baseWorkspaceOptions}" disabled="disabled" title="{neos:backend.translate(id: 'workspaces.help.cantRebaseWorkspaceContainsChanges', source: 'Main', package: 'Neos.Workspace.Ui')}" />
				</div>
			</div>

			<f:if condition="{showOwnerSelector}">
				<div class="neos-control-group">
					<label class="neos-control-label" for="owner">{neos:backend.translate(id: 'workspaces.workspace.owner', source: 'Main', package: 'Neos.Workspace.Ui')}</label>
					<div class="neos-controls">
						<f:form.select name="workspaceOwner" value="{workspace.workspaceOwner}" id="owner" options="{ownerOptions}" />
					</div>
				</div>
			</f:if>

			<div class="neos-control-group">
				<label class="neos-control-label">{neos:backend.translate(id: 'workspaces.workspace.visibility', source: 'Main', package: 'Neos.Workspace.Ui')}</label>
				<div class="neos-controls">
					<label for="visibility.private" class="neos-radio">
						<f:form.radio name="visibility" id="visibility.private" value="private" disabled="true" checked="{workspace.privateWorkspace}" /><span></span>
						<span>{neos:backend.translate(id: 'workspaces.workspace.visibility.private', source: 'Main', package: 'Neos.Workspace.Ui')} <span class="neos-help-inline">{neos:backend.translate(id: 'workspaces.workspace.visibility.private.help', source: 'Main', package: 'Neos.Workspace.Ui')}</span></span>
					</label>
				</div>
				<div class="neos-controls">
					<label for="visibility.internal" class="neos-radio">
						<f:form.radio name="visibility" id="visibility.internal" value="internal" disabled="true" checked="{workspace.internalWorkspace}"/><span></span>
						<span>{neos:backend.translate(id: 'workspaces.workspace.visibility.internal', source: 'Main', package: 'Neos.Workspace.Ui')} <span class="neos-help-inline">{neos:backend.translate(id: 'workspaces.workspace.visibility.internal.help', source: 'Main', package: 'Neos.Workspace.Ui')}</span></span>
					</label>
				</div>
			</div>
		</fieldset>

		<div class="neos-footer">
			<f:link.action action="index" class="neos-button">{neos:backend.translate(id: 'cancel', package: 'Neos.Workspace.Ui')}
			</f:link.action>
			<f:form.submit value="{neos:backend.translate(id: 'applyChanges')}" class="neos-button neos-button-primary"/>
		</div>
	</f:form>
</f:section>
