{{> headers/_Title title="console.services.edit.titleNew" }}

<div class="panel multiple-panels panel-content">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="clearfix">
                <div class="form-group">
                    {{#if creatableTypes.[1]}}
                    <label class="control-label" for="serviceSelection">{{t "console.services.edit.chooseServiceType"}}</label>
                    <select data-service-selection class="selectize form-control">
                        <option disabled selected value="">{{t "console.services.edit.serviceTypes"}}</option>
                        {{#each creatableTypes}}
                        <option value="{{_id}}">{{name}}</option>
                        {{/each}}
                    </select>

                    {{else}}
                        {{#if creatableTypes.[0]}}
                        <label class=" control-label" for="serviceSelection">{{t "common.form.type"}}</label>
                        <div class="">
                            <input type="text" id="serviceSelection" class="form-control" value="{{creatableTypes.[0].name}}" readonly="true" >
                        </div>
                        {{/if}}
                    {{/if}}
                </div>

            </div>

            {{#if creatableTypes.[0]}}
                <div class="clearfix">
                    <form data-json-form></form>
                </div>
            {{else}}
                {{> alerts/_Alert text="console.services.edit.unavaliableAlert" type="info"}}
            {{/if}}

        </div>
    </div>

    <div class="panel-footer clearfix">
        <div class="pull-right">
            <a class="btn btn-default" href="{{routeTo 'realmsServices' realmPath}}">{{t "common.form.cancel"}}</a>
            <button data-create class="btn btn-primary" type="button" disabled>{{t "common.form.create"}}</button>
        </div>
    </div>
</div>
