OUR-238 Disabled forums still show create button and no notification
#OUR-238 Fixed
This commit is contained in:
@@ -44,6 +44,18 @@
|
||||
|
||||
var pages = (totalTopics / pageSize) + 1;
|
||||
}
|
||||
@if (Model.Content.NewTopicsAllowed() == false)
|
||||
{
|
||||
var notification = Model.Content.GetPropertyValue<string>("mainNotification");
|
||||
if (string.IsNullOrWhiteSpace(notification))
|
||||
{
|
||||
notification = "Creating new topics is not allowed here";
|
||||
}
|
||||
|
||||
<div class="alertbar__yellow">
|
||||
@Html.Raw(notification)
|
||||
</div>
|
||||
}
|
||||
<!-- FORUM HEADER START -->
|
||||
<div class="forum-archive-header">
|
||||
<!-- FORUM BREADCRUMB START -->
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
@using uForum.Extensions
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
|
||||
@if (Members.IsLoggedIn())
|
||||
{
|
||||
<a href="#" class="button create-new-thread" data-controller="topic">
|
||||
<i class="icon-Add"></i><span>Create new</span>
|
||||
</a>
|
||||
if (Model.Content.NewTopicsAllowed())
|
||||
{
|
||||
<a href="#" class="button create-new-thread" data-controller="topic">
|
||||
<i class="icon-Add"></i><span>Create new</span>
|
||||
</a>
|
||||
}
|
||||
|
||||
var mem = Members.GetCurrentMember();
|
||||
|
||||
|
||||
@@ -157,5 +157,10 @@ namespace uForum.Extensions
|
||||
|
||||
return memberRoles;
|
||||
}
|
||||
|
||||
public static bool NewTopicsAllowed(this IPublishedContent forum)
|
||||
{
|
||||
return forum.Level <= 3 || forum.GetPropertyValue<bool>("forumAllowNewTopics");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user