{{!
    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 tool_lp/scale_configuration_page

    Set scale configuration for the competency framework.

    Classes required for JS:
    * none

    Data attibutes required for JS:
    * data-field

    Context variables required for this template:
    * scales Array of id / name pairs.

    Example context (json):
    {
        "scales": [
            { "id": 1, "name": "Competent" },
            { "id": 2, "name": "Not competent" }
        ]
    }
 }}
<div>
<table class="table generaltable w-100">
    <thead>
        <tr>
            <th scope="col">{{#str}}scalevalue, tool_lp{{/str}}</th>
            <th scope="col">{{#str}}default, tool_lp{{/str}}{{#pix }} req, core, {{#str}}requiredelement, form{{/str}} {{/pix }}</th>
            <th scope="col">{{#str}}proficient, tool_lp{{/str}}{{#pix }} req, core, {{#str}}requiredelement, form{{/str}}{{/pix }}</th>
        </tr>
    </thead>
    <tbody>
        {{#scales}}
        <tr class="tool_lp_scale_config">
            <td><small>{{name}}</small></td>
            <td>
                <div class="d-inline-flex mt-1 pb-0 mb-0 custom-control custom-radio custom-control-inline">
                    <input type="radio" name="default_{{uniqid}}" id="tool_lp_scale_default_{{id}}" data-field="tool_lp_scale_default_{{id}}" class="tool_lp_scale_default form-check-input custom-control-input"/>
                    <label class="custom-control-label ml-1" for="tool_lp_scale_default_{{id}}"></label>
                </div>
            </td>
            <td>
                <div class="custom-control custom-switch">
                    <input type="checkbox" class="custom-control-input tool_lp_scale_proficient" name="proficient" data-field="tool_lp_scale_proficient_{{id}}" id="tool_lp_scale_proficient_{{id}}">
                    <label class="custom-control-label" for="tool_lp_scale_proficient_{{id}}"></label>
                </div>
            </td>
        </tr>
        {{/scales}}
    </tbody>
</table>
</div>

<div data-region="scale-buttons" class="mt-1 w-100 mt-3 row no-gutters justify-content-between">
    <input type="button" class="col mr-1 btn btn-secondary" data-action="close" value="{{#str}}closebuttontitle{{/str}}"/>
    <input type="button" class="col ml-1 btn btn-danger" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
</div>
<div class="clearfix"></div>
