OUR-238 Disabled forums still show create button and no notification

#OUR-238 Fixed
This commit is contained in:
Sebastiaan Janssen
2015-06-24 13:43:04 +02:00
parent 432c00f027
commit bf586d5ff8
3 changed files with 24 additions and 3 deletions
@@ -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();
+5
View File
@@ -157,5 +157,10 @@ namespace uForum.Extensions
return memberRoles;
}
public static bool NewTopicsAllowed(this IPublishedContent forum)
{
return forum.Level <= 3 || forum.GetPropertyValue<bool>("forumAllowNewTopics");
}
}
}