<script type="text/x-template" id="wpcw-tools-field-utilities">
    <div class="wpcw-tools-field-utilities">
        <h2><?php esc_html_e( 'System Utilities', 'wp-courseware' ); ?></h2>
        <table class="wpcw-tools-table widefat" cellspacing="0">
            <tbody>
            <tr class="wpcw-clear-transients-utility">
                <th>
                    <strong class="name"><?php esc_html_e( 'Clear Transients', 'wp-courseware' ); ?></strong>
                    <p class="description"><?php esc_html_e( 'This tool will clear the product/shop transients cache.', 'wp-courseware' ); ?></p>
                </th>
                <td class="run-tool">
                    <button class="button button-large"
                            @click.prevent="clearTransients"
                            :class="{ 'disabled' : transientLoading }"
                            :disabled="transientLoading">
                        <i class="wpcw-fas left" :class="{ 'wpcw-fa-spinner wpcw-fa-spin' : transientLoading, 'wpcw-fa-trash-alt' : ! transientLoading }"></i>
						<?php esc_html_e( 'Clear Transients', 'wp-courseware' ); ?>
                    </button>
                </td>
            </tr>
            <tr class="wpcw-delete-orphaned-question-tags-utility">
                <th>
                    <strong class="name"><?php esc_html_e( 'Delete Orphaned Question Tags', 'wp-courseware' ); ?></strong>
                    <p class="description"><?php esc_html_e( 'This tool will delete all question tags which have a count of zero.', 'wp-courseware' ); ?></p>
                </th>
                <td class="run-tool">
                    <button class="button button-secondary button-large"
                            @click.prevent="deleteOrphanedQuestionTags"
                            :class="{ 'disabled' : questionTagsLoading }"
                            :disabled="questionTagsLoading">
                        <i class="wpcw-fas left" :class="{ 'wpcw-fa-spinner wpcw-fa-spin' : questionTagsLoading, 'wpcw-fa-trash-alt' : ! questionTagsLoading }"></i>
						<?php esc_html_e( 'Delete Orphaned Question Tags', 'wp-courseware' ); ?>
                    </button>
                </td>
            </tr>
            <tr class="wpcw-delete-orphaned-question-tags-utility">
                <th>
                    <strong class="name"><?php esc_html_e( 'Force Upgrade Courses', 'wp-courseware' ); ?></strong>
                    <p class="description"><?php esc_html_e( 'This tool will for upgrade all courses so they will show up in the Courses table.', 'wp-courseware' ); ?></p>
                </th>
                <td class="run-tool">
                    <button class="button button-secondary button-large"
                            @click.prevent="manuallyUpgradeCourses"
                            :class="{ 'disabled' : upgrading }"
                            :disabled="upgrading">
                        <i class="wpcw-fas left" :class="{ 'wpcw-fa-spinner wpcw-fa-spin' : upgrading, 'wpcw-fa-database' : ! upgrading }"></i>
						<?php esc_html_e( 'Force Upgrade Courses', 'wp-courseware' ); ?>
                    </button>
                </td>
            </tr>
            <tr class="wpcw-reset-usage-tracking-utility">
                <th>
                    <strong class="name"><?php esc_html_e( 'Reset Usage Tracking Settings', 'wp-courseware' ); ?></strong>
                    <p class="description"><?php esc_html_e( 'This will reset your usage tracking settings, causing it to show the opt-in banner again and not sending any data.', 'wp-courseware' ); ?></p>
                </th>
                <td class="run-tool">
                    <button class="button button-secondary button-large"
                            @click.prevent="manuallyResetTracker"
                            :class="{ 'disabled' : reseting }"
                            :disabled="upgrading">
                        <i class="wpcw-fas left" :class="{ 'wpcw-fa-spinner wpcw-fa-spin' : reseting, 'wpcw-fa-retweet' : ! reseting }"></i>
						<?php esc_html_e( 'Reset Usage Tracking', 'wp-courseware' ); ?>
                    </button>
                </td>
            </tr>
            <tr class="wpcw-manually-send-data-utility">
                <th>
                    <strong class="name"><?php esc_html_e( 'Manually Send Usage Tracking Data', 'wp-courseware' ); ?></strong>
                    <p class="description"><?php esc_html_e( 'This is for sending usage tracking data manually so we can help troubleshoot issues. Internal use only.', 'wp-courseware' ); ?></p>
                </th>
                <td class="run-tool">
                    <button class="button button-secondary button-large"
                            @click.prevent="manuallySendTracker"
                            :class="{ 'disabled' : sending }"
                            :disabled="sending">
                        <i class="wpcw-fas left" :class="{ 'wpcw-fa-spinner wpcw-fa-spin' : sending, 'wpcw-fa-share-square' : ! sending }"></i>
						<?php esc_html_e( 'Send Usage Tracking Data', 'wp-courseware' ); ?>
                    </button>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</script>