@model EditForumPostModel
@using Nop.Core.Domain.Forums;
@{
    //page class
    NopHtml.AppendPageCssClassParts("html-forum-edit-page");
}
@await Component.InvokeAsync(typeof(ForumBreadcrumbViewComponent), new { forumTopicId = Model.ForumTopicId })
<div class="page forum-edit-page">
    <div class="page-title panel-heading">
        @if (Model.IsEdit)
        {
            <h1>@T("Forum.EditPost")</h1>
        }
        else
        {
            <h1>@T("Forum.NewPost")</h1>
        }
    </div>
    <div class="page-body">
        <div asp-validation-summary="ModelOnly" class="message-error"></div>
        <input type="hidden" asp-for="Id" />
        <input type="hidden" asp-for="ForumTopicId" />
        <div class="form-fields form-horizontal">
            <fieldset>
                <div class="form-group">
                    <label class="forum-subject-title control-label col-xs-12 col-sm-2 col-md-2">@T("Forum.ForumName"):</label>
                    <div class="col-xs-12 col-sm-6 col-md-6">
                        <strong class="forum-subject-name">@Model.ForumName</strong>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label topic-title-text col-xs-12 col-sm-2 col-md-2">@T("Forum.TopicTitle"):</label>
                    <span class="col-xs-12 col-sm-6 col-md-6">@Model.ForumTopicSubject</span>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-md-offset-2 col-sm-6 col-md-6">
                        @if (Model.ForumEditor == EditorType.BBCodeEditor)
                        {
                            <nop-bb-code-editor asp-for="Text" />
                        }
                        <textarea asp-for="Text" class="forum-post-text form-control"></textarea>
                        <span asp-validation-for="Text"></span>
                    </div>
                </div>
                @if (Model.IsCustomerAllowedToSubscribe)
                {
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-6 col-md-offset-2 col-md-6">
                            <label class="checkbox options-checkbox">
                                <input asp-for="Subscribed" />
                                <span asp-for="Subscribed">@T("Forum.NotifyWhenSomeonePostsInThisTopic")</span>
                            </label>
                        </div>
                    </div>
                }
                @if (Model.DisplayCaptcha)
                {
                    <div class="form-group">
                        <div class="captcha-box col-sm-offset-2 col-md-offset-2 col-sm-6 col-md-6">
                            <nop-captcha />
                        </div>
                    </div>
                }
                <div class="form-group form-submit">
                    <div class="col-sm-offset-2 col-md-offset-2 col-sm-6 col-md-6 submit-option">
                        <button type="submit" class="btn btn-primary submit-post-button">@T("Forum.Submit")</button>
                        <button type="button" class="btn btn-default cancel-post-button" onclick="setLocation('@Url.RouteUrl("TopicSlug", new { id = Model.ForumTopicId, slug = Model.ForumTopicSeName })')">@T("Forum.Cancel")</button>
                    </div>
                </div>
            </fieldset>
        </div>        
    </div>
</div>
