diff --git a/app/templating/MessageHelper.scala b/app/templating/MessageHelper.scala
index 10999a4802..bb62744cad 100644
--- a/app/templating/MessageHelper.scala
+++ b/app/templating/MessageHelper.scala
@@ -2,10 +2,14 @@ package lila.app
package templating
import lila.message.Env.{ current ⇒ messageEnv }
+import lila.report.Env.{ current ⇒ reportEnv }
import lila.user.Context
-trait MessageHelper {
+trait MessageHelper { self: SecurityHelper =>
def messageNbUnread(ctx: Context): Int =
ctx.me.??(user ⇒ messageEnv.api.unreadIds(user.id).await.size)
+
+ def reportNbUnprocessed(implicit ctx: Context): Int =
+ isGranted(_.SeeReport) ?? reportEnv.api.nbUnprocessed.await
}
diff --git a/app/views/base/layout.scala.html b/app/views/base/layout.scala.html
index 2509bbfd43..849b735202 100644
--- a/app/views/base/layout.scala.html
+++ b/app/views/base/layout.scala.html
@@ -72,6 +72,11 @@ data-accept-languages="@acceptLanguages.mkString(",")">
}
}
}
+ @defining(reportNbUnprocessed) { nb =>
+ @if(nb > 0) {
+ Report (@nb)
+ }
+ }
@trans.nbConnectedPlayers("?")
diff --git a/app/views/forum/layout.scala.html b/app/views/forum/layout.scala.html
index f31274d0fe..ee1c65b691 100644
--- a/app/views/forum/layout.scala.html
+++ b/app/views/forum/layout.scala.html
@@ -1,4 +1,4 @@
-@(title: String, searchText: String = "", moreJs: Html = Html(""))(body: Html)(implicit ctx: Context)
+@(title: String, searchText: String = "", goodies: Option[Html] = None, moreJs: Html = Html(""))(body: Html)(implicit ctx: Context)
@moreCss = {
@cssTag("forum.css")
@@ -11,6 +11,7 @@
@base.layout(
title = title,
+goodies = goodies,
moreCss = moreCss,
moreJs = forumJs,
active = siteMenu.forum.some) {
diff --git a/app/views/forum/topic/form.scala.html b/app/views/forum/topic/form.scala.html
index 1691c71785..26968028a4 100644
--- a/app/views/forum/topic/form.scala.html
+++ b/app/views/forum/topic/form.scala.html
@@ -1,7 +1,11 @@
@(categ: lila.forum.Categ, form: Form[_], captcha: lila.common.Captcha)(implicit ctx: Context)
-@forum.layout(
-title = "New forum topic") {
+@goodies = {
+
+@report.speech(true)
+}
+
+@forum.layout(title = "New forum topic", goodies = goodies.some) {
- Forum
@categ.name
diff --git a/app/views/report/form.scala.html b/app/views/report/form.scala.html
index 9b69075d48..78670420d6 100644
--- a/app/views/report/form.scala.html
+++ b/app/views/report/form.scala.html
@@ -4,7 +4,12 @@
@title = @{ "Report a user" }
-@site.layout(title = title, moreCss = cssTag("report.css")) {
+@goodies = {
+
+@report.speech(false)
+}
+
+@site.layout(title = title, moreCss = cssTag("report.css"), goodies = goodies.some) {