<?php
if (count($model->getProviderChoose()) > 1) {
    echo $form->dropdownListRow($model, 'providerTemplate', $model->getProviderChoose(), array(
        'span' => 2,
        'data-translation-target' => 'GATEWAY_MODEL_PROVIDER_TEMPLATE_TRANSLATION',
        "disabled" => !$model->isNewRecord,
        "data-templateDataUrl" => url("routingGateways/default/addTemplateSettings"),
        "data-ajax-error-msg" => __("GATEWAY_FORM_GET_TEMPLATE_DATA_AJAX_ERROR"),
        "data-translation-id" => "GATEWAY_FORM_GET_TEMPLATE_DATA_AJAX_ERROR"
    ));
    echo '<div id="providerTemplateNameText" style="display:none;margin-top:6px;">' . $this->renderProviderTemplateName($model) . '</div>';
}

echo $form->checkBoxRow($model, 'active', array(
    'data-translation-id' => 'GATEWAY_MODEL_ACTIVE',
    'data-translation-id' => 'ACTIVE_ATTRIBUTE',
));

$isNewRecord = "false";
if ($model->isNewRecord) {
    $isNewRecord = "true";
}

?>
<script>
    var isNewRecord = "<?php echo $isNewRecord; ?>";

    if (isNewRecord === 'false') {
        var providerDropdown = $('#Gateway_providerTemplate');
        var providerNameText = $('#providerTemplateNameText');
        providerDropdown.after(providerNameText);
        providerDropdown.hide();
        providerNameText.show();
    }

</script>