<fieldset>
    <form class="form-horizontal" name="clientForm" novalidate>
        <span data-ng-show="evaluationResult.results.length == 0"><strong>Could not obtain any result for the given authorization request. Check if the provided resource(s) or scope(s) are associated with any policy.</strong></span>
        <fieldset class="border-top" data-ng-repeat="result in evaluationResult.results">
            <legend collapsed><span class="text">{{result.resource.name}}</span>
                <kc-tooltip>Provides information about how policies were evaluated for this resource.</kc-tooltip>
            </legend>
            <div class="form-group">
                <label class="col-md-2 control-label">Result</label>

                <div class="col-sm-2">
                    <div>
                        <span style="color: green"
                              data-ng-show="result.status == 'PERMIT'"><strong>{{result.status}}</strong></span>
                        <span style="color: red"
                              data-ng-hide="result.status == 'PERMIT'"><strong>{{result.status}}</strong></span>
                    </div>
                </div>
                <kc-tooltip>The overall result for this permission request.</kc-tooltip>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label">Scopes</label>

                <div class="col-sm-2">
                    <span data-ng-show="result.scopes.length == 0">Any scope.</span>

                    <div>
                        <ul>
                            <li data-ng-repeat="scope in result.scopes">
                                {{scope.name}}
                            </li>
                        </ul>
                    </div>
                </div>
                <kc-tooltip>The requested scopes.</kc-tooltip>
            </div>
            <div class="form-group" data-ng-show="!evaluationResult.entitlements">
                <label class="col-md-2 control-label">Policies</label>

                <div class="col-sm-6">
                    <span data-ng-show="result.policies.length == 0">No policies were found for this resource.</span>

                    <div>
                        <ul>
                            <li data-ng-repeat="policyResult in result.policies">
                                <strong><a
                                        href="#/realms/{{realm.realm}}/authz/resource-server/{{server.id}}/policy/{{policyResult.policy.type}}/{{policyResult.policy.id}}">{{policyResult.policy.name}}</a></strong>
                                decision was <span style="color: green" data-ng-show="policyResult.status == 'PERMIT'"><strong>{{policyResult.status}}</strong></span>
                                <span style="color: red" data-ng-hide="policyResult.status == 'PERMIT'"><strong>{{policyResult.status}}</strong></span>
                                by <strong>{{policyResult.policy.decisionStrategy}}</strong> decision.</a>
                                <ul>
                                    <li data-ng-repeat="subPolicy in policyResult.associatedPolicies">
                                        <strong><a
                                                href="#/realms/{{realm.realm}}/authz/resource-server/{{server.id}}/policy/{{subPolicy.policy.type}}/{{subPolicy.policy.id}}">{{subPolicy.policy.name}}</a></strong>
                                        voted to <span style="color: green"
                                                       data-ng-show="subPolicy.status == 'PERMIT'"><strong>{{subPolicy.status}}</strong></span>
                                        <span style="color: red" data-ng-hide="subPolicy.status == 'PERMIT'"><strong>{{subPolicy.status}}</strong></span>.</a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
                <kc-tooltip>Details about which policies were evaluated and their decisions.</kc-tooltip>
            </div>
        </fieldset>
    </form>
</fieldset>