{{!
    This file is part of Moodle - https://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 local_amos/filter_fcmp_option

    Render filter component selector's component line.

    Selectors required for JS:
    * amosfilter_fcmp - component selector id
    * amosfilter_fcmp_counter - indicator of the number of selected components
    * amosfilter_fcmp_search - searchfilterinput field

    Context variables required for this template:
    * name
    * label
    * selected
    * type
    * typename
    * since
    * app

    Example context (json):
    {
        "name": "core",
        "label": "core",
        "selected": true,
        "type": "core",
        "typename": "Core",
        "since": "2.0+",
        "app": "true",
        "workplace": "true"
    }
}}

<tr data-region="amosfilter_fcmp_item">
    <td>
        <div class="form-check">
            <input class="form-check-input" {{#selected}} checked {{/selected}} type="checkbox" name="fcmp[]" id="amosfilter_fcmp_f_{{name}}" value="{{name}}"
                data-component-type="{{type}}" {{#app}}data-component-app="1"{{/app}} {{#workplace}}data-component-workplace="1"{{/workplace}}>
            <label class="form-check-label" for="amosfilter_fcmp_f_{{name}}">{{label}}</label>
        </div>
    </td>
    <td>
        <span class="badge badge-light">{{since}}</span>
        <span class="badge badge-light">{{typename}}</span>
        {{#hasstdvernote}}
            <span class="badge badge-light">{{stdvernote}}</span>
        {{/hasstdvernote}}
        {{#app}}
            <span class="badge badge-light"><i class="fa fa-mobile"></i> {{#str}} componentsapp, local_amos {{/str}}</span>
        {{/app}}
        {{#workplace}}
            <span class="badge badge-light"><i class="fa fa-briefcase"></i> {{#str}} componentsworkplace, local_amos {{/str}}</span>
        {{/workplace}}
    </td>
</tr>
