{% extends 'dashboard/layout.html' %} {% load i18n %} {% load staticfiles %} {% block body_class %}stores{% endblock %} {% block extrahead %} {% endblock %} {% block title %} {{ title }} | {{ block.super }} {% endblock %} {% block breadcrumbs %} {% endblock %} {% block headertext %}{{ title }}{% endblock %} {% block dashboard_content %} {% if form.errors %}
{% trans "Your submitted data did not validate - please correct the below errors and resubmit." %}
{% endif %}
{% csrf_token %} {% if form.non_field_errors %} {% for error in form.non_field_errors %}
{{ error }}
{% endfor %} {% endif %}

{% trans "Store details" %}

{% include "dashboard/partials/form_field.html" with field=form.name %} {% include "dashboard/partials/form_field.html" with field=form.description %} {% include "dashboard/partials/form_field.html" with field=form.reference %} {% include "dashboard/partials/form_field.html" with field=form.group %} {% include "dashboard/partials/form_field.html" with field=form.image %} {% include "dashboard/partials/form_field.html" with field=form.is_pickup_store %} {% include "dashboard/partials/form_field.html" with field=form.is_active %}

{% trans "Contact details" %}

{% include "dashboard/partials/form_field.html" with field=form.manager_name %} {% include "dashboard/partials/form_field.html" with field=form.phone %} {% include "dashboard/partials/form_field.html" with field=form.email %}

{% trans "Address" %}

{% with formset=inlines.1 %} {{ formset.management_form }} {% for address_form in formset %} {% if address_form.non_field_errors %} {% for error in address_form.non_field_errors %}
{{ error }}
{% endfor %} {% endif %} {% for field in address_form %} {% include "dashboard/partials/form_field.html" %} {% endfor %} {% endfor %} {% endwith %}

{% trans "Location" %}

{% blocktrans %} Enter an adddress in the location input and select your address from the options that appear. You can drag the marker around on the map to fine-tune the location. {% endblocktrans %}

{% include "dashboard/partials/form_field.html" with field=form.location %}
{% if form.location.errors %}
{% trans "Please select a location for your store." %}
{% endif %}

{% trans "Opening hours" %}

{# use the first formset which is the opening times #} {% with workhours=inlines.0 %} {{ formset.management_form }} {% for formset in workhours %} {% if formset.non_field_errors %} {% for error in formset.non_field_errors %}
{{ error }}
{% endfor %} {% endif %}
{{ formset.open }}
{{ formset.0.start.label_tag }}
{{ formset.0.end.label_tag }}
{% for form in formset %}
{{ form.start }}
{{ form.end }}
{{ form.id }} {% if form.errors %}
{% for field in form %} {% if field.errors %} {{ field.label }}: {% for err in field.errors %}{{ err }}{% endfor %}
{% endif %} {% endfor %} {# Non-field errors #} {% if form.non_field_errors %} {{ form.non_field_errors }}
{% endif %}
{% endif %}
{% endfor %}
{{ formset.management_form }}
{% endfor %} {% endwith %}
{% trans "Cancel" %} {% trans "or" %}
{% endblock dashboard_content %} {% block extrascripts %} {{ block.super }} {% endblock %} {% block onbodyload %} {{ block.super }} stores.dashboard.init(); $('.nav-list a').on('shown', function (e) { google.maps.event.trigger(stores.dashboard.map, 'resize'); }) {% endblock onbodyload %}