Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Perf/Web/Foundation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Perf.Types.Prim

mkYesodData "App" [parseRoutes|
/ HomeR GET
/branches BranchesR GET
/branch/#Text BranchR GET
/branch/#Text/#Hash BranchCommitR GET
/commit/#Hash CommitR GET
Expand All @@ -25,7 +26,8 @@ instance YesodBreadcrumbs App where
breadcrumb r =
case r of
HomeR -> return ("Home",Nothing)
BranchR name -> return (name, Just HomeR)
BranchesR -> return ("Branches",Just HomeR)
BranchR name -> return (name, Just BranchesR)
CommitR hash -> return (coerce hash, Just HomeR)
CompareCommitsR hash0 hash1 ->
let short x = T.take 8 $ coerce x
Expand Down
7 changes: 5 additions & 2 deletions src/Perf/Web/Routes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ import RIO qualified
import Data.Foldable
import Yesod hiding (toHtml, Html)

getHomeR :: Handler (Html ())
getHomeR = do
getHomeR :: Handler ()
getHomeR = redirect $ BranchR "master"

getBranchesR :: Handler (Html ())
getBranchesR = do
master <- db $ selectList @DB.Branch [DB.BranchName ==. "master"] []
branches <- fmap (List.filter (not . T.isPrefixOf "gh-readonly-queue/" . (.entityVal.branchName))) $
db $ selectList @DB.Branch [DB.BranchName !=. "master"] [Desc DB.BranchCreatedAt]
Expand Down