{{!
    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 core_course/local/activitychooser/item

    Chooser item template.

    Example context (json):
    {
        "label": "Option name",
        "description": "Option description",
        "urls": {
            "addoption": "http://addoptionurl.com"
        },
        "icon": "<img class='icon' src='http://urltooptionicon' alt='icon'>",
        "purpose": "content",
        "branded": 0
    }
}}
<div role="menuitem" tabindex="-1" aria-label="{{title}}" class="option border-0 card m-1 bg-white" data-region="chooser-option-container" data-internal="{{name}}" data-modname="{{componentname}}_{{link}}">
    <div class="optioninfo card-body d-flex flex-column text-center p-1" data-region="chooser-option-info-container">
        <a class="d-flex flex-column justify-content-between flex-fill" href="{{link}}" title="{{#str}} addnew, moodle, {{title}} {{/str}}" tabindex="-1" data-action="add-chooser-option">
            <div class="optionicon mt-2 mb-1 mx-auto icon-no-margin modicon_{{name}} activityiconcontainer smaller
                    {{purpose}} {{#branded}}isbranded{{/branded}}">
                {{{icon}}}
            </div>
            <div class="optionname clamp-2">{{title}}</div>
        </a>
        <div class="optionactions d-flex justify-content-center" role="group" data-region="chooser-option-actions-container">
            {{^legacyitem}}
                <button class="btn btn-icon m-0 optionaction {{#favourite}}text-primary{{/favourite}}{{^favourite}}text-muted{{/favourite}}"
                        data-action="manage-module-favourite"
                        data-favourited="{{favourite}}"
                        data-id="{{id}}"
                        data-name="{{componentname}}"
                        data-internal="{{name}}"
                        {{^favourite}}
                            aria-pressed="false"
                        {{/favourite}}
                        {{#favourite}}
                            aria-pressed="true"
                        {{/favourite}}
                        aria-label="{{#str}} aria:modulefavourite, core_course, {{title}} {{/str}}"
                        tabindex="-1"
                >
                    {{#favourite}}
                        {{#pix}} i/star, core {{/pix}}
                    {{/favourite}}
                    {{^favourite}}
                        {{#pix}} i/star-o, core {{/pix}}
                    {{/favourite}}
                </button>
            {{/legacyitem}}
            <button class="btn btn-icon m-0 optionaction" data-action="show-option-summary" tabindex="-1">
                <span aria-hidden="true">{{#pix}} docs, core {{/pix}}</span>
                <span class="visually-hidden">{{#str}} informationformodule, core_course, {{title}} {{/str}}</span>
            </button>
        </div>
    </div>
</div>
