1<form onsubmit={{action "createOrUpdate" "create"}}>
2  <div class="box is-sideless is-fullwidth is-marginless">
3    {{message-error model=model}}
4    <NamespaceReminder @mode={{mode}} @noun="SSH role" />
5    {{#if model.attrsForKeyType}}
6      {{#with (if (eq model.keyType 'otp') 3 4) as |numRequired|}}
7        {{#each (take numRequired model.attrsForKeyType) as |attr|}}
8          {{#unless (and (eq mode 'edit') (eq attr.name 'name'))}}
9            {{partial "partials/form-field-from-model"}}
10          {{/unless}}
11        {{/each}}
12        {{toggle-button
13          toggleAttr="showOptions"
14          toggleTarget=this
15          openLabel="Hide options"
16          closedLabel="More options"
17          data-test-toggle-more="true"
18        }}
19        {{#if showOptions}}
20          <div class="box is-marginless">
21            {{#each (drop numRequired model.attrsForKeyType) as |attr|}}
22              {{partial "partials/form-field-from-model"}}
23            {{/each}}
24          </div>
25        {{/if}}
26      {{/with}}
27    {{/if}}
28  </div>
29  <div class="field is-grouped-split box is-fullwidth is-bottomless">
30    <div class="control">
31      <button
32        type="submit"
33        disabled={{buttonDisabled}}
34        class="button is-primary"
35        data-test-role-ssh-create=true
36      >
37        {{#if (eq mode 'create')}}
38          Create role
39        {{else if (eq mode 'edit')}}
40          Save
41        {{/if}}
42      </button>
43      {{#secret-link
44        mode=(if (eq mode "create") "list" "show")
45        class="button"
46        secret=model.id
47      }}
48        Cancel
49      {{/secret-link}}
50    </div>
51  </div>
52</form>
53