{{!
    @template local_kid/stage_grid

    Summary mode: libelle, rows[], hasrows, studentcount, finalisedcount,
      publishedcount, hasbulkactions, canexport, canbulkpublish,
      bulkscreen, bulkitemid, sesskey, canimport, importurl, templateurl
    Student mode: libelle, steps[], formhtml, canvalidate, canfinalise,
      canreopen, ispublished, validateurl, finaliseurl, reopenurl, backurl,
      docs[], hasdocs, uploadurl, entryid, sesskey, canimport,
      templateoneurl, importurl
}}
<div class="fr-scope">
<h2>{{libelle}}</h2>

{{#summarymode}}
    {{^hasrows}}{{> local_kid/empty_state}}{{/hasrows}}
    {{#hasrows}}
    <div class="fr-grid-row fr-grid-row--gutters fr-mb-4w">
        <div class="fr-col-12 fr-col-md-4">
            <div class="fr-card">
                <div class="fr-card__body">
                    <div class="fr-card__content fr-py-2w">
                        <p class="fr-display--xs fr-mb-0">{{studentcount}}</p>
                        <p class="fr-text--sm fr-mb-0">{{#str}}entry_col_student, local_kid{{/str}}</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="fr-col-12 fr-col-md-4">
            <div class="fr-card">
                <div class="fr-card__body">
                    <div class="fr-card__content fr-py-2w">
                        <p class="fr-display--xs fr-mb-0">{{finalisedcount}}</p>
                        <p class="fr-text--sm fr-mb-0">{{#str}}workflow_finalise, local_kid{{/str}}</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="fr-col-12 fr-col-md-4">
            <div class="fr-card">
                <div class="fr-card__body">
                    <div class="fr-card__content fr-py-2w">
                        <p class="fr-display--xs fr-mb-0">{{publishedcount}}</p>
                        <p class="fr-text--sm fr-mb-0">{{#str}}published_yes, local_kid{{/str}}</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    {{#canimport}}
    <p class="fr-mb-2w">
        <a class="fr-link" href="{{templateurl}}">{{#str}}stage_template_global, local_kid{{/str}}</a>
        · <a class="fr-link" href="{{importurl}}">{{#str}}stage_import_action, local_kid{{/str}}</a>
    </p>
    {{/canimport}}

    {{> local_kid/selectable_entry_table}}
    {{#hasbulkactions}}
    {{> local_kid/bulk_actions_bar}}
    {{/hasbulkactions}}
    {{/hasrows}}
{{/summarymode}}

{{^summarymode}}
<div data-region="kid-grid-student"{{#conflictjson}} data-conflict="{{conflictjson}}"{{/conflictjson}}>
{{> local_kid/stage_grid_student}}
</div>
{{/summarymode}}
</div>
