{{!
    This file is part of 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/>.
}}
{{!
    @template qbank_managecategories/move_context_list

    Modal to move a category within a context.

    Context variables required for this template:
    * contextid - The id of the context.
    * contextname - The name of the context to display as a heading.
    * categories - Array of category objects. See qbank_managecategories/move_category_list partial for details.

    Example context (json):
    {
        "contexid": 1,
        "cmid": 1,
        "contextname": "Question bank: Qbank 1",
        "categories": [
            {
                "categoryname": "Default category for Qbank 1",
                "categoryid": 3,
                "firstchild": true,
                "current": false,
                "hascategories": false,
                "categories": []
            },
            {
                "categoryname": "New category",
                "categoryid": 4,
                "firstchild": false,
                "current": true,
                "hascategories": false,
                "categories": []
            }
        ]
    }
}}
<div role="tree">
    <div class="d-flex">
        <h3 class="bank-header" data-cmid="{{cmid}}">{{{contextname}}}</h3>
        <button data-action="switch-question-bank" type="button" class="btn btn-secondary ms-auto mb-2">
            {{#str}}switchbank, core_question{{/str}}
        </button>
    </div>
    {{>qbank_managecategories/move_category_list}}
</div>
