{% extends 'utilities/obj_edit.html' %}
{% load form_helpers %}

{% block form %}
    <div class="panel panel-default">
        <div class="panel-heading"><strong>Service</strong></div>
        <div class="panel-body">
            {% if obj.device %}
                <div class="form-group">
                    <label class="col-md-3 control-label required">Device</label>
                    <div class="col-md-9">
                        <p class="form-control-static">{{ obj.device }}</p>
                    </div>
                </div>
            {% else %}
                <div class="form-group">
                    <label class="col-md-3 control-label required">Virtual Machine</label>
                    <div class="col-md-9">
                        <p class="form-control-static">{{ obj.virtual_machine }}</p>
                    </div>
                </div>
            {% endif %}
            {% render_field form.name %}
            <div class="form-group form-inline">
                <label class="col-md-3 control-label required">Port</label>
                <div class="col-md-9">
                    {{ form.protocol }}
                    {{ form.port }}
                </div>
            </div>
            {% render_field form.ipaddresses %}
            {% render_field form.description %}
        </div>
    </div>
    {% if form.custom_fields %}
        <div class="panel panel-default">
            <div class="panel-heading"><strong>Custom Fields</strong></div>
            <div class="panel-body">
                {% render_custom_fields form %}
            </div>
        </div>
    {% endif %}
    <div class="panel panel-default">
        <div class="panel-heading"><strong>Tags</strong></div>
        <div class="panel-body">
            {% render_field form.tags %}
        </div>
    </div>
{% endblock %}
