
    <!-- IAM policy partial -->
    <script id="services.iam.policy.partial" type="text/x-handlebars-template">
{{#unlessEqual policy_path "managed_policies"}}
      <hr>
      <div>
        <div class="accordion item-margin">
          <h5 class="list-group-item-heading accordion-heading">{{name}}
            <a class="accordion-toggle" data-toggle="collapse" href="#iam_policy_details\.{{policy_path}}">
              <span class="badge pull-right btn-info">Details</span>
            </a>
          </h5>
          <div id="iam_policy_details.{{policy_spath}}" class="accordion-body collapse">
            <div class="accordion-inner">
{{else}}
      <div>
{{/unlessEqual}}
              &#123;<br/>
              {{#each PolicyDocument}}
                {{#ifEqual @key "Statement"}}
                  &nbsp;&nbsp;"{{@key}}":&nbsp; [<br/>
                  {{#each this}}
                    <div class="item-margin">
                      <span id="iam.{{../../../policy_spath}}.PolicyDocument.Statement.{{@key}}">{{{displayKey @key this}}}</span>
                      {{#unless @last}},{{/unless}}
                    </div>
                  {{/each}}                  
                  &nbsp;&nbsp;]
                {{else}}
                  &nbsp;&nbsp;"{{@key}}":&nbsp; {{{displayKey @key this}}}
                {{/ifEqual}}
                {{#unless @last}},{{/unless}}
                <br/>
              {{/each}}
              &#125;
{{#unlessEqual policy_path "managed_policies"}}
            </div>
          </div>
        </div>
{{/unlessEqual}}
      </div>
    </script>
    <script>
      Handlebars.registerPartial("services.iam.policy", $("#services\\.iam\\.policy\\.partial").html());
    </script>

    <!-- Single IAM policy template -->
    <script id="single_iam_policy-template" type="text/x-handlebars-template">
        <div style="text-align: right; padding-right: 10px; text-weight: bold;"><a href="javascript:hidePopup()">X</a></div>
        {{> services.iam.policy}}
        <hr>
    </script>
    <script>
        var single_iam_policy_template = Handlebars.compile($("#single_iam_policy-template").html());
    </script>

