Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
xarem committed Oct 3, 2017
2 parents a6d9906 + 1279842 commit dc46b66
Show file tree
Hide file tree
Showing 3 changed files with 233 additions and 199 deletions.
131 changes: 70 additions & 61 deletions Resources/views/Crud/_boxes/create.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'class': 'default-crud-form'
}
}) }}

{% set keyArr = helper.blocks|keys %}
{% if form.vars.errors|length > 0 %}
<div class="alert alert-error alert-dismissible">
<i class="icon fa fa-ban"></i>
Expand All @@ -21,80 +21,89 @@
<div class="row">
{% endif %}

<div class="col-lg-{% if block.size == 'small' %}6{% else %}12{% endif %} box__{{ block.acronym }}">
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">
{{ block.label }}
</h3>
</div>
<div class="col-lg-{% if block.size == 'small' %}6{% else %}12{% endif %} box__{{ block.acronym }}">
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">
{{ block.label }}
</h3>
</div>

<div class="box-body">
{% for content in block.contents %}
{% if attribute(form, content.acronym) is defined %}
<div class="form-group{% if attribute(form, content.acronym).vars.errors|length %} has-error{% endif %} form-group__{{ content.acronym }}">
{% if content.label %}
<label for="{{ attribute(form, content.acronym).vars.id }}">
{% if attribute(form, content.acronym).vars.errors|length %}
<i class="fa fa-times-circle-o"></i>
{% endif %}
{{ content.label }}:
{% for attrname, attrvalue in attribute(form, content.acronym).vars.attr %}
{% if attrname == 'help' %}
&nbsp;<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="{{ attrvalue }}"></i>
<div class="box-body">
{% for content in block.contents %}
{% if attribute(form, content.acronym) is defined %}
<div
class="form-group{% if attribute(form, content.acronym).vars.errors|length %} has-error{% endif %} form-group__{{ content.acronym }}">
{% if content.label %}
<label for="{{ attribute(form, content.acronym).vars.id }}">
{% if attribute(form, content.acronym).vars.errors|length %}
<i class="fa fa-times-circle-o"></i>
{% endif %}
{{ content.label }}:
{% for attrname, attrvalue in attribute(form, content.acronym).vars.attr %}
{% if attrname == 'help' %}
&nbsp;<i class="fa fa-question-circle" data-toggle="tooltip"
data-placement="right" title="{{ attrvalue }}"></i>
{% endif %}
{% endfor %}
</label>
{% endif %}
{{ form_widget(attribute(form, content.acronym)) }}
{% if content.autoFill is not null %}
{% for autoFill in content.autoFill %}
<div class="hidden auto-fill">
<ul data-set-to="{{ autoFill.apply_to }}"
data-listen-on="{{ attribute(form, content.acronym).vars.id }}">
{% for choice in attribute(form, content.acronym).vars.choices %}
{% set value2 = attribute(choice.data, autoFill.property) %}
{% if autoFill['transform'] is defined %}
<li data-value="{{ choice.value }}"
data-value2="{{ whatwedo_crud_callable(autoFill['transform'], value2) }}"></li>
{% else %}
<li data-value="{{ choice.value }}" data-value2="{{ value2 }}"></li>
{% endif %}
{% endfor %}
</label>
{% endif %}
{{ form_widget(attribute(form, content.acronym)) }}
{% if content.autoFill is not null %}
{% for autoFill in content.autoFill %}
<div class="hidden auto-fill">
<ul data-set-to="{{ autoFill.apply_to }}" data-listen-on="{{ attribute(form, content.acronym).vars.id }}">
{% for choice in attribute(form, content.acronym).vars.choices %}
{% set value2 = attribute(choice.data, autoFill.property) %}
{% if autoFill['transform'] is defined %}
<li data-value="{{ choice.value }}" data-value2="{{ whatwedo_crud_callable(autoFill['transform'], value2) }}"></li>
{% else %}
<li data-value="{{ choice.value }}" data-value2="{{ value2 }}"></li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endfor %}
{% endif %}
</ul>
</div>
{% endfor %}
{% endif %}

{% if attribute(form, content.acronym).vars.errors|length %}
<div class="help-block">
{{ form_errors(attribute(form, content.acronym)) }}
</div>
{% endif %}
{% if attribute(form, content.acronym).vars.errors|length %}
<div class="help-block">
{{ form_errors(attribute(form, content.acronym)) }}
</div>
{% else %}
{% if content.label and content.isTable and content.showInEdit %}
<label>
{{ content.label }}:
</label>
<i>Diese Felder können nach dem Hinzufügen bearbeitet werden.</i>
{% endif %}
{% if content.isTwigContent is defined and content.isTwigContent %}
{% if content.showOn('create') %}
{% include content.template with content.parameters %}
{% endif %}
{% endif %}
{% endif %}
</div>
{% else %}
{% if content.label and content.isTable and content.showInEdit %}
<label>
{{ content.label }}:
</label>
<i>Diese Felder können nach dem Hinzufügen bearbeitet werden.</i>
{% endif %}
{% if content.isTwigContent is defined and content.isTwigContent %}
{% if content.showOn('create') %}
{% include content.template with content.parameters %}
{% endif %}
{% endif %}
{% endif %}

{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>


{# / Zeile #}
{% if i == 2 %}
{% if i == 2 or block.size == "large" %}
{% set i = 0 %}
</div>
{% set isOpen = false %}
{% elseif helper.blocks[keyArr[loop.index]] is defined %}
{% if helper.blocks[keyArr[loop.index]].size == "large" %}
{% set i = 0 %}
</div>
{% endif %}
{% endif %}
{% endfor %}

Expand Down
Loading

0 comments on commit dc46b66

Please sign in to comment.