{{!
    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 block_eledia_coursesearch/nav-category-dropdown

    This template renders grouping dropdown.

    Example context (json):
    {
        "customfieldid": 1,
        "description": "Field description",
        "customvalues": [
            {
                "customfieldid": 1,
                "value": "value1",
                "name": "Value Name"
            }
        ],
        "customselections": [
            {
                "customfieldid": 1,
                "value": "value1",
                "name": "Value Name"
            }
        ]
    }
}}
<ul class="dropdown-menu dropdown-customfields-{{customfieldid}} dropdown-menu-customfields customprevent" role="menu" data-show-active-item data-skip-active-class="true" data-active-item-text>
	{{#description}}
    <li class="dropdown-description">
			<div>{{#pix}}i/info, core{{/pix}}</div><div>{{{description}}}</div>
    </li>
	{{/description}}
    <li class="dropdown-divider" role="presentation">
        <span class="filler">&nbsp;</span>
    </li>
    {{^customselections}}
    <li>
        <a class="dropdown-item customprevent customfield-no" href="#" data-customfieldid="{{customfieldid}}"
           role="menuitem" >
            {{#str}} nocustomfieldsselected, block_eledia_coursesearch {{/str}}
        </a>
    </li>
    {{/customselections}}
    {{#customselections}}
    <li>
        <a class="dropdown-item customprevent customfield-selected" href="#" data-customfieldid="{{customfieldid}}"
		   data-selectvalue="{{value}}"
		   data-selectname="{{name}}"
           role="menuitem" >
            {{name}}
        </a>
    </li>
    {{/customselections}}
    <li class="dropdown-divider" role="presentation">
        <span class="filler">&nbsp;</span>
    </li>
    {{^customvalues}}
    <li>
        <a class="dropdown-item customprevent customfield-no" href="#" data-customfieldid="{{customfieldid}}"
           role="menuitem" >
            {{#str}} nocustomfieldsavailable, block_eledia_coursesearch {{/str}}
        </a>
    </li>
    {{/customvalues}}
    {{#customvalues}}
    <li>
        <a class="dropdown-item customprevent customfield-selectable" href="#" data-customfieldid="{{customfieldid}}"
		   data-selectvalue="{{value}}"
		   data-selectname="{{name}}"
           role="menuitem" >
            {{name}}
        </a>
    </li>
    {{/customvalues}}
</ul>
