{{!
    @template local_kid/admin_competences

    * addurl, syncurl - string
    * hascompetencies - bool
    * competencies - array of { codecourt, libelle, codeadesi, statuslabel,
      statusclass, editurl, deleteurl, candelete }
}}
<div class="fr-scope">
<ul class="fr-btns-group fr-btns-group--inline-md fr-mb-4w">
    <li><a class="fr-btn" href="{{addurl}}">{{#str}}competency_add, local_kid{{/str}}</a></li>
    <li><a class="fr-btn fr-btn--secondary" href="{{syncurl}}">{{#str}}competency_sync_action, local_kid{{/str}}</a></li>
</ul>

{{^hascompetencies}}
    {{> local_kid/empty_state}}
{{/hascompetencies}}

{{#hascompetencies}}
<div class="fr-table">
    <table>
        <caption>{{#str}}competency_libelle, local_kid{{/str}}</caption>
        <thead>
            <tr>
                <th scope="col">{{#str}}competency_col_code, local_kid{{/str}}</th>
                <th scope="col">{{#str}}competency_libelle, local_kid{{/str}}</th>
                <th scope="col">{{#str}}competency_codeadesi, local_kid{{/str}}</th>
                <th scope="col">{{#str}}promotion_col_status, local_kid{{/str}}</th>
                <th scope="col">{{#str}}promotion_col_actions, local_kid{{/str}}</th>
            </tr>
        </thead>
        <tbody>
            {{#competencies}}
            <tr>
                <td>{{codecourt}}</td>
                <td>{{libelle}}</td>
                <td>{{codeadesi}}</td>
                <td><span class="{{statusclass}}">{{statuslabel}}</span></td>
                <td>
                    <a class="fr-link" href="{{editurl}}">{{#str}}action_edit, local_kid{{/str}}</a>
                    {{#candelete}} · <a class="fr-link" href="{{deleteurl}}">{{#str}}action_delete, local_kid{{/str}}</a>{{/candelete}}
                </td>
            </tr>
            {{/competencies}}
        </tbody>
    </table>
</div>
{{/hascompetencies}}
</div>
