
<!-- Cloud Storage service_accounts partial -->
<script id="services.iam.service_accounts.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">Project: <span id="iam.service_accounts.{{@key}}.project_id">{{project_id}}</span></div>
        <div class="list-group-item-text item-margin">ID: <span id="iam.service_accounts.{{@key}}.id">{{id}}</span></div>
        <div class="list-group-item-text item-margin">email: <span id="iam.service_accounts.{{@key}}.email">{{email}}</span></div>
        <div class="list-group-item-text item-margin">Display Name: <span id="iam.service_accounts.{{@key}}.display_name">{{display_name}}</span></div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading"><span id="iam.service_accounts.{{@key}}.keys">Keys:</span></h5>
        <div class="accordion-inner">
            <ul>
                {{#each keys}}
                <li>Key <samp>{{@key}}</samp></li>
                <ul>
                    <li id="iam.service_accounts.{{@key}}.keys.{{@key}}.algorithm">Key Algorithm: {{key_algorithm}}</li>
                    <li id="iam.service_accounts.{{@key}}.keys.{{@key}}.valid_before">Valid Before: {{valid_before}}</li>
                    <li id="iam.service_accounts.{{@key}}.keys.{{@key}}.valid_after">Valid After: {{valid_after}}</li>
                </ul>
                {{else}}
                <li><samp>None</samp></li>
                {{/each}}
            </ul>
        </div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading"><span id="iam.service_accounts.{{@key}}.bindings">Service Account Users:</span></h5>
        <div class="accordion-inner">
            <ul>
                {{#each bindings}}
                <li>Role <samp>{{role}}</samp></li>
                <ul>
                    {{#each members}}
                    <li><samp>{{this}}</samp></li>
                    {{/each}}
                </ul>
                {{else}}
                <li><samp>None</samp></li>
                {{/each}}
            </ul>
        </div>
    </div>
</script>

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

<!-- Single iam service_account template -->
<script id="single_iam_service_account-template" type="text/x-handlebars-template">
    {{> modal-template template='services.iam.service_accounts'}}
</script>
<script>
    var single_iam_service_account_template = Handlebars.compile($("#single_iam_service_account-template").html());
</script>
