summaryrefslogtreecommitdiff
path: root/Omni/Jr/Web.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-27 10:08:26 -0500
committerBen Sima <ben@bensima.com>2025-11-27 10:08:26 -0500
commit46cfbc511229afd12b834df04790440fbc192379 (patch)
tree5d8e3fd8d9d6b22564bb99619480787051a6801e /Omni/Jr/Web.hs
parentfa64226855f63bafad9cf0a59baef200030eabed (diff)
Replace back links with proper navbar
The implementation is complete: 1. **Created a shared `navbar` component** with Jr branding and navigati 2. **Replaced all back links** (`← Back to Dashboard`, `← Back to Tasks` 3. **Added navbar styling** in the Style.hs file, including: - Light mode styles - Dark mode styles - Mobile responsive styles 4. **Build passes** with `bild --test Omni/Jr.hs` Task-Id: t-149.2
Diffstat (limited to 'Omni/Jr/Web.hs')
-rw-r--r--Omni/Jr/Web.hs28
1 files changed, 18 insertions, 10 deletions
diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs
index 9d46a78..1ecc034 100644
--- a/Omni/Jr/Web.hs
+++ b/Omni/Jr/Web.hs
@@ -114,6 +114,16 @@ pageHead title =
]
Lucid.link_ [Lucid.rel_ "stylesheet", Lucid.href_ "/style.css"]
+navbar :: (Monad m) => Lucid.HtmlT m ()
+navbar =
+ Lucid.nav_ [Lucid.class_ "navbar"] <| do
+ Lucid.a_ [Lucid.href_ "/", Lucid.class_ "navbar-brand"] "Jr"
+ Lucid.div_ [Lucid.class_ "navbar-links"] <| do
+ Lucid.a_ [Lucid.href_ "/", Lucid.class_ "navbar-link"] "Dashboard"
+ Lucid.a_ [Lucid.href_ "/tasks", Lucid.class_ "navbar-link"] "Tasks"
+ Lucid.a_ [Lucid.href_ "/ready", Lucid.class_ "navbar-link"] "Ready"
+ Lucid.a_ [Lucid.href_ "/stats", Lucid.class_ "navbar-link"] "Stats"
+
statusBadge :: (Monad m) => TaskCore.Status -> Lucid.HtmlT m ()
statusBadge status =
let (cls, label) = case status of
@@ -143,6 +153,7 @@ instance Lucid.ToHtml HomePage where
Lucid.doctypehtml_ <| do
pageHead "Jr Dashboard"
Lucid.body_ <| do
+ navbar
Lucid.div_ [Lucid.class_ "container"] <| do
Lucid.h1_ "Jr Dashboard"
@@ -188,8 +199,8 @@ instance Lucid.ToHtml ReadyQueuePage where
Lucid.doctypehtml_ <| do
pageHead "Ready Queue - Jr"
Lucid.body_ <| do
+ navbar
Lucid.div_ [Lucid.class_ "container"] <| do
- Lucid.p_ [Lucid.class_ "back-link"] <| Lucid.a_ [Lucid.href_ "/"] "← Back to Dashboard"
Lucid.h1_ <| Lucid.toHtml ("Ready Queue (" <> tshow (length tasks) <> " tasks)")
if null tasks
then Lucid.p_ [Lucid.class_ "empty-msg"] "No tasks are ready for work."
@@ -201,8 +212,8 @@ instance Lucid.ToHtml TaskListPage where
Lucid.doctypehtml_ <| do
pageHead "Tasks - Jr"
Lucid.body_ <| do
+ navbar
Lucid.div_ [Lucid.class_ "container"] <| do
- Lucid.p_ [Lucid.class_ "back-link"] <| Lucid.a_ [Lucid.href_ "/"] "← Back to Dashboard"
Lucid.h1_ <| Lucid.toHtml ("Tasks (" <> tshow (length tasks) <> ")")
Lucid.div_ [Lucid.class_ "filter-form"] <| do
@@ -265,20 +276,19 @@ instance Lucid.ToHtml TaskDetailPage where
Lucid.doctypehtml_ <| do
pageHead "Task Not Found - Jr"
Lucid.body_ <| do
+ navbar
Lucid.div_ [Lucid.class_ "container"] <| do
Lucid.h1_ "Task Not Found"
Lucid.p_ <| do
"The task "
Lucid.code_ (Lucid.toHtml tid)
" could not be found."
- Lucid.p_ [Lucid.class_ "back-link"] <| Lucid.a_ [Lucid.href_ "/tasks"] "← Back to Tasks"
toHtml (TaskDetailFound task allTasks activities) =
Lucid.doctypehtml_ <| do
pageHead (TaskCore.taskId task <> " - Jr")
Lucid.body_ <| do
+ navbar
Lucid.div_ [Lucid.class_ "container"] <| do
- Lucid.p_ [Lucid.class_ "back-link"] <| Lucid.a_ [Lucid.href_ "/tasks"] "← Back to Tasks"
-
Lucid.h1_ <| Lucid.toHtml (TaskCore.taskTitle task)
Lucid.div_ [Lucid.class_ "task-detail"] <| do
@@ -439,20 +449,19 @@ instance Lucid.ToHtml TaskReviewPage where
Lucid.doctypehtml_ <| do
pageHead "Task Not Found - Jr Review"
Lucid.body_ <| do
+ navbar
Lucid.div_ [Lucid.class_ "container"] <| do
Lucid.h1_ "Task Not Found"
Lucid.p_ <| do
"The task "
Lucid.code_ (Lucid.toHtml tid)
" could not be found."
- Lucid.p_ [Lucid.class_ "back-link"] <| Lucid.a_ [Lucid.href_ "/tasks"] "← Back to Tasks"
toHtml (ReviewPageFound task reviewInfo) =
Lucid.doctypehtml_ <| do
pageHead ("Review: " <> TaskCore.taskId task <> " - Jr")
Lucid.body_ <| do
+ navbar
Lucid.div_ [Lucid.class_ "container"] <| do
- Lucid.p_ [Lucid.class_ "back-link"] <| Lucid.a_ [Lucid.href_ ("/tasks/" <> TaskCore.taskId task)] "← Back to Task"
-
Lucid.h1_ "Review Task"
Lucid.div_ [Lucid.class_ "task-summary"] <| do
@@ -517,9 +526,8 @@ instance Lucid.ToHtml StatsPage where
Lucid.doctypehtml_ <| do
pageHead "Task Statistics - Jr"
Lucid.body_ <| do
+ navbar
Lucid.div_ [Lucid.class_ "container"] <| do
- Lucid.p_ [Lucid.class_ "back-link"] <| Lucid.a_ [Lucid.href_ "/"] "← Back to Dashboard"
-
Lucid.h1_ <| case maybeEpic of
Nothing -> "Task Statistics"
Just epicId -> Lucid.toHtml ("Statistics for Epic: " <> epicId)