{% extends "crud/edit.html.twig" %}
{% block formContent %}
    <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="50" />
    </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>
    <div class="form-group required">
        <label for="status" class="control-label">{% trans %}Status{% endtrans %}</label>
        <select id="status" name="status" class="form-control">
            <option value="">{% trans %}Selecione{% endtrans %}</option>
            <option value="1" {% if model.status == 1 %}selected="selected"{% endif %}>{% trans %}Ativo{% endtrans %}</option>
            <option value="0" {% if model.status == "0" %}selected="selected"{% endif %}>{% trans %}Inativo{% endtrans %}</option>
        </select>
    </div>
    {% if model.id and model.subServicos|length %}
    <fieldset>
        <legend>{% trans %}Subserviços{% endtrans %}</legend>
        <ul>
            {% for sub in model.subServicos %}
            <li>{{ sub.nome }}</li>
            {% endfor %}
        </ul>
    </fieldset>
    {% else %}
    <div class="form-group">
        <label for="macro" class="control-label">{% trans %}Macro{% endtrans %}</label>
        <select id="macro" name="id_macro" class="form-control">
            <option value="">{% trans %}Selecione{% endtrans %}</option>
            {% for item in macros%}
            <option value="{{ item.id }}" {% if item.id == model.mestre.id %}selected="selected"{% endif %}>{{ item }}</option>
            {% endfor %}
        </select>
    </div>
    {% endif %}
{% endblock %}