{{!
    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_message/message_drawer_view_conversation_header_content_type_self

    This template will render the header content of the conversation page in
    the message message drawer.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * All data attributes are required

    Context variables required for this template:
    * urls The URLs for the popover
    * name
    * subname
    * imageurl
    * isfavourite
    * showonlinestatus


    Example context (json):
    {}

}}

<div class="d-flex flex-column">
    <div class="d-flex align-items-center">
        <div class="align-self-stretch" >
            <a class="h-100 py-3 px-2 mr-2 ml-1 d-flex align-items-center btn btn-sm" href="#" data-route-back>
                {{> core_message/message_drawer_icon_back }}
            </a>
        </div>
        <div class="d-flex">
            <a class="text-decoration-none" href="#" data-action="view-group-info">
                {{#imageurl}}
                    <img
                        class="rounded-circle"
                        src="{{{.}}}"
                        alt="{{name}}"
                        aria-hidden="true"
                        style="height: 40px"
                    >
                {{/imageurl}}
                <span class="{{^isfavourite}}hidden{{/isfavourite}} message-name-favorite" data-region="favourite-icon-container">
                    {{#pix}} i/star-rating, core {{/pix}}
                </span>
                <div class="w-100 ml-3 align-items-center">
                    <div>
                        <strong class="m-0 message-name">{{name}}</strong>
                    </div>
                    <p class="message-user-status">{{subname}}</p>

                    <a href="#" data-action="view-group-info">
                        <small class="m-0 text-muted">
                            {{#str}} numparticipants, core_message, {{totalmembercount}} {{/str}}
                        </small>
                    </a>
                </div>

            </a>
        </div>
        <div class="ml-auto dropdown">
            <button class="btn-msg" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                {{#pix}} i/moremenu, core {{/pix}}
            </button>
            <div class="dropdown-menu pull-right">
                <a class="dropdown-item" href="#" data-action="view-group-info">
                    {{#str}} groupinfo, core_message {{/str}}
                </a>
                <a class="dropdown-item {{#isfavourite}}hidden{{/isfavourite}}" href="#" data-action="confirm-favourite">
                    {{#str}} addtofavourites, core_message {{/str}}
                </a>
                <a class="dropdown-item {{^isfavourite}}hidden{{/isfavourite}}" href="#" data-action="confirm-unfavourite">
                    {{#str}} removefromfavourites, core_message {{/str}}
                </a>
            </div>
        </div>
    </div>
</div>
