fix topnavs reports colour

zen-asset-hotfix
Thibault Duplessis 2020-10-13 08:00:35 +02:00
parent e8a41874c1
commit 857c0dfd30
2 changed files with 19 additions and 14 deletions

View File

@ -46,8 +46,11 @@ object Environment
def isChatPanicEnabled = env.chat.panic.enabled
def blockingReportMaxScore: Int =
env.report.api.maxScores.dmap(_.highest).awaitOrElse(50.millis, "nbReports", 0)
def blockingReportScores: (Int, Int, Int) = (
env.report.api.maxScores.dmap(_.highest).awaitOrElse(50.millis, "nbReports", 0),
env.report.scoreThresholdsSetting.get().mid,
env.report.scoreThresholdsSetting.get().high
)
val spinner: Frag = raw(
"""<div class="spinner"><svg viewBox="0 0 40 40"><circle cx=20 cy=20 r=18 fill="none"></circle></svg></div>"""

View File

@ -293,18 +293,20 @@ object layout {
private def reports(implicit ctx: Context) =
isGranted(_.SeeReport) option {
val score = blockingReportMaxScore
a(
cls := List(
"link data-count report-score link-center" -> true,
"report-score--high" -> (score > 50),
"report-score--low" -> (score <= 40)
),
title := "Moderation",
href := routes.Report.list(),
dataCount := score,
dataIcon := ""
)
blockingReportScores match {
case (score, mid, high) =>
a(
cls := List(
"link data-count report-score link-center" -> true,
"report-score--high" -> (score > high),
"report-score--low" -> (score <= mid)
),
title := "Moderation",
href := routes.Report.list(),
dataCount := score,
dataIcon := ""
)
}
}
private def teamRequests(implicit ctx: Context) =