<clr-modal [(clrModalOpen)]="createDeploymentTplOpened" [clrModalSize]="'lg'" #modal>
  <h3 class="modal-title">{{deploymentTplTitle}}
    <wayne-modal-operate [modal]="modal" *ngIf="createDeploymentTplOpened"></wayne-modal-operate>
  </h3>
  <div class="modal-body">
    <form #deploymentTplForm="ngForm">

      <section class="form-block">
        <div class="form-group" style="padding-left: 135px;">
          <label for="deployment_app_id" class="clr-col-md-3 form-group-label-override required">{{'DEPLOYMENT_ADMIN.TMP.CREATE.DEPLOYMENT' | translate}}</label>
          <div class="select form-control">
            <select id="deployment_app_id" [(ngModel)]="deploymentTpl.deploymentId" [disabled]="actionType==1"
                    name="deployment_app_id">
              <!--这是一个坑，如果使用value获取到的是string，使用ngValue获取到的是model本身类型-->
              <option *ngFor="let deployment of deployments" [ngValue]="deployment.id"
                      [selected]="deployment.id === deploymentTpl.deploymentId">{{deployment.name}}
              </option>
            </select>
          </div>
        </div>
        <div class="form-group" style="padding-left: 135px;">
          <label for="deployment_description"
                 class="clr-col-md-3 form-group-label-override">{{'DEPLOYMENT_ADMIN.TMP.CREATE.DESCRIPTION' | translate}}</label>
          <textarea id="deployment_description" [(ngModel)]="deploymentTpl.description"
                    name="deployment_description"
                    rows="3">
          </textarea>

        </div>
        <div class="form-group" style="padding-left: 135px;">
          <label for="deployment_template" class="clr-col-md-3 form-group-label-override">{{'DEPLOYMENT_ADMIN.TMP.CREATE.TMP' | translate}}</label>
          <wayne-ace-editor-box></wayne-ace-editor-box>
        </div>
      </section>
    </form>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-outline" (click)="onCancel()">{{'BUTTON.CANCEL' | translate}}</button>
    <button type="button" class="btn btn-primary" [disabled]="!isValid"
            (click)="onSubmit()">{{'BUTTON.SUBMIT' | translate}}</button>
  </div>
</clr-modal>
