<!--
  ~ Copyright 2021 Red Hat, Inc. and/or its affiliates
  ~ and other contributors as indicated by the @author tags.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">

    <ol class="breadcrumb">
        <li><a href="#/realms/{{realm.realm}}/client-policies/profiles">{{:: 'client-profiles' | translate}}</a></li>
        <li><a href="#/realms/{{realm.realm}}/client-policies/profiles-update/{{editedProfile.name}}">{{editedProfile.name}}</a></li>
        <li data-ng-show="createNew">{{:: 'create-executor' | translate}}</li>
        <li data-ng-hide="createNew">{{executorType.id}}</li>
    </ol>

    <h1 data-ng-hide="createNew">{{executorType.id|capitalize}}</h1>
    <h1 data-ng-show="createNew">{{:: 'create-executor' | translate}}</h1>

    <form class="form-horizontal" name="realmForm" novalidate kc-read-only="isReadOnly()">
        <fieldset>
            <div class="form-group" data-ng-show="createNew">
                <label class="col-md-2 control-label" for="executorTypeCreate">{{:: 'executor-type' | translate}}</label>
                <div class="col-sm-6">
                    <div>
                        <select class="form-control" id="executorTypeCreate"
                                ng-model="executorType"
                                ng-options="executorType.id for (executorKey, executorType) in executorTypes">
                        </select>
                    </div>
                </div>
                <kc-tooltip>{{executorType.helpText}}</kc-tooltip>
            </div>
            <div class="form-group clearfix" data-ng-hide="createNew">
                <label class="col-md-2 control-label" for="executorType">{{:: 'executor-type' | translate}}</label>
                <div class="col-md-6">
                    <input class="form-control" id="executorType" type="text" ng-model="executorType.id" data-ng-readonly="true">
                </div>
                <kc-tooltip>{{executorType.helpText}}</kc-tooltip>
            </div>
            <kc-provider-config config="executor.config" properties="executorType.properties" realm="realm"></kc-provider-config>
        </fieldset>

        <div class="form-group" data-ng-hide="isReadOnly()">
            <div class="col-md-10 col-md-offset-2">
                <button kc-save>{{:: 'save' | translate}}</button>
                <button kc-cancel data-ng-click="cancel()">{{:: 'cancel' | translate}}</button>
            </div>
        </div>

    </form>
</div>

<kc-menu></kc-menu>