Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

Forum.cshtml

@model ForumPageModel
@using Nop.Core.Domain.Forums
@using Nop.Services.Localization
@inject ILocalizationService localizationService
@{
    Layout = "_ColumnsOne";

    //title
    NopHtml.AddTitleParts(Model.Name);
    //page class
    NopHtml.AppendPageCssClassParts("html-forum-page");
}
@await Component.InvokeAsync(typeof(ForumBreadcrumbViewComponent), new { forumId = Model.Id }) @await Html.PartialAsync("_ForumHeader") @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.BoardsForumAfterHeader, additionalData = Model })
@if (Model.ForumFeedsEnabled) { @T("Forum.RSS") }

@Model.Name

@Model.Description

@Html.RouteLink(T("Forum.NewTopic").ToString(), "TopicCreate", new { id = Model.Id }, new { @class = "new-topic" }) @if (Model.IsCustomerAllowedToSubscribe) { @Model.WatchForumText }
@await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.BoardsForumTop, additionalData = Model }) @{ var pager = await Html.PagerAsync(new PagerModel(localizationService) { PageSize = Model.TopicPageSize, TotalRecords = Model.TopicTotalRecords, PageIndex = Model.TopicPageIndex, ShowTotalSummary = false, RouteActionName = "ForumSlugPaged", UseRouteLinks = true, RouteValues = new SlugRouteValues { Id = Model.Id, Slug = Model.SeName } }); } @if (!string.IsNullOrEmpty(await pager.RenderHtmlContentAsync())) {
@pager
}
@if (Model.ForumTopics.Count > 0) {
@if (Model.AllowPostVoting) { } @if (Model.AllowPostVoting) { } @foreach (var topic in @Model.ForumTopics) { var topicType = "post"; var topicText = string.Empty; switch (topic.ForumTopicType) { case ForumTopicType.Normal: topicType = "post"; break; case ForumTopicType.Sticky: topicType = "sticky"; topicText = $"[{T("Forum.Sticky")}]"; break; case ForumTopicType.Announcement: topicType = "announcement"; topicText = $"[{T("Forum.Announcement")}]"; break; default: topicType = "post"; break; } @if (Model.AllowPostVoting) { } }
@T("Forum.TopicTitle") @T("Forum.Replies") @T("Forum.Views") @T("Forum.Votes") @T("Forum.LatestPost")
@Html.RouteLink(topic.Subject, "TopicSlug", new { id = topic.Id, slug = topic.SeName }) @if (!string.IsNullOrEmpty(topicText)) { @topicText }
@if (topic.NumPosts > Model.PostsPageSize) {
@await Html.ForumTopicSmallPagerAsync(topic)
}
@if (topic.CustomerId > 0) { if (topic.AllowViewingProfiles) { @Html.RouteLink(topic.CustomerName, "CustomerProfile", new { Id = topic.CustomerId }) } else { @topic.CustomerName } }
@topic.NumReplies @topic.Views @topic.Votes @await Component.InvokeAsync(typeof(ForumLastPostViewComponent), new { forumPostId = topic.LastPostId, showTopic = false })
}
@if (!string.IsNullOrEmpty(await pager.RenderHtmlContentAsync())) {
@pager
} @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.BoardsForumBottom, additionalData = Model })