{{!
// This file is part of the mod_mtcontabilita plugin for Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * @package    mod
 * @subpackage mtcontabilita
 * @copyright  2024 Mediatouch 2000 Srl <https://www.mediatouch.it>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @author     Marco Cappuccio <m.cappuccio@mediatouch.it>
 */

 }}
{{!
    @template mod_mtcontabilita/mtitem_view

    List of item.

    Example context (json):
    {
        "addbuttontitle": "Add item",
        "addbuttonurl": "#",
        "intro": "mtcontabilita intro",
        "sessionslisttable": "<table></table>",
        "signupsessionid": "1",
        "cansignup": "true"
    }

{{> core/action_menu} }

}}
{{#actions}}
    <div class="d-flex justify-content-end">
        <a href="#" class="btn btn-primary align-items-center mb-2" data-cmid="{{actions}}" data-action="addsession">{{#str}} adddots {{/str}}</a>
    </div>
{{/actions}}
<div class="sessions-list" data-region="mtcontabilita-sessions-list">
    {{{sessionslisttable}}}
</div>
{{#js}}
    require(['mod_mtcontabilita/mtitem_list'], function(sessionsList) {
        {{#signupsessionid}}
            sessionsList.signup({{signupsessionid}}, {{cansignup}});
        {{/signupsessionid}}
        sessionsList.init();
    });
{{/js}}
