Skip to content

Commit

Permalink
merged release/2.1.2 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
baschny committed Apr 8, 2019
2 parents be4fb7e + eaf9dac commit e707e48
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 44 deletions.
33 changes: 19 additions & 14 deletions Configuration/NodeTypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
'CRON.FormBuilder:CheckBoxEnhanced': true
'CRON.FormBuilder:TextArea': true
'CRON.FormBuilder:FileUpload': true
'CRON.FormBuilder:Text': true
'*': false

'CRON.FormBuilder:FormElementLabelMixin':
Expand Down Expand Up @@ -255,7 +256,8 @@
reloadIfChanged: true
inspector:
group: options

value:
defaultValue: 'Checked'

'CRON.FormBuilder:CheckBoxEnhanced':
superTypes:
Expand All @@ -264,9 +266,9 @@
ui:
label: CRON.FormBuilder:NodeTypes.Plugin:fields.checkbox.enhanced
properties:
text:
type: string
label:
ui:
inspector: []
label: Text
inlineEditable: true
aloha:
Expand All @@ -275,17 +277,6 @@
'p': true
link:
'a': true
mainText:
type: string
ui:
label: CRON.FormBuilder:NodeTypes.Plugin:fields.checkbox.enhanced.mainText
reloadIfChanged: true
inspector:
group: options
editor: 'Neos.Neos/Inspector/Editors/TextAreaEditor'
editorOptions:
rows: 10


'CRON.FormBuilder:TextArea':
superTypes:
Expand Down Expand Up @@ -318,3 +309,17 @@
'CRON.FormBuilder:FormElementRequiredMixin': true
ui:
label: CRON.FormBuilder:NodeTypes.Plugin:fields.fileupload

'CRON.FormBuilder:Text':
superTypes:
'Neos.Neos:Content': true
ui:
label: CRON.FormBuilder:NodeTypes.Plugin:fields.text
icon: 'icon-edit-sign'
properties:
text:
type: string
ui:
inlineEditable: true
aloha:
placeholder: CRON.FormBuilder:NodeTypes.Plugin:fields.text.placeholder
6 changes: 4 additions & 2 deletions Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ prototype(CRON.FormBuilder:CheckBoxEnhanced) < prototype(CRON.FormBuilder:FormEl
layoutName = 'CheckboxWrapper'
attributes.class = ''
checked = ${this.value || q(node).property('checked')}
text = ${q(node).property('text')}
mainText = ${q(node).property('mainText')}
label = ${q(node).property('label')}
}

prototype(CRON.FormBuilder:CheckBoxGroup) < prototype(CRON.FormBuilder:FormElement) {
Expand Down Expand Up @@ -105,6 +104,9 @@ prototype(CRON.FormBuilder:FileUpload) < prototype(CRON.FormBuilder:FormElement)
allowedMimeTypes = ${Array.join(Configuration.setting('CRON.FormBuilder.Upload.allowedMimeTypes'), ',')}
}

prototype(CRON.FormBuilder:Text) < prototype(CRON.FormBuilder:FormElement) {
text = ${q(node).property('text')}
}

prototype(CRON.FormBuilder:Plugin) < prototype(Neos.Neos:Plugin) {
package = 'CRON.FormBuilder'
Expand Down
10 changes: 7 additions & 3 deletions Resources/Private/Templates/Email/Form.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
{field.node.properties.label}
=============================
<f:for each="{field.values}" as="subField">
{subField.node.properties.label}: {subField.value}
<f:if condition="{subField.node.properties.label} != ''">
{subField.node.properties.label -> f:format.stripTags()}: {subField.value}
</f:if>
</f:for>
</f:then>
<f:else>
{field.node.properties.label}: {field.value}
<f:if condition="{field.node.properties.label} != ''">
{field.node.properties.label -> f:format.stripTags()}: {field.value}
</f:if>
</f:else>
</f:if>
</f:for>
</f:section>
</f:section>
3 changes: 0 additions & 3 deletions Resources/Private/Templates/FormBuilder/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
</f:if>
<ts:render path="elements" typoScriptPackageKey="{tsPackageKey}" context="{node: elements}"/>
<f:form.hidden name="__formId" value="{node.identifier}"></f:form.hidden>
<div>
<p><span>* </span><f:translate id="formBuilder.requiredField" package="CRON.FormBuilder"/></p>
</div>
<button type="submit" class="btn btn-default">{submitButtonLabel}</button>
</f:form>
<f:if condition="{neos:rendering.inBackend(node: documentNode)}">
Expand Down
21 changes: 6 additions & 15 deletions Resources/Private/Templates/NodeTypes/CheckBoxEnhanced.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
{namespace neos=Neos\Neos\ViewHelpers}
<f:layout name="{layoutName}" />
<f:section name="Content">
<div class="checkbox-enhanced {f:if(condition: validationResults.flattenedErrors, then: 'has-error')}">
<div class=" checkbox-enhanced {f:if(condition: validationResults.flattenedErrors, then: 'has-error')}">
<f:if condition="{neos:rendering.inBackend()}">
<f:then>
<f:if condition="{mainText}">
<div>
{mainText -> f:format.raw()}
</div>
</f:if>
<label>
<input {attributes -> f:format.raw()} type="checkbox" onclick="return false;"/> {neos:contentElement.editable(property: 'text', tag: 'p')}
</label>
<div class="checkbox-enhanced-label">
<input style="margin-right: 10px;" {attributes -> f:format.raw()} type="checkbox" onclick="return false;"/>
{neos:contentElement.editable(property: 'label', tag: 'p')}
</div>
</f:then>
<f:else>
<f:if condition="{mainText}">
<div>
{mainText -> f:format.raw()}
</div>
</f:if>
<div class="checkbox-enhanced-label">
<input {attributes -> f:format.raw()} type="hidden" value="">
<input {attributes -> f:format.raw()} type="checkbox" value="{node.properties.value}" {f:if(condition: checked, then: 'checked')}/>
<label>
{text -> f:format.raw()}
{label -> f:format.raw()}
</label>
</div>
</f:else>
Expand Down
12 changes: 12 additions & 0 deletions Resources/Private/Templates/NodeTypes/Text.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{namespace neos=Neos\Neos\ViewHelpers}
<f:layout name="{layoutName}" />
<f:section name="Content">
<f:if condition="{neos:rendering.inBackend()}">
<f:then>
<p>{neos:contentElement.editable(property: 'text')}</p>
</f:then>
<f:else>
<p>{text -> f:format.raw()}</p>
</f:else>
</f:if>
</f:section>
4 changes: 0 additions & 4 deletions Resources/Private/Translations/de/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
<source>Following errors occurred:</source>
<target xml:lang="de" state="translated">Folgende Fehler sind aufgetreten:</target>
</trans-unit>
<trans-unit id="formBuilder.requiredField" xml:space="preserve">
<source>This field is required</source>
<target xml:lang="de" state="translated">Dies ist ein Pflichtfeld</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions Resources/Private/Translations/de/NodeTypes/Plugin.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@
<source>File-Upload</source>
<target xml:lang="de" state="translated">Datei-Upload</target>
</trans-unit>
<trans-unit id="fields.text" xml:space="preserve">
<source>Text</source>
<target xml:lang="de" state="translated">Text</target>
</trans-unit>
<trans-unit id="fields.text.placeholder" xml:space="preserve">
<source>Enter text here</source>
<target xml:lang="de" state="translated">Text hier eingeben</target>
</trans-unit>
</body>
</file>
</xliff>
3 changes: 0 additions & 3 deletions Resources/Private/Translations/en/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<trans-unit id="formBuilder.index.errors.title" xml:space="preserve">
<source>Following errors occurred:</source>
</trans-unit>
<trans-unit id="formBuilder.requiredField" xml:space="preserve">
<source>This field is required</source>
</trans-unit>
</body>
</file>
</xliff>
6 changes: 6 additions & 0 deletions Resources/Private/Translations/en/NodeTypes/Plugin.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
<trans-unit id="fields.fileupload" xml:space="preserve">
<source>File-Upload</source>
</trans-unit>
<trans-unit id="fields.text" xml:space="preserve">
<source>Text</source>
</trans-unit>
<trans-unit id="fields.text.placeholder" xml:space="preserve">
<source>Enter text here</source>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit e707e48

Please sign in to comment.