# All files / src/app/core/auth/role-form role-form.component.html

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    1266x

     <div class="col-sm-12 col-lg-6">
      <form name="roleForm"
            class="form-horizontal"
            #formDir="ngForm"
            [formGroup]="roleForm"
            novalidate>
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 i18n="form title|Example: Create Pool@@formTitle"
                class="panel-title">{{ action | titlecase }} {{ resource | upperFirst }}</h3>
          </div>
          <div class="panel-body">

            <!-- Name -->
            <div class="form-group"
                 [ngClass]="{'has-error': roleForm.showError('name', formDir)}">
              <label class="control-label col-sm-3"
                     for="name">
                <ng-container i18n>Name</ng-container>
                <span class="required"
                      *ngIf="mode !== roleFormMode.editing"></span>
              </label>
              <div class="col-sm-9">
                <input class="form-control"
                       type="text"
                       i18n-placeholder
                       placeholder="Name..."
                       id="name"
                       name="name"
                       formControlName="name"
                       autofocus>
                <span class="help-block"
                      *ngIf="roleForm.showError('name', formDir, 'required')"
                      i18n>This field is required.</span>
                <span class="help-block"
                      *ngIf="roleForm.showError('name', formDir, 'notUnique')"
                      i18n>The chosen name is already in use.</span>
              </div>
            </div>

            <!-- Description -->
            <div class="form-group"
                 [ngClass]="{'has-error': roleForm.showError('description', formDir)}">
              <label i18n
                     class="control-label col-sm-3"
                     for="description">Description</label>
              <div class="col-sm-9">
                <input class="form-control"
                       type="text"
                       i18n-placeholder
                       placeholder="Description..."
                       id="description"
                       name="description"
                       formControlName="description">
              </div>
            </div>

            <!-- Permissions -->
            <div class="form-group">
              <label i18n
                     class="control-label col-sm-3">Permissions</label>
              <div class="col-sm-9">
                <cd-table [data]="scopes_permissions"
                          [columns]="columns"
                          columnMode="flex"
                          [toolHeader]="false"
                          [autoReload]="false"
                          [autoSave]="false"
                          [footer]="false"
                          [limit]="0">
                </cd-table>
              </div>
            </div>

          </div>
          <div class="panel-footer">
            <div class="button-group text-right">
              <cd-submit-button
                [form]="formDir" (submitAction)="submit()"
                i18n="form action button|Example: Create Pool@@formActionButton"
                type="button">{{ action | titlecase }} {{ resource | upperFirst }}</cd-submit-button>
              <cd-back-button></cd-back-button>
            </div>
          </div>
        </div>
      </form>
    </div>

    <ng-template #cellScopeCheckboxTpl
                 let-column="column"
                 let-row="row"
                 let-value="value">
      <div class="checkbox checkbox-primary">
        <input id="scope_{{ row.scope }}"
               type="checkbox"
               [checked]="isRowChecked(row.scope)"
               (change)="onClickCellCheckbox(row.scope, column.prop, $event)">
        <label class="datatable-permissions-scope-cell-label"
               for="scope_{{ row.scope }}">{{ value }}</label>
      </div>
    </ng-template>

    <ng-template #cellPermissionCheckboxTpl
                 let-column="column"
                 let-row="row"
                 let-value="value">
      <div class="checkbox checkbox-primary">
        <input type="checkbox"
               [checked]="value"
               (change)="onClickCellCheckbox(row.scope, column.prop, $event)">
        <label></label>
      </div>
    </ng-template>

    <ng-template #headerPermissionCheckboxTpl
                 let-column="column">
      <div class="checkbox checkbox-primary">
        <input id="header_{{ column.prop }}"
               type="checkbox"
               [checked]="isHeaderChecked(column.prop)"
               (change)="onClickHeaderCheckbox(column.prop, $event)">
        <label class="datatable-permissions-header-cell-label"
               for="header_{{ column.prop }}">{{ column.name }}</label>
      </div>
    </ng-template>