<?php
    namespace ONLINE_ADA;

?>

<?php foreach ($invalid_images as $id => $data) : ?>
<?php $thumbnail = wp_get_attachment_image_src($id, 'thumbnail'); ?>
<tr class="wcag-row ll-no-gutters ll-row">
    <td class="preview ll-col-sm-3 ll-col-lg-2">
        <?php if ($thumbnail) : ?>
            <a href="<?php echo esc_attr($data['link']); ?>" target="_blank" class="lightbox">
                <img src="<?php echo esc_attr($thumbnail[0]); ?>" alt="" class="preview_image">
            </a>
        <?php else : ?>
            <a href="<?php echo esc_attr(get_edit_post_link($id)); ?>" target="_blank"><em>No thumbnail</em></a>
        <?php endif; ?>
    </td>
    <td class="info ll-col-sm-9 ll-col-lg-6">
        <div><span class="bold">Title: </span><?php echo !empty($data["title"]) ? "<span>" . wp_kses($data["title"],wp_kses_allowed_html()) . "</span>" : "<span class='empty'> empty </span>"; ?></div>
        <div><span class="bold">Filename: </span><?php echo !empty($data["filename"]) ? "<span>" . wp_kses($data["filename"],wp_kses_allowed_html()) . "</span>" : "<span class='empty'> empty </span>"; ?></div>
        <div><span class="bold">Caption: </span><?php echo !empty($data["caption"]) ? "<span>" . wp_kses($data["caption"],wp_kses_allowed_html()) . "</span>" : "<span class='empty'> empty </span>"; ?></div>
        <div><span class="bold">Description: </span><?php echo !empty($data["description"]) ? "<span>" . wp_kses($data["description"],wp_kses_allowed_html()) . "</span>" : "<span class='empty'> empty </span>"; ?></div>
    </td>
    <td class="alt ll-col-sm-12 ll-col-lg-4">
        <div><?php echo esc_attr($data["msg"]); ?></div>
        <label>
            <span class="sr-only">Enter alt text or leave blank</span>
            <input type="text" placeholder="Enter a description" class="image-alt" data-id="<?php echo esc_attr($id) ?>" name="image-alt-<?php echo esc_attr($id) ?>" value="<?php echo esc_attr($data["alt"]) ? : ""; ?>" />
        </label>
        <div class="flex">
            <label>
                <input type="checkbox" name="marked-compliant" data-id="<?php echo esc_attr($id); ?>" />
                <span>Mark as decorative</span>
            </label>
        </div>
    </td>
</tr>
<?php endforeach; ?>