
<!-- Cloud Storage instances partial -->
<script id="services.cloudsql.instances.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 ID: <span id="cloudsql.instances.{{@key}}.project_id">{{project_id}}</span></div>
        <div class="list-group-item-text item-margin">Instance Name: <span id="cloudsql.instances.{{@key}}.name">{{name}}</span></div>
        <div class="list-group-item-text item-margin">Automatic Backups: <span id="cloudsql.instances.{{@key}}.automatic_backup_enabled">{{ convert_bool_to_enabled automatic_backup_enabled}}</span></div>
        <div class="list-group-item-text item-margin">Last Backup: <span id="cloudsql.instances.{{@key}}.last_backup_timestamp">{{last_backup_timestamp}}</span></div>
        <div class="list-group-item-text item-margin">Logs: <span id="cloudsql.instances.{{@key}}.log_enabled">{{convert_bool_to_enabled log_enabled}}</span></div>
        <div class="list-group-item-text item-margin">SSL Required: <span id="cloudsql.instances.{{@key}}.ssl_required">{{convert_bool_to_enabled ssl_required}}</span></div>
        <div class="list-group-item-text item-margin">Authorized Networks:</div>
        <ul>
            {{#each authorized_networks }}
                <li><span id="cloudsql.instances.{{@../key}}.authorized_networks.{{@key}}.open_to_the_world">{{ value }}</span></li>
            {{/each}}
        </ul>
        <div class="list-group-item-text item-margin">Users:</div>
        <ul>
            {{#each users }}
                <li><span id="cloudsql.instances.{{@../key}}.root_access_from_any_host"><strong>{{ name }}</strong>: {{ host }}</span></li>
            {{/each}}
        </ul>
    </div>
</script>

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

<!-- Single cloudsql instance template -->
<script id="single_cloudsql_instance-template" type="text/x-handlebars-template">
    {{> modal-template template='services.cloudsql.instances'}}
</script>
<script>
    var single_cloudsql_instance_template = Handlebars.compile($("#single_cloudsql_instance-template").html());
</script>