<?php
    use Cms\Classes\Page;
?>

<div class="list-preview list-flush">
    <div class="control-list" data-control="listwidget">
        <table class="table data" data-control="rowlink">
            <thead>
                <tr>
                    <th class="list-checkbox">
                        <div class="checkbox custom-checkbox nolabel">
                            <input type="checkbox" id="checkboxAll" />
                            <label for="checkboxAll"></label>
                        </div>
                    </th>
                    <th><span><?= e(trans('rainlab.sitemap::lang.item.page')) ?></span></th>
                    <th><span><?= e(trans('rainlab.sitemap::lang.item.url')) ?></span></th>
                </tr>
            </thead>
            <tbody>
                <?php foreach (Page::all() as $page): ?>
                    <tr>
                        <td class="list-checkbox nolink">
                            <div class="checkbox custom-checkbox nolabel">
                                <input
                                    id="checkbox_<?= $page->getId() ?>"
                                    type="checkbox"
                                    name="cms_pages[]"
                                    value="<?= $page->getBaseFileName() ?>" />
                                <label for="checkbox_<?= $page->getId() ?>"><?= e(trans('rainlab.sitemap::lang.item.check')) ?></label>
                            </div>
                        </td>
                        <td><?= e($page->title) ?></td>
                        <td><?= e($page->url) ?></td>
                    </tr>
                <?php endforeach ?>
            </body>
        </table>
    </div>
</div>