Skip to content

Commit

Permalink
Added for ability to compile
Browse files Browse the repository at this point in the history
  • Loading branch information
The1Penguin committed Sep 27, 2023
1 parent e59eda0 commit 1958117
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
16 changes: 8 additions & 8 deletions mat-chalmers.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ library
, exceptions == 0.10.4
, heredoc == 0.2.0.0
, http-client
, http-client-tls
, logging-effect
, http-client-tls >= 0.3.5.3
, logging-effect >= 1.3.12
, microlens-platform
, lucid >= 2
, mtl == 2.2.2
, old-locale == 1.0.0.7
, prettyprinter == 1.7.1
, safe == 0.3.19
, tagsoup == 0.14.8
, text
, bytestring
, text >= 1.2.4.1
, bytestring >= 0.10.12.0
, file-embed
, thyme
, word8 == 0.1.3
Expand All @@ -58,12 +58,12 @@ executable mat-chalmers
, base >= 4.7
, bytestring
, file-embed
, http-client-tls
, http-client-tls >= 0.3.5.3
, microlens-platform
, logging-effect
, mtl
, scotty
, time
, time >= 1.9.3
, wai-extra
, wai-middleware-static-embedded == 0.1.0.0
, async >= 2.1.1
Expand All @@ -77,7 +77,7 @@ Test-Suite test-mat
build-depends: base >= 4.7
, bytestring
, mat-chalmers
, hspec
, hspec >= 2.7.10
, HUnit == 1.6.2.0
, text
, thyme
, thyme >= 0.3.5.5
21 changes: 11 additions & 10 deletions src/View.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings, TemplateHaskell, RecordWildCards #-}

module View
( View(..)
Expand All @@ -9,16 +7,19 @@ module View
where

import Data.FileEmbed
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.Builder as T
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.Builder as T
import Data.Thyme
import Lens.Micro.Platform (both, (%~), (&))
import Lens.Micro.Platform ( (&)
, (%~)
, both
)
import Lucid
import qualified Text.CSS.Parse as CSS
import qualified Text.CSS.Render as CSS
import qualified Text.CSS.Parse as CSS
import qualified Text.CSS.Render as CSS

import Model
import Model.Types (NoMenu (..))
import Model.Types ( NoMenu(..) )

render :: View -> T.Text
render v = renderText (renderView v)
Expand All @@ -44,7 +45,7 @@ renderView View {..} = doctypehtml_ $ do

renderRest :: Restaurant -> Html ()
renderRest Restaurant {..} = box_ $ do
h2_ (toHtml name >> " " >> a_ [href_ (T.toStrict url)] "")
h2_ (toHtml name >> " " >> a_ [href_ (T.toStrict url)] "")
ul_ [class_ "food-menu"] $ case menu of
Left NoLunch -> li_ "No lunch this day!"
Left _ -> li_ "Something went wrong, " <> a_
Expand Down

0 comments on commit 1958117

Please sign in to comment.