{{!
    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_bulkmove/bulk_move

    Template for qbank_bulkmove/modal_question_bank_bulkmove

    Example context (json):
{
    "allsharedbanks": [
        {
            "name": "Quiz 1",
            "contextid": 1,
            "coursenamebankname": "c1 - Quiz 1"
        },
        {
            "name": "Question bank 1",
            "modid": "2",
            "contextid": 2,
            "coursenamebankname": "c1 - Question bank 1",
            "cminfo": {},
            "questioncategories": [
                {
                    "id": "22",
                    "name": "Default for Question bank 1",
                    "contextid": "22",
                    "enabled": "disabled"
                }
            ]
        },
        {
            "name": "Question bank 2",
            "modid": "3",
            "contextid": 33,
            "coursenamebankname": "c2 - Question bank 2",
            "cminfo": {},
            "questioncategories": [
                {
                    "id": "23",
                    "name": "Default for Question bank 2",
                    "contextid": "23",
                    "enabled": "disabled"
                }
            ]
        }
    ],
    "allcategories": [
        {
            "id": "22",
            "name": "Default for Question bank 1",
            "contextid": "22"
        },
        {
            "id": "23",
            "name": "Default for Question bank 2",
            "contextid": "23",
            "enabled": "disabled"
        },
        {
            "id": "24",
            "name": "Default for Question bank 3",
            "contextid": "24",
            "enabled": "disabled"
        },
        {
            "id": "25",
            "name": "Default for Question bank 4",
            "contextid": "25",
            "enabled": "disabled"
        }
    ],
    "save": {
        "id": "single_button669e368d496707",
        "formid": null,
        "method": "post",
        "url": "#",
        "label": "Move questions",
        "classes": "singlebutton",
        "disabled": false,
        "tooltip": null,
        "type": "primary",
        "attributes": [
            {
                "name": "data-action",
                "value": "bulkmovesave"
            },
            {
                "name": "disabled",
                "value": "disabled"
            }
        ],
        "params": [
            {
                "name": "sesskey",
                "value": "abcde12345"
            }
        ],
        "actions": [],
        "hasactions": false
    }
}
}}

<div class="search-banks">
    <h5>{{#str}}questionbank, question{{/str}}</h5>
    <select class="form-select bulk-move d-none" id="searchbanks">
        {{#allsharedbanks}}
            <option value="{{contextid}}">{{{coursenamebankname}}}</option>
        {{/allsharedbanks}}
    </select>
</div>
<div class="search-categories mt-3">
    <h5>{{#str}}questioncategories, question{{/str}}</h5>
    <select class="form-select bulk-move d-none" id="searchcategories">
        {{#allcategories}}
            <option value="{{id}}" data-bank-contextid="{{contextid}}" data-enabled="{{enabled}}">{{{name}}}</option>
        {{/allcategories}}
    </select>
    <div id="searchcatwarning" class="d-none">{{#str}}warning, qbank_bulkmove{{/str}}</div>
</div>

{{#save}}
    <div class="move-questions mt-3">
        {{>core/single_button}}
    </div>
{{/save}}
