{# Copyright 2022, Red Hat, Inc. #}
{# SPDX-License-Identifier: LGPL-2.1-or-later #}
{% if rule.remediations %}
{% for remediation in rule.remediations %}
<tr role="row">
    <td colspan="2" role="cell">
        <details>
            <summary><span class="clickable-element">Remediation {{ remediation.get_type() }}</span></summary>
            <table class="pf-c-table pf-m-grid-md" role="grid">
                <thead>
                    <tr role="row">
                        <th role="columnheader" scope="col"></th>
                        <th role="columnheader" scope="col"></th>
                    </tr>
                </thead>
                <tbody role="rowgroup">
                    {% if remediation.complexity != "" %}
                    <tr role="row">
                        <td role="cell">Complexity:</td>
                        <td role="cell">{{ remediation.complexity }}</td>
                    </tr>
                    {% endif %}
                    {% if remediation.disruption != "" %}
                    <tr role="row">
                        <td role="cell">Disruption:</td>
                        <td role="cell">{{ remediation.disruption }}</td>
                    </tr>
                    {% endif %}
                    {% if remediation.strategy != "" %}
                    <tr role="row">
                        <td role="cell">Strategy:</td>
                        <td role="cell">{{ remediation.strategy }}</td>
                    </tr>
                    {% endif %}
                </tbody>
            </table>
            <div class="pf-c-clipboard-copy pf-m-inline pf-m-block remediation-clipboard-padding">
                <span class="pf-c-clipboard-copy__actions">
                  <span class="pf-c-clipboard-copy__actions-item">
                    <button id="copy" class="pf-c-button pf-m-plain" type="button" aria-label="Copy remediation to clipboard">
                      <i class="fas fa-copy" aria-hidden="true"></i> Copy remediation
                    </button>
                  </span>
                </span>
                <span class="pf-c-clipboard-copy__text">
                    <pre>{{ remediation.fix | e }}</pre>
                </span>
            </div>
        </details>
    </td>
</tr>
{% endfor %}
{% endif %}
