{{!
    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 mod_forum/forum_discussion_nested_v2_post_reply

    Template to render a single post from a discussion.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Example context (json):
    {
    }
}}
{{< mod_forum/forum_discussion_nested_v2_first_post }}
    {{$subject}}
        <h3
            {{#isdeleted}}class="h6 fw-bold"{{/isdeleted}}
            {{^isdeleted}}class="visually-hidden"{{/isdeleted}}
            data-region-content="forum-post-core-subject"
        >{{{subject}}}</h3>
    {{/subject}}
    {{$footer}}
        {{^isdeleted}}
            {{^readonly}}
                {{#capabilities.reply}}
                    <div class="d-flex mt-1">
                        <button
                            class="fw-bold btn btn-link px-0"
                            data-href="{{{urls.reply}}}"
                            data-post-id="{{id}}"
                            data-action="create-inpage-reply"
                            data-can-reply-privately="{{capabilities.canreplyprivately}}"
                        >
                            {{#str}} reply, mod_forum {{/str}}
                        </button>
                    </div>
                {{/capabilities.reply}}
            {{/readonly}}
        {{/isdeleted}}
    {{/footer}}
    {{$replies}}
        <div class="indent my-4" data-region="replies-visibility-toggle-container" style="display: none">
            <button class="btn btn-link ps-0" data-action="show-replies">
                {{#str}}
                    showpreviousrepliescount,
                    mod_forum,
                    <span data-region="reply-count">{{#totalreplycount}}{{.}}{{/totalreplycount}}{{^totalreplycount}}0{{/totalreplycount}}</span>
                {{/str}}
            </button>
            <button class="btn btn-link hidden ps-0" data-action="hide-replies">
                {{#str}}
                    hidepreviousrepliescount,
                    mod_forum,
                    <span data-region="reply-count">{{#totalreplycount}}{{.}}{{/totalreplycount}}{{^totalreplycount}}0{{/totalreplycount}}</span>
                {{/str}}
            </button>
        </div>
        <div class="indent replies-container" data-region="replies-container">
            {{#hasreplies}}
                {{#replies}}
                    {{> mod_forum/forum_discussion_nested_v2_post_reply }}
                {{/replies}}
            {{/hasreplies}}
        </div>
        <div class="indent inline-reply-container" data-region="inpage-reply-container"></div>
    {{/replies}}
{{/ mod_forum/forum_discussion_nested_v2_first_post }}
