Skip to content

Commit

Permalink
Merge pull request sonata-project#1567 from KingCrunch/collection-ind…
Browse files Browse the repository at this point in the history
…entation

Extra indentation with collections
  • Loading branch information
rande committed Oct 24, 2013
2 parents 5dfde8a + a8c96d2 commit 771c13e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Resources/public/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ body.sonata-bc {
display: none;
}

.sonata-bc .form-horizontal .sonata-collection-row-without-label {
margin-left: 0;
}

ul.inputs-list {
padding-left: 150px;
}
Expand Down Expand Up @@ -374,4 +378,4 @@ legend.sonata-ba-fieldset-collapsed-description + .sonata-ba-collapsed-fields {

span.field-actions {
margin-left: 10px;
}
}
7 changes: 4 additions & 3 deletions Resources/views/Form/form_admin_fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ file that was distributed with this source code.
{% if sonata_admin is not defined or not sonata_admin_enabled or not sonata_admin.field_description %}
<div class="control-group {% if errors|length > 0%} error{% endif %}">
{{ form_label(form, label|default(null)) }}
<div class="controls">
<div class="controls {% if label is not sameas(false) %}sonata-collection-row-without-label{% endif %}">
{{ form_widget(form) }}
{% if errors|length > 0 %}
<div class="help-inline sonata-ba-field-error-messages">
Expand All @@ -133,7 +133,8 @@ file that was distributed with this source code.
{% endif %}
{% endblock %}

<div class="controls sonata-ba-field sonata-ba-field-{{ sonata_admin.edit }}-{{ sonata_admin.inline }} {% if errors|length > 0 %}sonata-ba-field-error{% endif %}">
{% set has_label = sonata_admin.field_description.options.name is defined or label is not sameas(false) %}
<div class="controls sonata-ba-field sonata-ba-field-{{ sonata_admin.edit }}-{{ sonata_admin.inline }} {% if errors|length > 0 %}sonata-ba-field-error{% endif %} {% if not has_label %}sonata-collection-row-without-label{% endif %}">

{{ form_widget(form) }}

Expand Down Expand Up @@ -166,7 +167,7 @@ file that was distributed with this source code.
{% spaceless %}
{% if prototype is defined %}
{% set child = prototype %}
{% set attr = attr|merge({'data-prototype': block('collection_widget_row'), 'data-prototype-name': prototype.vars.name, 'class': attr.class|default('') ~ ' controls' }) %}
{% set attr = attr|merge({'data-prototype': block('collection_widget_row'), 'data-prototype-name': prototype.vars.name, 'class': attr.class|default('') }) %}
{% endif %}
<div {{ block('widget_container_attributes') }}>
{{ form_errors(form) }}
Expand Down

0 comments on commit 771c13e

Please sign in to comment.