<commit_before>.grid-sm
  .panel.panel-default
    p.page-title
      i.fa.fa-key(style="color: #e25440;")
      |  ACLs
.grid-lg
  .panel.panel-default
    .panel-heading.panel-title
      i.fa.fa-plus-circle
      |  Create
    .panel-body
      form(ng-submit = 'ctrl.addAcl()')
        .form-group
          ui-select(ng-model = 'ctrl.subject')
            ui-select-match(placeholder = 'Choose a user or group')
              div
                span(ng-if = '$select.selected.email')
                  i.xo-icon-user.fa-fw
                  |  {{$select.selected.email}}
                span(ng-if = '$select.selected.name')
                  i.xo-icon-group.fa-fw
                  |  {{$select.selected.name}}
            ui-select-choices(repeat = 'entity in ctrl.entities | filter:{ permission: "!admin" } | filter:$select.search')
              div
                span(ng-if = 'entity.email')
                  i.xo-icon-user.fa-fw
                  |  {{entity.email}}
                span(ng-if = 'entity.name')
                  i.xo-icon-group.fa-fw
                  |  {{entity.name}}
        .form-group
          ui-select(ng-model = 'ctrl.selectedObjects', multiple, close-on-select = 'false', required)
            ui-select-match(placeholder = 'Choose an object')
              i(class = 'xo-icon-{{$item.type | lowercase}}')
              |  {{$item.name_label}}
            ui-select-choices(repeat = 'object in ctrl.objects | selectHighLevel | filter:$select.search | orderBy:["type", "name_label"]')
              div
                i(class = 'xo-icon-{{object.type | lowercase}}')
                |  {{object.name_label}}
                span(ng-if="(object.type === 'SR' || object.type === 'VM') && object.$container")
                  |  ({{(object.$container | resolve).name_label}})
                span(ng-if="object.type === 'network'")
                  |  ({{(object.$poolId | resolve).name_label}})
          .text-center
            span(ng-repeat = 'type in ctrl.types')
              label(tooltip = 'select/deselect all {{type}}s', style = 'cursor: pointer')
                input.hidden(type = 'checkbox', ng-model = 'ctrl.selectedTypes[type]', ng-change = 'ctrl.toggleType(ctrl.selectedTypes[type], type)')
                span.fa-stack
                  i(class = 'xo-icon-{{type | lowercase}}').fa-stack-1x
                  i.fa.fa-square-o.fa-stack-2x.text-info(ng-if = 'ctrl.selectedTypes[type]')
        .form-group
          ui-select(ng-model = 'ctrl.role')
            ui-select-match(placeholder = 'Choose a role')
              div
                i(class = 'xo-icon-{{$select.selected.type | lowercase}}')
                |  {{$select.selected.name}}
            ui-select-choices(repeat = 'role in ctrl.roles | filter:$select.search | orderBy:"name"')
              div
                i(class = 'xo-icon-{{role.type | lowercase}}')
                |  {{role.name}}
        .text-center
          button.btn.btn-success
            i.fa.fa-plus
              |  Create

  .panel.panel-default
    .panel-heading.panel-title
      i.fa.fa-street-view
      |  Manage
    .panel-body
      table.table.table-hover
        tr
          th User
          th Object
          th Role
          th
        tr(ng-repeat = "acl in ctrl.acls track by acl.id")
          td {{ ctrl.usersById[acl.subject].email || ctrl.groupsById[acl.subject].name }}
          td {{(acl.object | resolve).name_label}}
          td
            select.form-control(ng-options = 'role.id as role.name for role in ctrl.roles | orderBy:"name"', ng-model = 'acl.newRole', ng-change = 'ctrl.editAcl(acl.subject, acl.object, acl.action, acl.newRole)')
          td
            button.btn.btn-danger(ng-click = 'ctrl.removeAcl(acl.subject, acl.object, acl.action)')
              i.fa.fa-trash<commit_msg>Better order for acl management<commit_after>.grid-sm
  .panel.panel-default
    p.page-title
      i.fa.fa-key(style="color: #e25440;")
      |  ACLs
.grid-lg
  .panel.panel-default
    .panel-heading.panel-title
      i.fa.fa-plus-circle
      |  Create
    .panel-body
      form(ng-submit = 'ctrl.addAcl()')
        .form-group
          ui-select(ng-model = 'ctrl.subject')
            ui-select-match(placeholder = 'Choose a user or group')
              div
                span(ng-if = '$select.selected.email')
                  i.xo-icon-user.fa-fw
                  |  {{$select.selected.email}}
                span(ng-if = '$select.selected.name')
                  i.xo-icon-group.fa-fw
                  |  {{$select.selected.name}}
            ui-select-choices(repeat = 'entity in ctrl.entities | filter:{ permission: "!admin" } | filter:$select.search')
              div
                span(ng-if = 'entity.email')
                  i.xo-icon-user.fa-fw
                  |  {{entity.email}}
                span(ng-if = 'entity.name')
                  i.xo-icon-group.fa-fw
                  |  {{entity.name}}
        .form-group
          ui-select(ng-model = 'ctrl.selectedObjects', multiple, close-on-select = 'false', required)
            ui-select-match(placeholder = 'Choose an object')
              i(class = 'xo-icon-{{$item.type | lowercase}}')
              |  {{$item.name_label}}
            ui-select-choices(repeat = 'object in ctrl.objects | selectHighLevel | filter:$select.search | orderBy:["type", "name_label"]')
              div
                i(class = 'xo-icon-{{object.type | lowercase}}')
                |  {{object.name_label}}
                span(ng-if="(object.type === 'SR' || object.type === 'VM') && object.$container")
                  |  ({{(object.$container | resolve).name_label}})
                span(ng-if="object.type === 'network'")
                  |  ({{(object.$poolId | resolve).name_label}})
          .text-center
            span(ng-repeat = 'type in ctrl.types')
              label(tooltip = 'select/deselect all {{type}}s', style = 'cursor: pointer')
                input.hidden(type = 'checkbox', ng-model = 'ctrl.selectedTypes[type]', ng-change = 'ctrl.toggleType(ctrl.selectedTypes[type], type)')
                span.fa-stack
                  i(class = 'xo-icon-{{type | lowercase}}').fa-stack-1x
                  i.fa.fa-square-o.fa-stack-2x.text-info(ng-if = 'ctrl.selectedTypes[type]')
        .form-group
          ui-select(ng-model = 'ctrl.role')
            ui-select-match(placeholder = 'Choose a role')
              div
                i(class = 'xo-icon-{{$select.selected.type | lowercase}}')
                |  {{$select.selected.name}}
            ui-select-choices(repeat = 'role in ctrl.roles | filter:$select.search | orderBy:"name"')
              div
                i(class = 'xo-icon-{{role.type | lowercase}}')
                |  {{role.name}}
        .text-center
          button.btn.btn-success
            i.fa.fa-plus
              |  Create

  .panel.panel-default
    .panel-heading.panel-title
      i.fa.fa-street-view
      |  Manage
    .panel-body
      table.table.table-hover
        tr
          th User
          th Object
          th Role
          th
        tr(ng-repeat = 'acl in ctrl.acls | orderBy:["subject", "object"] track by acl.id')
          td {{ ctrl.usersById[acl.subject].email || ctrl.groupsById[acl.subject].name }}
          td {{(acl.object | resolve).name_label}}
          td
            select.form-control(ng-options = 'role.id as role.name for role in ctrl.roles | orderBy:"name"', ng-model = 'acl.newRole', ng-change = 'ctrl.editAcl(acl.subject, acl.object, acl.action, acl.newRole)')
          td
            button.btn.btn-danger(ng-click = 'ctrl.removeAcl(acl.subject, acl.object, acl.action)')
              i.fa.fa-trash
{'fraction_non_alphanumeric': 0.15429535426940047, 'fraction_numerical': 0.0018167661562418895, 'mean_word_length': 1.6649377593360997, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2345794', 'n_tokens_mistral': 2433, 'n_tokens_neox': 2357, 'n_words': 385}