{% load uikit_admin %}
	<div class="uk-panel uk-panel-header uk-panel-box uk-panel-box-secondary uk-margin-bottom">
		<div class="module aligned {{ fieldset.classes }} uk-form-stacked">
			{% if fieldset.name %}<h4 class="uk-heading-line"><span>{{ fieldset.name }}</span></h4>{% endif %}
			{% if fieldset.description %}
				<div class="description">{{ fieldset.description|safe }}</div>
			{% endif %}

            {% for line in fieldset %} {# Line of fieldset #}
                <div class="uk-grid-collapse uk-child-width-expand@s uk-width-5-6@xl" uk-grid>
                {% for field in line %}
                <div {# % if forloop.last and forloop.counter0 == 0 %}class="uk-width-3-4@l"{% endif % #}> {# A regular field - Adding a field in order to check if this entry is alone on the row #}
                    <div class="uk-padding-small">

                    {% if field.is_checkbox %}
                        {{ field.field }}{{ field.label_tag }}
                    {% else %}
                        {{ field.label_tag }}
                        <div class="uk-form-controls">
                        {% if field.is_readonly %}
                            <div class="readonly">{{ field.contents }}</div>
                        {% else %}
                            {{ field.field }}
                        {% endif %}

                        {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
                        </div>
                    {% endif %}

                    {% if field.field.help_text %}
                        <div class="uk-text-muted">{{ field.field.help_text|safe }}</div>
                    {% endif %}
                    </div>
                </div> {# field #}
                {% endfor %}
                </div>
            {% endfor %}

            {% comment %}
            {% for line in fieldset %}
                <div{% if not line.fields|length_is:'1' %}
                    class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"
                {% elif field.is_checkbox %}
                    class="checkbox-row"
                {% endif %}>

					{% for field in line %}
                        {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
                        {% if field.is_checkbox %}
                            {{ field.field }}{{ field.label_tag }}
                        {% else %}
                            {{ field.label_tag }}
                            {% if field.is_readonly %}
                                <div class="readonly">{{ field.contents }}</div>
                            {% else %}
                                {{ field.field }}
                            {% endif %}
                        {% endif %}
                        {% if field.field.help_text %}
                            <div class="help">{{ field.field.help_text|safe }}</div>
                        {% endif %}

						{% comment %}
                        <div{% if not line.fields|length_is:'1' %}
							class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"
							{% elif field.is_checkbox %}
							class="checkbox-row"
							{% endif %}>
							{% if field.is_checkbox %}
									<label class="uk-form-label">
									{% uk_element field.field "uk-checkbox" %}
									<span class="uk-form-help-inline">{{ field.field.label }}</span></label>
							{% else %}
								{% if field.is_readonly %}
									{{ field.label_tag }}
									<p>{{ field.contents }}</p>
								{% else %}
                                    {{ field.field }}
									{# {% uka_form_row_stacked field.field field.field.errors %}{# uk-form-width-large #}
								{% endif %}
							{% endif %}
						</div>
						{# FIM COMMENT #}
					{% endfor %}
				</div>
			{% endfor %}
            {% endcomment %}
		</div>
	</div>