{{!
    @template local_kid/selectable_entry_table

    Shared "élèves × statut" recap table for the Évaluations/Stages/CAPP
    résumé screens, with a leading checkbox column consumed by
    amd/src/bulk_actions.js: a header "tout sélectionner" checkbox
    (data-role="kid-select-all") and one row checkbox per student
    (data-role="kid-select-row", value = local_kid_student.id). Each row
    also carries data-studentid so a bulk publish/hide AJAX response can
    patch just that row's "Publié" cell (data-role="kid-published-cell")
    in place, without a full reload.

    Context: rows[] — each { studentid, name, statusbadge (pre-rendered safe
      HTML, see workflow_service::render_status_badge()), publishedlabel,
      publishedclass, openurl }
}}
<div class="fr-table">
    <table data-region="kid-selectable-table">
        <caption>{{#str}}entry_col_student, local_kid{{/str}}</caption>
        <thead>
            <tr>
                <th scope="col" class="kid-checkbox-cell">
                    <div class="fr-checkbox-group fr-checkbox-group--sm">
                        <input type="checkbox" id="kid-select-all" data-role="kid-select-all">
                        <label class="fr-label" for="kid-select-all"><span class="fr-sr-only">{{#str}}bulk_select_all, local_kid{{/str}}</span></label>
                    </div>
                </th>
                <th scope="col">{{#str}}entry_col_student, local_kid{{/str}}</th>
                <th scope="col">{{#str}}promotion_col_status, local_kid{{/str}}</th>
                <th scope="col">{{#str}}entry_col_published, local_kid{{/str}}</th>
                <th scope="col">{{#str}}promotion_col_actions, local_kid{{/str}}</th>
            </tr>
        </thead>
        <tbody>
            {{#rows}}
            <tr data-studentid="{{studentid}}">
                <td class="kid-checkbox-cell">
                    <div class="fr-checkbox-group fr-checkbox-group--sm">
                        <input type="checkbox" id="kid-select-row-{{studentid}}" data-role="kid-select-row" value="{{studentid}}">
                        <label class="fr-label" for="kid-select-row-{{studentid}}"><span class="fr-sr-only">{{name}}</span></label>
                    </div>
                </td>
                <td>{{name}}</td>
                <td>{{{statusbadge}}}</td>
                <td data-role="kid-published-cell"><span class="{{publishedclass}}">{{publishedlabel}}</span></td>
                <td><a class="fr-link" href="{{openurl}}">{{#str}}action_open, local_kid{{/str}}</a></td>
            </tr>
            {{/rows}}
        </tbody>
    </table>
</div>
