
<div class="categorieslist">
{{#categories}}
<div data-category-id="{{id}}" id="category-{{id}}" class="mt-2">
    <div class="row justify-content-between align-items-end">
        <div class="col-6 categoryinstance">
            <h3>{{{name}}}</h3>
        </div>

        <!-- <div class="col-auto text-right">
            {{#addfieldmenu}}{{> core/action_menu}}{{/addfieldmenu}}
        </div> -->
        <div class="col-auto text-left">
            <a href="{{azione}}" class="btn btn-primary">{{#str}}itemnew, mtcontabilita{{/str}}</a>
        </div>
    </div>

    <table class="generaltable fullwidth profilefield">
        {{#hasfields}}
            <thead>
                <tr>
                    <th scope="col" class="col-1">#</th>
                    <th scope="col" class="col-2">{{#str}}data, mtcontabilita{{/str}}</th>
                    <th scope="col" class="col-2">{{#str}}conto2, mtcontabilita{{/str}}</th>
                    <th scope="col" class="col-2 text-right">{{#str}}tipo1, mtcontabilita{{/str}}</th>
                    <th scope="col" class="col-2 text-right">{{#str}}tipo2, mtcontabilita{{/str}}</th>
                    <th scope="col" class="col-2 text-right">{{#str}}schema, mtcontabilita{{/str}}</th>
                    <th scope="col" class="col-2 text-right">{{#str}}score, mtcontabilita{{/str}}</th>
                    <!-- <th scope="col" class="col-1">{{#str}}itemamount, mtcontabilita{{/str}}</th> -->
                    <th scope="col" class="col-2 text-right">{{#str}}edit{{/str}}</th>
                </tr>
            </thead>
            <tbody>
                {{#fields}}
                    <tr>
                        <td class="col-1">{{{itemnum}}}</td>
                        <td class="col-2">{{{itemdate}}}</td>
                        <td class="col-2">{{#grp}}<div>{{{conto}}}</div>{{/grp}}</td>
                        <td class="col-2 text-right">{{#grp}}<div>{{{amount1}}}</div>{{/grp}}</td>
                        <td class="col-2 text-right">{{#grp}}<div>{{{amount2}}}</div>{{/grp}}</td>
                        <td class="col-2 text-right">{{#grp}}<div>{{{schema}}}</div>{{/grp}}</td>
                        <td class="col-2 text-right">{{{score}}}</td>
                        <!-- <td class="col-1">{{#grp}}<div>{{{amount}}}</div>{{/grp}}</td> -->
                        <td class="col-2 text-right">
                            <a href="editlist.php?id={{cmid}}&sort={{sort}}">
                                {{#pix}}t/edit, core, {{#str}}edit{{/str}}{{/pix}}</a>
                            <a href="{{baseurl}}?action=deletefield&id={{cmid}}&sort={{sort}}&sesskey={{sesskey}}">
                                {{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
                            {{^isfirst}}
                                <a href="{{baseurl}}?id={{cmid}}&sort={{sort}}&action=movefield&dir=up&amp;sesskey={{sesskey}}">
                                {{#pix}}t/up, core, {{#str}}moveup{{/str}}{{/pix}}</a>
                            {{/isfirst}}
                            {{#isfirst}}{{#pix}}spacer, moodle{{/pix}}{{/isfirst}}
                            {{^islast}}
                                <a href="{{baseurl}}?id={{cmid}}&sort={{sort}}&action=movefield&dir=down&amp;sesskey={{sesskey}}">
                                {{#pix}}t/down, core, {{#str}}movedown{{/str}}{{/pix}}</a>
                            {{/islast}}
                            {{#islast}}{{#pix}}spacer, moodle{{/pix}}{{/islast}}
                        </td>
                    </tr>
                {{/fields}}
            </tbody>
        {{/hasfields}}
        {{^hasfields}}
            <thead>
                <tr class="nofields alert alert-danger alert-block fade in">
                    <td>
                        {{#str}}itemno, mtcontabilita{{/str}}
                    </td>
                </tr>
            </thead>
        {{/hasfields}}
    </table>

    <div class="col-auto text-left">
        <a href="{{azione2}}" class="btn btn-primary">{{#str}}reorder, mtcontabilita{{/str}}</a>
    </div>

</div>
{{/categories}}
</div>

<div class="sessions-list" data-region="mtcontabilita-sessions-list">
    {{{sessionslisttable}}}
</div>
{{#js}}
    require(['mod_mtcontabilita/sessions_list'], function(sessionsList) {
        {{#signupsessionid}}
            sessionsList.signup({{signupsessionid}}, {{cansignup}});
        {{/signupsessionid}}
        sessionsList.init();
    });
{{/js}}
