aboutsummaryrefslogtreecommitdiff
blob: b2e5d6779af1d2d3590aa64264ea43ddbfca690d (plain)
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
<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">
    <h1>Roles</h1>

    <ul class="nav nav-tabs">
        <li class="active"><a href="#/realms/{{realm.realm}}/roles">{{:: 'realm-roles' | translate}}</a></li>
        <li><a href="#/realms/{{realm.realm}}/default-roles">{{:: 'default-roles' | translate}}</a></li>
    </ul>

    <table class="table table-striped table-bordered">
        <thead>
            <tr>
                <th class="kc-table-actions" colspan="5">
                    <div class="form-inline">
                        <div class="form-group">
                            <div class="input-group">
                                <input type="text" placeholder="{{:: 'search.placeholder' | translate}}" data-ng-model="query.search" ng-model-options="{debounce: 500}" class="form-control search">
                                <div class="input-group-addon">
                                    <i class="fa fa-search" type="submit" data-ng-click="firstPage()"></i>
                                </div>
                            </div>
                        </div>
                        <button id="viewAllRoles" class="btn btn-default" ng-click="query.search = null; firstPage()">{{:: 'view-all-roles' | translate}}</button>
                        <div class="pull-right" data-ng-show="access.manageRealm">
                            <a id="createRole" class="btn btn-default" href="#/create/role/{{realm.realm}}">{{:: 'add-role' | translate}}</a>
                        </div>
                    </div>
                </th>
            </tr>
            <tr data-ng-show="roles && roles.length > 0">
                <th>{{:: 'role-name' | translate}}</th>
                <th>{{:: 'composite' | translate}}</th>
                <th>{{:: 'description' | translate}}</th>
                <th colspan="2">{{:: 'actions' | translate}}</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="role in roles">
                <td><a href="#/realms/{{realm.realm}}/roles/{{role.id}}">{{role.name}}</a></td>
                <td translate="{{role.composite}}"></td>
                <td>{{role.description}}</td>
                <td class="kc-action-cell" kc-open="/realms/{{realm.realm}}/roles/{{role.id}}">{{:: 'edit' | translate}}</td>
                <td class="kc-action-cell" data-ng-click="removeRole(role)">{{:: 'delete' | translate}}</td>
            </tr>
            <tr data-ng-show="(roles | filter:{name: query.search}).length == 0">
                <td class="text-muted" colspan="4" data-ng-show="searchLoaded && roles.length == 0 && lastSearch != null">{{:: 'no-results' | translate}}</td>
                <td class="text-muted" colspan="4" data-ng-show="searchLoaded && roles.length == 0 && lastSearch == null">{{:: 'no-realm-roles-available' | translate}}</td>
            </tr>
        </tbody>
        <tfoot data-ng-show="roles && (roles.length >= query.max || query.first > 0)">
            <tr>
                <td colspan="5">
                    <div class="table-nav">
                        <button data-ng-click="firstPage()" class="first" ng-disabled="query.first == 0">{{:: 'first-page' | translate}}</button>
                        <button data-ng-click="previousPage()" class="prev" ng-disabled="query.first == 0">{{:: 'previous-page' | translate}}</button>
                        <button data-ng-click="nextPage()" class="next" ng-disabled="roles.length < query.max">{{:: 'next-page' | translate}}</button>
                    </div>
                </td>
            </tr>
        </tfoot>   
    </table>
</div>

<kc-menu></kc-menu>