
<!-- graphrbac service_principals -->
<script id="services.graphrbac.service_principals.partial" type="text/x-handlebars-template">
    <div id="resource-name" class="list-group-item active">
        <h4 class="list-group-item-heading">{{name}}</h4>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading">Information</h4>
        <div class="list-group-item-text item-margin">ID: <span id="graphrbac.service_principals.{{@key}}.id"><samp>{{value_or_none id}}</samp></span></div>
        <div class="list-group-item-text item-margin">Status: <span id="graphrbac.service_principals.{{@key}}.account_enabled"><samp>{{convert_bool_to_enabled account_enabled}}</samp></span></div>
        <div class="list-group-item-text item-margin">App: <a href="javascript:showObject('services.graphrbac.applications', 'app_id', '{{app_id}}')">{{value_or_none app_name}}</a></span></div>
        <div class="list-group-item-text item-margin">App Owner Tenant ID: <span id="graphrbac.service_principals.{{@key}}.app_owner_tenant_id"><samp>{{value_or_none app_owner_tenant_id}}</samp></span></div>
        <div class="list-group-item-text item-margin">App Role Assignment Required: <span id="graphrbac.service_principals.{{@key}}.app_role_assignment_required"><samp>{{value_or_none app_role_assignment_required}}</samp></span></div>
        <div class="list-group-item-text item-margin">Type: <span id="graphrbac.service_principals.{{@key}}.object_type"><samp>{{value_or_none object_type}}</samp></span></div>
        <div class="list-group-item-text item-margin">Service Principal Type: <span id="graphrbac.service_principals.{{@key}}.service_principal_type"><samp>{{value_or_none service_principal_type}}</samp></span></div>
        <div class="list-group-item-text item-margin">Publisher Name: <span id="graphrbac.service_principals.{{@key}}.publisher_name"><samp>{{value_or_none publisher_name}}</samp></span></div>
        <div class="list-group-item-text item-margin">Deletion Timestamp: <span id="graphrbac.service_principals.{{@key}}.deletion_timestamp"><samp>{{value_or_none deletion_timestamp}}</samp></span></div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading">Roles
            {{> count_badge count=roles.length}}
        </h4>
        <div class="accordion-inner">
            <ul>
                {{#each roles}}
                <li class="list-group-item-text"><a href="javascript:showObject('services.graphrbac.roles', 'id', '{{this}}')">{{getValueAt 'services.graphrbac.roles' this 'name'}}</a></li></a></li>
                {{/each}}
            </ul>
        </div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading">Keys
            {{> count_badge count=key_credentials.length}}
        </h4>
        <div class="accordion-inner">
            <ul>
                {{#each key_credentials}}
                <li class="list-group-item-text">ID: <samp>{{value_or_none this.key_id}}</samp></li>
                <ul>
                    <li class="list-group-item-text">Type: <samp>{{value_or_none this.type}}</samp></li>
                    <li class="list-group-item-text">Usage: <samp>{{value_or_none this.usage}}</samp></li>
                    <li class="list-group-item-text">Start Date: {{format_date this.start_date}}</li>
                    <li class="list-group-item-text">End Date: {{format_date this.end_date}}</li>
                </ul>
                {{/each}}
            </ul>
        </div>
    </div>
</script>

<script>
    Handlebars.registerPartial("services.graphrbac.service_principals", $("#services\\.graphrbac\\.service_principals\\.partial").html());
</script>

<!-- Single graphrbac service_principal template -->
<script id="single_graphrbac_service_principal-template" type="text/x-handlebars-template">
    {{> modal-template template='services.graphrbac.service_principals'}}
</script>
<script>
    var single_graphrbac_service_principal_template = Handlebars.compile($("#single_graphrbac_service_principal-template").html());
</script>
