module Web.View.GovernanceTemplates.Index where import Web.Types import Generated.Types import IHP.Prelude import IHP.ViewPrelude import Web.Routes () import Data.Aeson (Value(..), decode, encode) import qualified Data.ByteString.Lazy.Char8 as BL type TemplateIndexRow = (GovernanceTemplate, Int) data IndexView = IndexView { templates :: ![TemplateIndexRow] } instance View IndexView where html IndexView { .. } = [hsx|
Published reusable governance templates.
No published templates yet.
|] renderTemplateDesc :: Text -> Html renderTemplateDesc d = [hsx|{d}
|] renderCategoryTag :: Text -> Html renderCategoryTag cat = [hsx| {cat} |] jsonArrayTexts :: Value -> [Text] jsonArrayTexts val = case decode (encode val) of Just (arr :: [Text]) -> arr Nothing -> []