{% macro create(optionName, permission, inputId, network) %}

    {% set inline = getMetadata(optionName, 'INLINE')|join(' ') %}
    {% set description = getMetadata(optionName, 'DESCRIPTION') %}
    {% set type = getMetadata(optionName, 'TYPE') %}
    {% set angularAttributes = getMetadata(optionName, 'ANGULAR_ATTRIBUTES') %}
    {% set newNetwork = isOnNetworkDashboard() %}

    {% if permission < 3 %}
        {% set disabled = "disabled" %}
    {% else %}
        {% set disabled = "" %}
    {% endif %}

    {% if not angularAttributes is empty %}
        {% if newNetwork  %}
            {% set angularAttributes = angularAttributes ~ ' && (0))"' %}
        {% else %}
            {% set angularAttributes = angularAttributes ~ ' && (1))"' %}
        {% endif %}
    {% else %}
        {% set angularAttributes = '' %}
    {% endif %}

    <!-- TODO ng-hide anpassen -->
    {% if optionName == "base_dn" %}
        <input id="{{ inputId }}" type="{{ type }}" {{ inline }} {{ angularAttributes|raw }} {{ disabled }} ng-model="option.{{ optionName }}" ng-class="{ 'error': messages.{{ optionName }}.error, 'warning': messages.{{ optionName }}.warning }" style="width: 450px"/>
    {% else  %}
        <input id="{{ inputId }}" type="{{ type }}" {{ inline }} {{ angularAttributes|raw }} {{ disabled }} ng-model="option.{{ optionName }}" ng-class="{ error: messages.{{ optionName }} != null }"/>
    {% endif %}

    <p>
        {% import "option/element/error-msg.twig" as errorElement %}
        {{ errorElement.create(optionName) }}
    </p>

    {% import "option/element/description.twig" as descriptionElement %}
    {{ descriptionElement.create(description) }}

{% endmacro %}