From 388c9a5b285fb4f75684594666d3a504210dda77 Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Fri, 9 Feb 2024 04:18:16 -0500 Subject: [PATCH] Show name and post number in post intro - still missing accurate links, timestamp --- src/Component/Thread/Intro.hs | 11 ++++++++--- src/Component/ThreadView.hs | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Component/Thread/Intro.hs b/src/Component/Thread/Intro.hs index 5b6bfbb..ece0950 100644 --- a/src/Component/Thread/Intro.hs +++ b/src/Component/Thread/Intro.hs @@ -26,9 +26,11 @@ intro :: Post -> View a intro post = span_ [ class_ "intro" ] ( subject ++ - [ span_ - [ class_ "name" ][ "Anonymous" ] + [ " " + , span_ + [ class_ "name" ][ text name ] -- TODO: Add flags (don't have that data in the db yet) + , " " , time_ [ textProp "datetime" "2024-01-19T11:53:33Z" , textProp "data-local" "true" @@ -43,7 +45,7 @@ intro post = span_ , a_ [ class_ "post_no" , href_ "/leftypol/res/477700.html#q477700" - ][ "477700" ] + ][ text $ toMisoString $ show $ Post.board_post_id post ] ] ) @@ -51,6 +53,9 @@ intro post = span_ subject :: [ View a ] subject = map (mkSubject . toMisoString) $ toList $ Post.subject post + name :: JSString + name = maybe "Anonymous" toMisoString $ Post.name post + mkSubject :: JSString -> View a mkSubject s = span_ [ class_ "subject" ] diff --git a/src/Component/ThreadView.hs b/src/Component/ThreadView.hs index 1aa40dc..76a83cc 100644 --- a/src/Component/ThreadView.hs +++ b/src/Component/ThreadView.hs @@ -35,6 +35,7 @@ import qualified Network.BoardType as Board import qualified Network.ThreadType as Thread import Component.Thread.Files (files) import Component.Thread.Intro (intro) +import BodyParser data Model = Model { site :: Site