{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}
{% load wger_extras %}

{% block header %}

{{ form.media }}

{% if custom_js %}
<script type="text/javascript">
    {{custom_js|safe}}
</script>
{% endif %}

{% endblock %}

<!--
        Title
-->
{% block title %}{{title}}{% endblock %}


<!--
        Main Content
-->
{% block content %}
<form action="{{form_action}}"
      {% if enctype %}enctype="{{enctype}}"{% endif %}
      method="post"
      class="ym-form">
{% csrf_token %}

{% if form.non_field_errors %}
<div class="ym-fbox-text ym-error">
    {% for error in form.non_field_errors %}
        <p class="ym-message">{% trans error %}</p>
    {% endfor %}
</div>
{% endif %}

<table>
    {% for current_field in form_fields %}
        {% yaml_form_field current_field %}
    {% endfor %}
    <tr>
        <td colspan="2">
            <input type="submit" value="{{submit_text}}" id="form-save">
        </td>
    </tr>
</table>
</form>
{% endblock %}


<!--
        Side bar
-->
{% block sidebar %}{% if sidebar %}{% include sidebar %}{% endif %}{% endblock %}
