{% extends "oscar/dashboard/layout.html" %}
{% load i18n %}

{% load i18n %}

{% block titletag %}{{ view.menu_label|title }}{% endblock %}
{% block content %}
    
    {% include "wagtailadmin/shared/header.html" with title=view.menu_label|title %}

    <div class="nice-padding">
        <p>
            {% trans "Choose how fields are mapped." as help_text %}
            {{ view.help_text|default_if_none:help_text }}
        </p>
        <h2>{% translate "Default mappings" %}</h2>
        {% for fieldmapping in standard_mapping %}
        <div class="w-field-row">
          <div class="w-field__wrapper">
            <label class="w-field__label">{{ fieldmapping.from_field|default_if_none:""|join:"," }}</label>
          </div>
          <div class="w-field__wrapper">
            {{ fieldmapping.action|default_if_none:"" }}
            ->
          </div>
          <div class="w-field__wrapper">
          {% with jan=fieldmapping.to_field|default_if_none:""|join:"," %}
          {% translate jan %}
          {% endwith %}
          </div>
        </div>
        {% endfor %}
        {% block form %}
        <h2>{% translate "Dynamic mappings" %}</h2>
        <form method="POST" action="" novalidate>
            {% csrf_token %}
            {{ form.management_form }}
            {% for a in form %}
                <div class="w-field-row">
                {% for field in a.hidden_fields %}{{ field }}{% endfor %}
                {% for field in a.visible_fields %}
                    {% include "wagtailadmin/shared/field.html" with field=field only %}
                {% endfor %}
                </div>
                {% include "wagtailadmin/shared/non_field_errors.html" with form=a only %}<hr/>
            {% endfor %}
            <input type="submit" value="{% trans 'Save' %}" class="button" />
        </form>
        {% endblock %}
    </div>
{% endblock %}



