<!-- bigquery datasets -->
<script id="services.bigquery.projects.id.datasets.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">Name: <span id="bigquery.projects.{{project}}.datasets.{{@key}}.name"><samp>{{value_or_none name}}</samp></span></div>
        <div class="list-group-item-text item-margin">Location: <span id="bigquery.projects.{{project}}.datasets.{{@key}}.location"><samp>{{value_or_none location}}</samp></span></div>
        <div class="list-group-item-text item-margin">Creation Time: <span id="bigquery.projects.{{project}}.datasets.{{@key}}.creation_time"><samp>{{format_date creation_time}}</samp></span></div>
        <div class="list-group-item-text item-margin">Last Modified Time: <span id="bigquery.projects.{{project}}.datasets.{{@key}}.last_modified_time"><samp>{{format_date last_modified_time}}</samp></span></div>
        <div class="list-group-item-text item-margin">Default Encryption Key: <span id="bigquery.projects.{{project}}.datasets.{{@key}}.default_encryption_configuration"><samp>{{value_or_none default_encryption_configuration}}</samp></span></div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading"><span id="bigquery.projects.{{@../key}}.datasets.{{@key}}.permissions">IAM Permissions</span></h4>
        <div class="accordion-inner">
            <ul>
                {{#each bindings}}
                <li><span id="bigquery.projects.{{@../../key}}.datasets.{{@../key}}.{{@key}}"><samp>{{@key}}</samp></span></li>
                <ul>
                    {{#each this}}
                    <li><samp>{{type}}:{{member}}</samp></li>
                    {{/each}}
                </ul>
                {{else}}
                <li><samp>None</samp></li>
                {{/each}}
            </ul>
        </div>
    </div>
</script>

<script>
    Handlebars.registerPartial("services.bigquery.projects.id.datasets", $("#services\\.bigquery\\.projects\\.id\\.datasets\\.partial").html());
</script>

<!-- Single bigquery dataset template -->
<script id="single_bigquery_dataset-template" type="text/x-handlebars-template">
    {{> modal-template template='services.bigquery.projects.id.datasets'}}
</script>
<script>
    var single_bigquery_dataset_template = Handlebars.compile($("#single_bigquery_dataset-template").html());
</script>
