{{!
    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.

    Edwiser RemUI 
    @package    theme_remui
    @copyright  (c) 2018 WisdmLabs (https://wisdmlabs.com/)
    @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 
}}
{{< core_form/element-template }}
    {{$element}}
        {{^element.frozen}}
        <select class="custom-select {{#error}}form-control-danger{{/error}}" name="{{element.name}}"
            id="{{element.id}}"
            {{#element.multiple}}multiple{{/element.multiple}}
            {{#error}}
                autofocus aria-describedby="id_error_{{element.name}}"
            {{/error}}
            {{{element.attributes}}} >
            {{#element.options}}
            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{{text}}}</option>
            {{/element.options}}
        </select>
        {{/element.frozen}}
        {{#element.frozen}}
            {{#element.options}}
                {{#selected}}
                    {{{text}}}
                    {{^element.hardfrozen}}
                        <input type="hidden" name="{{element.name}}" value="{{value}}">
                    {{/element.hardfrozen}}
                {{/selected}}
            {{/element.options}}
        {{/element.frozen}}
    {{/element}}
{{/ core_form/element-template }}
{{^element.frozen}}
{{#js}}
require(['core/form-autocomplete'], function(module) {
    module.enhance({{#quote}}#{{element.id}}{{/quote}},
                   {{element.tags}},
                   {{#quote}}{{element.ajax}}{{/quote}},
                   {{#quote}}{{element.placeholder}}{{/quote}},
                   {{element.casesensitive}},
                   {{element.showsuggestions}},
                   {{#quote}}{{element.noselectionstring}}{{/quote}});
});
{{/js}}
{{/element.frozen}}
