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


{% block title %}{% trans "Edit meal item" %}{% endblock %}


{% block header %}
<script type="text/javascript">
$(document).ready(function() {
    // Init the autocompleter
    init_ingredient_autocompleter();
});
</script>
{% endblock %}




{% block content %}
<form action="{{ form_action }}"
      method="post"
      class="form-horizontal">
    {% csrf_token %}
    {% render_form_errors form %}
    {{form.ingredient}}

    <div class="form-group {% if field.errors %}has-error{% endif %}" id="form-id_ingredient_searchfield">
        <label for="id_ingredient_searchfield" class="col-md-3 control-label">
            {% trans "Ingredient name" %}
        </label>

        <div class="col-md-9">
            <input type="text"
                   id="id_ingredient_searchfield"
                   name="ingredient_searchfield"
                   value="{{ingredient_searchfield}}"
                   class="form-control">
            <div id="exercise_name"></div>
        </div>
    </div>
    {% render_form_field form.amount %}
    {% render_form_field form.weight_unit %}
    {% render_form_submit submit_text %}
</form>
{% endblock %}
