From c8f720f05b2fa5d0716add636d4c51ad768dde53 Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Sat, 2 Mar 2024 03:03:25 -0500 Subject: [PATCH] Searched posts show up as a CatalogGrid - but not many posts have an attachment, so I might have to fix things --- src/Component/CatalogGrid.hs | 2 +- src/Main.hs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Component/CatalogGrid.hs b/src/Component/CatalogGrid.hs index 720b288..d100177 100644 --- a/src/Component/CatalogGrid.hs +++ b/src/Component/CatalogGrid.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} module Component.CatalogGrid -( Model +( Model (..) , initialModel , Action (..) , Interface (..) diff --git a/src/Main.hs b/src/Main.hs index 7900cd1..05b9207 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -52,6 +52,7 @@ import qualified Component.CatalogGrid as Grid import qualified Component.ThreadView as Thread import qualified Component.TimeControl as TC import qualified Component.Search as Search +import qualified Component.Search.SearchTypes as Search data Model = Model @@ -211,7 +212,17 @@ mainView model = view (thread_model m) search_view :: Maybe Text -> Model -> View Action - search_view _ _ = div_ [] [ text "Search results" ] + search_view _ m = div_ [] + [ div_ + [ class_ "page_heading" ] + [ h1_ [] [ text "Search" ] + , time_ [] [ text $ Search.searchTerm $ search_model m ] + ] + , Search.view iSearch (search_model m) + , Grid.view iGrid $ (grid_model model) + { Grid.display_items = (Search.displayResults (search_model m)) + } + ] page404 :: View Action page404 = h1_ [] [ text "404 Not Found" ]