{% extends "crud/edit.html.twig" %}
{% block formContent %}
    <input type="hidden" name="id" value="{{ model.id }}" />
    <div class="form-group required">
        <label for="nome" class="control-label">{% trans %}Nome{% endtrans %}</label>
        <input id="nome" type="text" name="nome" class="form-control" value="{{ model.nome }}" maxlength="30" />
    </div>
    <div class="form-group required">
        <label for="descricao" class="control-label">{% trans %}Descrição{% endtrans %}</label>
        <textarea id="descricao" name="descricao" class="form-control" rows="5" maxlength="100">{{ model.descricao }}</textarea>
    </div>
    {% if model.id != 1 %}
    <div class="form-group required">
        <label for="peso" class="control-label">{% trans %}Peso{% endtrans %}</label>
        <select id="peso" name="peso" class="form-control">
            {% for k,v in pesos %}
            <option value="{{ k }}" {% if k == model.peso %}selected="selected"{% endif %}>{{ v }}</option>
            {% endfor %}
        </select>
    </div>
    {% else %}
        {# somente para manter a regra de validacao de campos obrigatorios #}
        <input type="hidden" name="peso" value="0">
    {% endif %}
    <div class="form-group required">
        <label for="status" class="control-label">{% trans %}Status{% endtrans %}</label>
        <select id="status" name="status" class="form-control">
            {% for k,v in status %}
            <option value="{{ k }}" {% if k == model.status %}selected="selected"{% endif %}>{{ v }}</option>
            {% endfor %}
        </select>
    </div>
{% endblock %}