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

     1  {{#app-view class=(concat 'policy ' (if (not isAuthorized) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}}
     2      {{#block-slot 'notification' as |status type|}}
     3        {{partial 'dc/acls/policies/notifications'}}
     4      {{/block-slot}}
     5      {{#block-slot 'header'}}
     6        <h1>
     7          Access Controls
     8        </h1>
     9        {{#if isAuthorized }}
    10          {{partial 'dc/acls/nav'}}
    11        {{/if}}
    12      {{/block-slot}}
    13      {{#block-slot 'disabled'}}
    14        {{partial 'dc/acls/disabled'}}
    15      {{/block-slot}}
    16      {{#block-slot 'authorization'}}
    17        {{partial 'dc/acls/authorization'}}
    18      {{/block-slot}}
    19      {{#block-slot 'actions'}}
    20          <a data-test-create href="{{href-to 'dc.acls.policies.create'}}" class="type-create">Create</a>
    21      {{/block-slot}}
    22      {{#block-slot 'content'}}
    23  {{#if (gt items.length 0) }}
    24          <form class="filter-bar">
    25              {{freetext-filter onchange=(action 'filter') value=filter.s placeholder="Search"}}
    26          </form>
    27  {{/if}}
    28  {{#if (gt filtered.length 0)}}
    29          {{#tabular-collection
    30              items=(sort-by 'CreateIndex:desc' 'Name:asc' filtered) as |item index|
    31          }}
    32              {{#block-slot 'header'}}
    33                  <th>Name</th>
    34                  <th>Datacenters</th>
    35                  <th>Description</th>
    36              {{/block-slot}}
    37              {{#block-slot 'row' }}
    38                  <td data-test-policy="{{item.Name}}">
    39                    <a href={{href-to 'dc.acls.policies.edit' item.ID}} class={{if (policy/is-management item) 'is-management'}}>{{item.Name}}</a>
    40                  </td>
    41                  <td>
    42                    {{join ', ' (policy/datacenters item)}}
    43                  </td>
    44                  <td>
    45                    {{item.Description}}
    46                  </td>
    47              {{/block-slot}}
    48              {{#block-slot 'actions' as |index change checked|}}
    49                  {{#confirmation-dialog confirming=false index=index message="Are you sure you want to delete this Policy?"}}
    50                      {{#block-slot 'action' as |confirm|}}
    51                          {{#action-group index=index onchange=(action change) checked=(if (eq checked index) 'checked')}}
    52                              <ul>
    53  {{#if (policy/is-management item)}}
    54                                  <li>
    55                                      <a data-test-edit href={{href-to 'dc.acls.policies.edit' item.ID}}>View</a>
    56                                  </li>
    57  {{else}}
    58  
    59                                  <li>
    60                                      <a data-test-edit href={{href-to 'dc.acls.policies.edit' item.ID}}>Edit</a>
    61                                  </li>
    62                                  <li>
    63                                      <a data-test-delete onclick={{action confirm 'delete' item}}>Delete</a>
    64                                  </li>
    65  {{/if}}
    66                              </ul>
    67                          {{/action-group}}
    68                      {{/block-slot}}
    69                      {{#block-slot 'dialog' as |execute cancel message name|}}
    70                        {{delete-confirmation message=message execute=execute cancel=cancel}}
    71                      {{/block-slot}}
    72                  {{/confirmation-dialog}}
    73              {{/block-slot}}
    74          {{/tabular-collection}}
    75  {{else}}
    76          <p>
    77              There are no Policies.
    78          </p>
    79  {{/if}}
    80      {{/block-slot}}
    81  {{/app-view}}