github.com/outbrain/consul@v1.4.5/ui-v2/app/templates/dc/acls/policies/-form.hbs (about)

     1  <form>
     2    {{partial 'dc/acls/policies/fieldsets'}}
     3  {{#if (not create) }}
     4    {{token-list caption="Applied to the following tokens:" items=items}}
     5  {{/if}}
     6      <div>
     7  {{#if create }}
     8          {{! we only need to check for an empty name here as ember munges autofocus, once we have autofocus back revisit this}}
     9          <button type="submit" {{ action "create" item}} disabled={{if (or item.isPristine item.isInvalid (eq item.Name '')) 'disabled'}}>Save</button>
    10  {{ else }}
    11          <button type="submit" {{ action "update" item}} disabled={{if item.isInvalid 'disabled'}}>Save</button>
    12  {{/if}}
    13          <button type="reset" {{ action "cancel" item}}>Cancel</button>
    14  {{# if (not create) }}
    15          {{#confirmation-dialog message='Are you sure you want to delete this Policy?'}}
    16              {{#block-slot 'action' as |confirm|}}
    17                  <button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item}}>Delete</button>
    18              {{/block-slot}}
    19              {{#block-slot 'dialog' as |execute cancel message|}}
    20      {{#if (gt items.length 0)}}
    21                {{#modal-dialog onclose=(action cancel)}}
    22                    {{#block-slot 'header'}}
    23                        <h2>Policy in Use</h2>
    24                    {{/block-slot}}
    25                    {{#block-slot 'body'}}
    26                      <p>
    27                      This Policy is currently in use. If you choose to delete this Policy, it will be removed from the following <strong>{{items.length}} Tokens</strong>:
    28                      </p>
    29                      {{token-list items=items target='_blank'}}
    30                      <p>
    31                        This action cannot be undone. {{message}}
    32                      </p>
    33                    {{/block-slot}}
    34                    {{#block-slot 'actions' as |close|}}
    35                      <button type="button" class="type-delete" {{action execute}}>Yes, Delete</button>
    36                      <button type="button" class="type-cancel" {{action close}}>Cancel</button>
    37                    {{/block-slot}}
    38                  {{/modal-dialog}}
    39      {{else}}
    40                  {{delete-confirmation message=message execute=execute cancel=cancel}}
    41      {{/if}}
    42              {{/block-slot}}
    43          {{/confirmation-dialog}}
    44  {{/if}}
    45      </div>
    46  </form>