{{!
    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: xmlns="http://www.w3.org/1999/html"/>//www.gnu.org/licenses/>.
}}

{{^isdropdown}}
    {{#haswrapper}}
        <div class="button-wrapper">
    {{/haswrapper}}
    <button type="button" class="btn btn-default {{#buttonclass}}{{buttonclass}}{{/buttonclass}} {{identifier}}"
        data-identifier="{{identifier}}"
        {{#buttonid}} id="{{buttonid}}"{{/buttonid}}
        {{#itemtype}} data-itemtype="{{itemtype}}"{{/itemtype}}
        {{#itemid}} data-itemid="{{itemid}}"{{/itemid}}
        {{#link}} data-link="{{link}}"{{/link}}
        {{#controller}} data-controller="{{controller}}"{{/controller}}
        {{#action}} data-action="{{action}}"{{/action}}
        {{#callback}} data-callback="{{callback}}"{{/callback}}
        {{#order}} data-order="{{order}}"{{/order}}
        {{#disabled}} disabled{{/disabled}}
        {{{attributesstr}}}
        >
    {{#name}}{{name}}{{/name}}
    </button>
    {{#haswrapper}}
    </div>
    {{/haswrapper}}
{{/isdropdown}}

{{#isdropdown}}
    <div class="dropdown" {{#order}} data-order="{{order}}"{{/order}}>
        <button type="button" class="btn btn-default dropdown-toggle {{#buttonclass}}{{buttonclass}}{{/buttonclass}} {{identifier}}"
            data-identifier="{{identifier}}"
            {{#buttonid}} id="{{buttonid}}"{{/buttonid}}
            {{#itemtype}} data-itemtype="{{itemtype}}"{{/itemtype}}
            {{#itemid}} data-itemid="{{itemid}}"{{/itemid}}
            {{#link}} data-link="{{link}}"{{/link}}
            {{#controller}} data-controller="{{controller}}"{{/controller}}
            {{#action}} data-action="{{action}}"{{/action}}
            {{#callback}} data-callback="{{callback}}"{{/callback}}
            {{#disabled}} disabled{{/disabled}}
            {{{attributesstr}}}
            data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
        >
            {{#name}}{{name}}{{/name}}
        </button>

    <div class="dropdown-menu">
        {{#subbuttons}}
            <a class="dropdown-item {{identifier}}" data-identifier="{{identifier}}"
                {{#buttonid}} id="{{buttonid}}"{{/buttonid}}
                {{#itemtype}} data-itemtype="{{itemtype}}"{{/itemtype}}
                {{#itemid}} data-itemid="{{itemid}}"{{/itemid}}
                {{#link}} data-link="{{link}}"{{/link}}
                {{#disabled}} disabled{{/disabled}}
                {{#controller}} data-controller="{{controller}}"{{/controller}}
                {{#action}} data-action="{{action}}"{{/action}}
                {{#callback}} data-callback="{{callback}}"{{/callback}}
                {{#order}} data-order="{{order}}"{{/order}}
                {{{attributesstr}}}
            >
                {{#name}}{{name}}{{/name}}
            </a>
        {{/subbuttons}}
    </div>
</div>
{{/isdropdown}}
