{{!
    @template local_kid/bulk_actions_bar

    Shared "Pour les élèves sélectionnés :" grouped-actions bar for the
    Évaluations/Stages/CAPP résumé screens, modelled on Moodle's own
    assignment grading "With selected..." bar. Rendered once per résumé
    table, immediately after it (see local_kid/selectable_entry_table).
    Bound entirely by amd/src/bulk_actions.js, which reads
    data-screen/data-itemid/data-sesskey off the outer element: publish/hide
    go through the plugin's AJAX write function and patch affected rows in
    place, downloads submit a real hidden <form> POST (a ZIP response can't
    travel through core/ajax).

    Only rendered when the caller computed hasbulkactions=true (canexport,
    canbulkpublish or cancapprapport) — no point showing an empty action list.

    cancapprapport (CAPP only, local/kid:evaluate_capp) adds the "livret
    PDF" action — downloads pages/capp_rapport.php's session-scoped PDF
    (page de garde + Bilan général + fiches) for the current selection,
    same hidden-<form>-POST download mechanism as download_pdf/download_docx.

    Context: bulkscreen, bulkitemid, sesskey, canexport, canbulkpublish,
      cancapprapport
}}
<div class="kid-bulk-actions fr-mt-4w" data-region="kid-bulk-actions"
     data-screen="{{bulkscreen}}" data-itemid="{{bulkitemid}}" data-sesskey="{{sesskey}}">
    <div class="fr-grid-row fr-grid-row--gutters fr-grid-row--bottom kid-bulk-actions__row">
        <div class="fr-col-12 fr-col-md-4">
            <div class="fr-select-group fr-mb-0">
                <label class="fr-label" for="kid-bulk-select-{{bulkscreen}}-{{bulkitemid}}">{{#str}}bulk_actions_label, local_kid{{/str}}</label>
                <select class="fr-select" id="kid-bulk-select-{{bulkscreen}}-{{bulkitemid}}" data-role="kid-bulk-select">
                    <option value="">{{#str}}bulk_actions_choose, local_kid{{/str}}</option>
                    {{#canexport}}
                    <option value="download_pdf">{{#str}}bulk_action_download_pdf, local_kid{{/str}}</option>
                    <option value="download_docx">{{#str}}bulk_action_download_docx, local_kid{{/str}}</option>
                    {{/canexport}}
                    {{#canbulkpublish}}
                    <option value="publish">{{#str}}bulk_action_publish, local_kid{{/str}}</option>
                    <option value="hide">{{#str}}bulk_action_hide, local_kid{{/str}}</option>
                    {{/canbulkpublish}}
                    {{#cancapprapport}}
                    <option value="export_capp_rapport">{{#str}}bulk_action_export_capp_rapport, local_kid{{/str}}</option>
                    {{/cancapprapport}}
                </select>
            </div>
        </div>
        <div class="fr-col">
            <button type="button" class="fr-btn" data-role="kid-bulk-apply" disabled>{{#str}}bulk_actions_apply, local_kid{{/str}}</button>
        </div>
        <div class="fr-col">
            <span class="fr-text--sm" data-role="kid-bulk-count"></span>
        </div>
    </div>
    <div class="kid-bulk-result fr-mt-1w" data-region="kid-bulk-result" aria-live="polite"></div>
</div>
