{{!
    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/inpage_reply

    Template which defines a forum post for sending in a single-post HTML email.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Example context (json):
    {
        "postid": 0,
        "reply_url": "",
        "sesskey": "",
        "parentsubject": ""
    }
}}
<div data-content="inpage-reply-content" style="display: none;">
    <div class="forum-post-reply w-100">
        <form data-post-id="{{postid}}" id="inpage-reply-{{postid}}" data-content="inpage-reply-form" action="{{{reply_url}}}">
            <div class="row pb-1">
                <div class="w-100">
                    <textarea rows="5" name="post" title="post" class="form-control" placeholder="{{#str}} replyplaceholder, forum {{/str}}"></textarea>
                    <input type="hidden" name="postformat" value="{{postformat}}"/>
                </div>
                <input type="hidden" name="subject" value="{{parentsubject}}"/>
                <input type="hidden" name="reply" value="{{postid}}"/>
                <input type="hidden" name="sesskey" value="{{sesskey}}"/>
            </div>
            <div class="d-sm-block d-md-inline-flex justify-content-between align-items-center w-100 mb-4">
                <div class="d-sm-block d-md-inline-flex align-items-center">
                    <button class="btn btn-primary mt-sm-2 mt-md-0 mr-1" title="{{#str}} submit, core {{/str}}" data-action="forum-inpage-submit">
                        <span data-region="submit-text">{{#str}} submit, core {{/str}}</span>
                        <span data-region="loading-icon-container" class="hidden">{{> core/loading }}</span>
                    </button>
                    <button class="btn btn-secondary mt-sm-2 mt-md-0" title="{{#str}} cancel, core {{/str}}" data-action="collapsible-link">
                        {{#str}} cancel, core {{/str}}
                    </button>
                    {{#canreplyprivately}}
                    <div class="mt-sm-2 mt-md-0 ml-4 form-check form-check-inline">

                        <label class="custom-control ios-switch mb-0">
                            <input type="checkbox" class="ios-switch-control-input form-check-input" id="private-reply-checkbox-{{uniqid}}" title="{{#str}} privatereply, forum {{/str}}" name="privatereply"/>
                            <span class="ios-switch-control-indicator"></span>
                            <label class="form-check-label" for="private-reply-checkbox-{{uniqid}}">{{#str}} privatereply, forum {{/str}}</label>
                        </label>

                    </div>
                    {{/canreplyprivately}}
                </div>

                <button title="{{#str}} advanced, core {{/str}}" data-action="forum-advanced-reply" class="forum-advanced-btn badge badge-light badge-link border-0 float-right" type="submit">
                    <i class="fas fa-pencil-ruler mr-1"></i> {{#str}} advanced, core {{/str}}
                </button>
            </div>
        </form>
    </div>
</div>
