
<!-- Trail partial -->
<script id="services.cloudtrail.regions.id.trails.partial" type="text/x-handlebars-template">
  {{#unless scout2_link}}
    <div id="resource-name" class="list-group-item active">
      <h4 class="list-group-item-heading">{{name}}</h4>
    </div>
    <div class="list-group-item">
    <h4>Information</h4>
      <ul>
        <li class="list-group-item-text">Name: {{name}}</li>
        <li class="list-group-item-text">Region: {{region}}</li>
        <li class="list-group-item-text">Logging: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.IsLogging">{{IsLogging}}</span></li>
        <li class="list-group-item-text">Data events: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.cloudtrail-data-events-disabled">{{DataEventsEnabled}}</span></li>

        <li class="list-group-item-text">Management events: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.cloudtrail-management-events-disabled">{{ManagementEventsEnabled}}</span></li>
        <li class="list-group-item-text">Multi region: {{IsMultiRegionTrail}}</li>
        {{#ifEqual IsMultiRegionTrail "true"}}
          <li></li>
        {{/ifEqual}}
        <li class="list-group-item-text">Start Logging Time: {{StartLoggingTime}}</li>
        <li class="list-group-item-text">Stop Logging Time: {{StopLoggingTime}}</li>
        <li class="list-group-item-text">Include global services:
          <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.GlobalServicesDuplicated">
            <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.IncludeGlobalServiceEvents">
              {{#if IncludeGlobalServiceEvents}} True {{#unless IsLogging}}(Trail disabled){{/unless}} {{else}} False {{/if}}
            </span>
          </span>
        </li>
        <li class="list-group-item-text">Log File Validation Enabled: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.LogFileValidationDisabled">{{LogFileValidationEnabled}}</span></li>
        <li class="list-group-item-text">Destination S3 bucket name: <a href="javascript:showObject('services.s3.buckets.{{bucket_id}}')">{{get_value_at 'services.s3.buckets' bucket_id 'name'}}</a>/{{S3KeyPrefix}}</li>
        <li class="list-group-item-text">KMS key: <span id="cloudtrail.regions.{{region}}.trails.{{@key}}.cloudtrail-kms-key-unused">{{#if KmsKeyId}} true {{else}} false {{/if}}</span></li>
      </ul>
    </div>
  {{/unless}}
</script>
<script>
  Handlebars.registerPartial("services.cloudtrail.regions.id.trails", $("#services\\.cloudtrail\\.regions\\.id\\.trails\\.partial").html());
</script>

<!-- Single EC2 instance template -->
<script id="single_cloudtrail_trail-template" type="text/x-handlebars-template">
    {{> modal-template template='services.cloudtrail.regions.id.trails' }}
</script>
<script>
    var single_cloudtrail_trail_template = Handlebars.compile($("#single_cloudtrail_trail-template").html());
</script>
