{{!
    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 format_tiles/embed_module_modal_header

    The purpose of this template is to render the buttons for the header in a modal window
    which can be used to display an embedded file (i.e. a PDF)

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Context variables required for this template:
        * cmid - course module id
        * showDownload - whether to show the download button or not
        * showNewWindow - whether to show the new window button or not
        * completion - array of info for the completion_button template
        * hascompletion - whether we are using completion

    Example context (json):
    {
        "cmid": 123,
        "showDownload": "1",
        "showNewWindow": "1",
        "completion": [],
        "hascompletion": 1
    }
}}
<div class="embed-module-buttons">
    {{#showNewWindow}}
        <a href="{{config.wwwroot}}/course/format/tiles/mod_view.php?cmid={{cmid}}" class="embed_file_button button_expand ml-2" id="expandbutton_{{cmid}}" data-cmid="{{cmid}}" data-command="expand" target="_blank">
            {{#pix}}clone, format_tiles, {{#str}}showseparatewin, format_tiles{{/str}}{{/pix}}
        </a>
    {{/showNewWindow}}
    {{#showDownload}}
        <a href="{{config.wwwroot}}/course/format/tiles/mod_view.php?cmid={{cmid}}&forcedownload=1" class="embed_file_button button_download ml-2" id="downloadbutton_{{cmid}}" data-cmid="{{cmid}}" data-command="download">
            {{#pix}}cloud-download, format_tiles, {{#str}}download, format_tiles{{/str}}{{/pix}}
        </a>
    {{/showDownload}}
    {{#hascompletion}}
        {{#completionIsManual}}
            <div class="ml-2">{{>core_course/completion_manual}}</div>
        {{/completionIsManual}}
    {{/hascompletion}}
    <button type="button" class="close ml-2" data-action="hide" aria-label="{{#str}}close, format_tiles{{/str}}">
        <span aria-hidden="true">×</span>
    </button>
</div>