diff --git a/Resources/views/Crud/_boxes/create.html.twig b/Resources/views/Crud/_boxes/create.html.twig index 49222c09..fa79258f 100644 --- a/Resources/views/Crud/_boxes/create.html.twig +++ b/Resources/views/Crud/_boxes/create.html.twig @@ -3,7 +3,7 @@ 'class': 'default-crud-form' } }) }} - +{% set keyArr = helper.blocks|keys %} {% if form.vars.errors|length > 0 %}
@@ -21,80 +21,89 @@
{% endif %} -
-
-
-

- {{ block.label }} -

-
+
+
+
+

+ {{ block.label }} +

+
-
- {% for content in block.contents %} - {% if attribute(form, content.acronym) is defined %} -
- {% if content.label %} -
+ {% endfor %}
+
+
{# / Zeile #} - {% if i == 2 %} + {% if i == 2 or block.size == "large" %} {% set i = 0 %}
{% set isOpen = false %} + {% elseif helper.blocks[keyArr[loop.index]] is defined %} + {% if helper.blocks[keyArr[loop.index]].size == "large" %} + {% set i = 0 %} +
+ {% endif %} {% endif %} {% endfor %} diff --git a/Resources/views/Crud/_boxes/edit.html.twig b/Resources/views/Crud/_boxes/edit.html.twig index 8150e633..d318a42e 100644 --- a/Resources/views/Crud/_boxes/edit.html.twig +++ b/Resources/views/Crud/_boxes/edit.html.twig @@ -11,6 +11,7 @@
{% endif %} +{% set keyArr = helper.blocks|keys %} {% set i = 0 %} {% set isOpen = false %} {% for block in helper.blocks %} @@ -21,94 +22,106 @@ {% set isOpen = true %}
{% endif %} -
-
-
-

- {{ block.label}} -

-
- -
- {% for content in block.contents %} - {% if attribute(form, content.acronym) is defined %} -
- {% if content.label %} - - {% endif %} - {{ form_widget(attribute(form, content.acronym)) }} - {% if content.autoFill is not null %} - {% for autoFill in content.autoFill %} - - {% endfor %} - {% endif %} +
+
+
+

+ {{ block.label }} +

+
+
+ {% for content in block.contents %} + {% if attribute(form, content.acronym) is defined %} +
+ {% if content.label %} +
+ {{ content.label }}: + {% for attrname, attrvalue in attribute(form, content.acronym).vars.attr %} + {% if attrname == 'help' %} +   + {% endif %} + {% endfor %} + {% endif %} - {% if content.isTable is defined and content.isTable and content.showInEdit %} -
-
- {{ content.label }}: -
-
-
-
- {{ content.renderTable(whatwedo_table(), helper.data)|raw }} -
-
- {% if content.createRoute is defined and content.createRoute and helper.allowEdit(helper.data) %} -
- + {{ form_widget(attribute(form, content.acronym)) }} + {% if content.autoFill is not null %} + {% for autoFill in content.autoFill %} + - {% endif %} + {% endfor %} {% endif %} - {% if content.isTwigContent is defined and content.isTwigContent %} - {% if content.showOn('edit') %} - {% include content.template with content.parameters %} - {% endif %} + + {% if attribute(form, content.acronym).vars.errors|length %} +
+ {{ form_errors(attribute(form, content.acronym)) }} +
{% endif %} - {% endfor %} -
-
+
+ {% endif %} + {% if content.isTable is defined and content.isTable and content.showInEdit %} +
+
+ {{ content.label }}: +
+
+
+
+ {{ content.renderTable(whatwedo_table(), helper.data)|raw }} +
+
+ {% if content.createRoute is defined and content.createRoute and helper.allowEdit(helper.data) %} + + {% endif %} + {% endif %} + {% if content.isTwigContent is defined and content.isTwigContent %} + {% if content.showOn('edit') %} + {% include content.template with content.parameters %} + {% endif %} + {% endif %} + {% endfor %}
+
+
{# / Zeile #} - {% if i == 2 %} + {% if i == 2 or block.size == "large" %} {% set i = 0 %}
{% set isOpen = false %} + {# Falls nächste Zeile Gross #} + {% elseif helper.blocks[keyArr[loop.index]] is defined %} + {% if helper.blocks[keyArr[loop.index]].size == "large" %} + {% set i = 0 %} +
+ {% set isOpen = false %} + {% endif %} {% endif %} {% endfor %} diff --git a/Resources/views/Crud/_boxes/read.html.twig b/Resources/views/Crud/_boxes/read.html.twig index 1b0a3b2a..7e50b132 100644 --- a/Resources/views/Crud/_boxes/read.html.twig +++ b/Resources/views/Crud/_boxes/read.html.twig @@ -1,4 +1,6 @@ {% set i = 0 %} +{% set keyArr = helper.blocks|keys %} + {% for block in helper.blocks %} {# Zeile #} @@ -7,89 +9,99 @@
{% endif %} -
-
-
-

- {{ block.label }} -

-
+
+
+
+

+ {{ block.label }} +

+
-
- {% for key, content in block.contents %} +
+ {% for key, content in block.contents %} - {% if content.isTable is defined and content.isTable %} -
-
- {{ content.label }}{% if content.label is not empty %}:{% endif %} -
-
-
-
- {{ content.renderTable(whatwedo_table(), data)|raw }} -
-
- {% if content.createRoute is defined and content.createRoute %} -
-
- {% if content.indexRoute %} - + {% if content.isTable is defined and content.isTable %} +
+
+ {{ content.label }}{% if content.label is not empty %}:{% endif %} +
+
+
+
+ {{ content.renderTable(whatwedo_table(), data)|raw }} +
+
+ {% if content.createRoute is defined and content.createRoute %} +
+
+ {% if content.indexRoute %} + Alle ansehen - {% endif %} - {% if content.createRoute and content.allowCreate(helper.data) %} - + {% endif %} + {% if content.createRoute and content.allowCreate(helper.data) %} + Hinzufügen - {% endif %} -
+ {% endif %}
- {% endif %} - {% elseif content.isTwigContent is defined and content.isTwigContent %} - {% if content.showOn('read') %} - {% include content.template with content.parameters %} - {% endif %} - {% else %} +
+ {% endif %} + {% elseif content.isTwigContent is defined and content.isTwigContent %} + {% if content.showOn('read') %} + {% include content.template with content.parameters %} + {% endif %} + {% else %} - {% set value = content.render(data) %} + {% set value = content.render(data) %} - {% if value is iterable %} - {% for key, v in value %} -
-
- {{ key }}: -
-
- {{ helper.linkIt(v, content)|raw }} -
-
- {% endfor %} - {% else %} -
-
- {{ content.label }}{% if content.label is not empty %}:{% endif %} - {% if content.help is not empty %} {% endif %} - -
-
- {{ helper.linkIt(value, content)|raw }} -
+ {% if value is iterable %} + {% for key, v in value %} +
+
+ {{ key }}:
- {% endif %} +
+ {{ helper.linkIt(v, content)|raw }} +
+
+ {% endfor %} + {% else %} +
+
+ {{ content.label }}{% if content.label is not empty %}:{% endif %} + {% if content.help is not empty %} {% endif %} + +
+
+ {{ helper.linkIt(value, content)|raw }} +
+
+ {% endif %} - {% endif %} + {% endif %} - {% endfor %} -
-
+ {% endfor %}
+
+
{# / Zeile #} - {% if i == 2 or loop.index == loop.length %} + {% if i == 2 or loop.index == loop.length or block.size == "large" %} {% set i = 0 %}
+ {% elseif helper.blocks[keyArr[loop.index]] is defined %} + {% if helper.blocks[keyArr[loop.index]].size == "large" %} + {% set i = 0 %} +
+ {% endif %} {% endif %} {% endfor %}