<div class="row">
  <div class="col span-6">
    <FormNameDescription
      @bothColClass="col span-12"
      @colClass="col span-12"
      @editing={{or (eq mode "new") (not mode "view")}}
      @model={{primaryResource}}
      @nameLabel="cruClusterTemplate.name.label"
      @nameRequired={{true}}
    />
  </div>
  <div class="col span-6">
    <FormNameDescription
      @bothColClass="col span-12"
      @colClass="col span-12"
      @descriptionDisabled={{true}}
      @descriptionShown={{false}}
      @editing={{notView}}
      @focusDisabledOnInit={{true}}
      @model={{clusterTemplateRevision}}
      @nameLabel="cruClusterTemplate.revisionName.label"
      @nameRequired={{false}}
    />
  </div>
</div>

<div class="row pb-20">
  <div class="col span-6">
    <label class="acc-label">
    </label>
    <div class="radio">
      <label>
        {{#if (or (eq clusterTemplate.revisions.length 0) isView)}}
          {{input
            type="checkbox"
            classNames="form-control"
            checked=true
            disabled=isView
          }}
        {{else}}
          {{input
            type="checkbox"
            classNames="form-control"
            checked=setDefaultTemplateRevision
          }}
        {{/if}}
        {{t "cruClusterTemplate.default.label"}}
      </label>
    </div>
  </div>
</div>

<div class="row">
  <AccordionList
    @showExpandAll={{false}}
    as |al expandFn|
  >
    <AccordionListItem
      @title={{t "cruClusterTemplate.members.label"}}
      @detail={{t "cruClusterTemplate.members.detail"}}
      @expandAll={{al.expandAll}}
      @everExpanded={{true}}
      @expanded={{expanded}}
      @expandOnInit={{true}}
      @expand={{action expandFn}}
    >
      <FormShareMember
        @editing={{notView}}
        @resource={{primaryResource}}
        @addAuthorizedPrincipal={{action "addAuthorizedPrincipal"}}
        @removeMember={{action "removeMember"}}
        @users={{users}}
        @errors={{memberErrors}}
      />
    </AccordionListItem>
  </AccordionList>
</div>

<div class="row">
  {{cluster-driver/driver-rke
    advanced=true
    mode=mode
    nodeWhich="custom"
    clusterTemplateCreate=notView
    clusterTemplateQuestions=clusterTemplateRevision.questions
    clusterTemplateRevisionId=clusterTemplateRevisionId
    addQuestion=(action "addQuestion")
    removeQuestion=(action "removeQuestion")
    updateFromYaml=(action "updateFromYaml")
    model=(hash
    cluster=(mut cluster)
    originalCluster=originalCluster
    psps=psps
    clusterTemplateRevision=clusterTemplateRevision
    )
    otherErrors=memberErrors
    clusterErrors=errors
    nodePoolErrors=nodePoolErrors
    forceExpandOnInit=true
    overrideCreateLabel="saveCancel.create"
    save=(action "save")
    close=(action "cancel")
    registerHook=(action "registerHook")
  }}
</div>
