<section class="extra content-padding">
    <nav class="tabs">
        <ul>
            {% block form_tabs %}
                {% block form_tab_algemeen %}<li class="active"><a href="#algemeen" data-toggle="tab">{{ 'form_entry.view.prop.algemeen'|trans({}, 'backend') }}</a></li>{% endblock %}
                {% block form_tab_technisch %}<li><a href="#technisch" data-toggle="tab">{{ 'form_entry.view.prop.technisch'|trans({}, 'backend') }}</a></li>{% endblock %}
                {% block form_tab_email %}<li><a href="#email" data-toggle="tab">{{ 'form_entry.view.prop.email'|trans({}, 'backend') }}</a></li>{% endblock %}
            {% endblock %}
        </ul>
    </nav>
</section>

<section class="content-padding">

    {{ block_position('flashmessages') }}

    <div class="tab-content">

        {% block form_tab_content %}

            {% block form_algemeen %}
                <div id="algemeen" class="tab-pane active">

                    <div class="form-horizontal">

                        <div class="form-group row max-width">
                            <label class="col-xs-12 col-sm-4">{{ 'form_entry.view.prop.toegevoegd'|trans({}, 'backend') }}</label>
                            <div class="col-xs-12 col-sm-8">
                                {{ form_entry.toegevoegd|format_datetime(null, 'nl', 'Europe/Amsterdam', constant('IntlDateFormatter::LONG'), constant('IntlDateFormatter::MEDIUM')) }}
                            </div>
                        </div>

                        <div class="form-group row max-width">
                            <label class="col-xs-12 col-sm-4">{{ 'form_entry.view.prop.url'|trans({}, 'backend') }}</label>
                            <div class="col-xs-12 col-sm-8">
                                {{ form_entry.url }}
                            </div>
                        </div>

                        <div class="spacer"></div>

                        {% for form_field in form_entry.form.fields %}

                            <div class="form-group row max-width">
                                <label class="col-xs-12 col-sm-4">{{ form_field.titel }}</label>
                                <div class="col-xs-12 col-sm-8">
                                    {% if form_entry.rawdata[form_field.referentie] is defined %}
                                        {% if form_entry.rawdata[form_field.referentie] is iterable %}
                                            {% for key, value in form_entry.rawdata[form_field.referentie] %}
                                                {% for subkey, subvalue in value %}
                                                    <em>{{ subkey }}:</em> {{ subvalue }}<br />
                                                {% endfor %}
                                                <br />
                                            {% endfor %}
                                        {% else %}
                                            {{ form_entry.rawdata[form_field.referentie] }}
                                        {% endif %}
                                    {% else %}
                                        <em>{{ 'form_entry.view.prop.field_data_na'|trans({}, 'backend') }}</em>
                                    {% endif %}
                                </div>
                            </div>


                        {% endfor %}

                        <div class="spacer"></div>

                        <div class="form-group row max-width">
                            <label class="col-xs-12 col-sm-4">{{ 'form_entry.view.prop.landing_url'|trans({}, 'backend') }}</label>
                            <div class="col-xs-12 col-sm-8">
                                {{ form_entry.landingUrl }}
                            </div>
                        </div>

                        <div class="form-group row max-width">
                            <label class="col-xs-12 col-sm-4">{{ 'form_entry.view.prop.landing_referer'|trans({}, 'backend') }}</label>
                            <div class="col-xs-12 col-sm-8">
                                {{ form_entry.landingReferer }}
                            </div>
                        </div>

                        <div class="form-group row max-width">
                            <label class="col-xs-12 col-sm-4">{{ 'form_entry.view.prop.time_on_site_in_sec'|trans({}, 'backend') }}</label>
                            <div class="col-xs-12 col-sm-8">
                                {{ form_entry.timeOnSiteInSec|number_format(0, '', '.') }} sec.
                            </div>
                        </div>


                        


                            
                    </div>

                </div>
            {% endblock %}

            {% block form_technisch %}
                <div id="technisch" class="tab-pane">

                    <div class="form-horizontal">

                        <div class="form-group row max-width">
                            <label class="col-xs-12 col-sm-4">{{ 'form_entry.view.prop.remote_addr'|trans({}, 'backend') }}</label>
                            <div class="col-xs-12 col-sm-8">
                                {{ form_entry.remoteAddr }}
                            </div>
                        </div>

                        <div class="form-group row max-width">
                            <label class="col-xs-12 col-sm-4">{{ 'form_entry.view.prop.browser'|trans({}, 'backend') }}</label>
                            <div class="col-xs-12 col-sm-8">
                                {{ form_entry.browser }}
                            </div>
                        </div>

                        <div class="form-group row max-width">
                            <label class="col-xs-12 col-sm-4">{{ 'form_entry.view.prop.rawdata'|trans({}, 'backend') }}</label>
                            <div class="col-xs-12 col-sm-8">
                                {% for field, value in form_entry.rawdata %}
                                    {% if value is iterable %}
                                        {% for key, value in value %}
                                            <br />
                                            {% for subkey, subvalue in value %}
                                                <em>{{ subkey }}:</em> {{ subvalue }}<br />
                                            {% endfor %}                                            
                                        {% endfor %}
                                    {% else %}
                                        <em>{{ field }}:</em> {{ value }}<br />
                                    {% endif %}
                                {% endfor %}
                            </div>
                        </div>


                    </div>

                </div>
            {% endblock %}

            {% block form_email %}
                <div id="email" class="tab-pane">
                    <div class="max-width">
                        <div class="row">
                            <iframe style="height: 600px; border: 1px solid #eee;" frameborder="0" class="col-xs-12" src="{{ path('manage_form_entry_view_email', { id : form_entry.id }) }}"></iframe>
                        </div>
                    </div>

                </div>
            {% endblock %}

        {% endblock form_tab_content %}

    </div>
</section>
