{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% load staticfiles %}
{% load manager_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="ym-form">
{% csrf_token %}
{{ form.non_field_errors }}
{{form.ingredient}}
<table>
    <tr>
        <td style="text-align:right;">
            <label for="id_ingredient_searchfield">
            {% trans "Ingredient name" %}
            </label>
        </td>
        <td>
            <div class="ym-fbox-text">
            <input type="text"
                   id="id_ingredient_searchfield"
                   name="ingredient_searchfield"
                   value="{{ingredient_searchfield}}">
            </div>
            <div id="exercise_name" class="ym-fbox-text"></div>
        </td>
    </tr>
    
    
    
    {% yaml_form_field form.amount %}
    {% yaml_form_field form.weight_unit "ym-fbox-select" %}
    <tr>
        <td colspan="2">
            <input type="submit" value="{% trans 'Save' %}" id="form-save">
        </td>
    </tr>
</table>
</form>



{% endblock %}
