summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/HtmlOrphans.hs24
1 files changed, 16 insertions, 8 deletions
diff --git a/server/HtmlOrphans.hs b/server/HtmlOrphans.hs
index c6f74d5..bf06d4c 100644
--- a/server/HtmlOrphans.hs
+++ b/server/HtmlOrphans.hs
@@ -131,6 +131,11 @@ badge level = span_ [class_ badgetype]
Error -> "badge badge-danger"
Fatal -> "badge badge-danger"
+-- | pseudo-level badge when we don't even have an info lint
+-- (rare, but it does happen!)
+badgeHurray :: Monad m => HtmlT m() -> HtmlT m ()
+badgeHurray = span_ [class_ "badge badge-success"]
+
-- | Lint Levels directly render into badges
instance ToHtml Level where
toHtml level = do badge level (show level); " "
@@ -216,14 +221,17 @@ instance ToHtml (Org True, RemoteRef, DirResult a) where
h2_ "Maps"
flip M.foldMapWithKey dirresultMaps $ \name MapResult { .. } -> do
h3_ (toHtml name)
- ul_ $ forM_ mapresultGeneral $ \lint ->
- li_ (toHtml lint)
- unless (null mapresultLayer) $ do
- h4_ "Layers"
- ul_ (listMapWithKey mapresultLayer)
- unless (null mapresultTileset) $ do
- h4_ "Tilesets"
- ul_ (listMapWithKey mapresultTileset)
+ if null mapresultGeneral && null mapresultLayer && null mapresultTileset
+ then ul_ $ li_ $ badgeHurray "All good!"
+ else do
+ ul_ $ forM_ mapresultGeneral $ \lint ->
+ li_ (toHtml lint)
+ unless (null mapresultLayer) $ do
+ h4_ "Layers"
+ ul_ (listMapWithKey mapresultLayer)
+ unless (null mapresultTileset) $ do
+ h4_ "Tilesets"
+ ul_ (listMapWithKey mapresultTileset)
where
maxlevel = maximumLintLevel res