getLists :: Text -> Text -> Bool -> Bool -> HandlerT App IO Html
getLists category username doFilter showComplete = do
  lists <- runDB $ selectList (if doFilter then [ListOwner ==. username, ListCategory ==. category] else [ListCategory ==. category]) [Desc ListId]
  (newListForm, enctype) <- generateFormPost $ renderBootstrap3 BootstrapInlineForm (listForm category username)
  users <- runDB $ selectList [] [Asc UserName]
  let filterName = if doFilter then username else "All"
  let pageName = T.unpack $ "Lists"
  let postRoute = ListsR
  lists' <- mapM getCompletionValue lists
  let lists2 = if showComplete then lists' else filter filterCompletesOut lists'
  cats <- runDB $ selectList [] [Desc ListId]
  let categories = L.nubBy (\(Entity _ x) (Entity _ y) -> listCategory x == listCategory y) cats
  defaultLayout $ do
    setTitle "Lists"
    $(widgetFile "lists")
getLists :: Text -> Text -> Bool -> Bool -> HandlerT App IO Html
getLists category username doFilter showComplete = do
  lists <- runDB $ selectList (if doFilter then [ListOwner ==. username, ListCategory ==. category] else [ListCategory ==. category]) [Desc ListId]
  (newListForm, enctype) <- generateFormPost $ renderBootstrap3 BootstrapInlineForm (listForm category username)
  users <- runDB $ selectList [] [Asc UserName]
  let filterName = if doFilter then username else "All"
  let pageName = T.unpack $ "Lists"
  let postRoute = ListsR
  lists' <- mapM getCompletionValue lists
  let lists2 = if showComplete then lists' else filter filterCompletesOut lists'
  cats <- runDB $ selectList [] [Desc ListId]
  let categories = L.nubBy (\(Entity _ x) (Entity _ y) -> listCategory x == listCategory y) cats
  defaultLayout $ do
    setTitle "Lists"
    $(widgetFile "lists")
getLists category username doFilter showComplete = do
  lists <- runDB $ selectList (if doFilter then [ListOwner ==. username, ListCategory ==. category] else [ListCategory ==. category]) [Desc ListId]
  (newListForm, enctype) <- generateFormPost $ renderBootstrap3 BootstrapInlineForm (listForm category username)
  users <- runDB $ selectList [] [Asc UserName]
  let filterName = if doFilter then username else "All"
  let pageName = T.unpack $ "Lists"
  let postRoute = ListsR
  lists' <- mapM getCompletionValue lists
  let lists2 = if showComplete then lists' else filter filterCompletesOut lists'
  cats <- runDB $ selectList [] [Desc ListId]
  let categories = L.nubBy (\(Entity _ x) (Entity _ y) -> listCategory x == listCategory y) cats
  defaultLayout $ do
    setTitle "Lists"
    $(widgetFile "lists")