Add a commit view route, nothing displayed yet

This commit is contained in:
fr33domlover 2018-05-17 15:46:57 +00:00
parent 8eca3fa647
commit ce89bded73
6 changed files with 16 additions and 5 deletions

View file

@ -77,6 +77,7 @@
/s/#ShrIdent/r/#RpIdent/s/+Texts RepoSourceR GET /s/#ShrIdent/r/#RpIdent/s/+Texts RepoSourceR GET
/s/#ShrIdent/r/#RpIdent/c RepoHeadChangesR GET /s/#ShrIdent/r/#RpIdent/c RepoHeadChangesR GET
/s/#ShrIdent/r/#RpIdent/c/#Text RepoChangesR GET /s/#ShrIdent/r/#RpIdent/c/#Text RepoChangesR GET
/s/#ShrIdent/r/#RpIdent/p/#Text RepoPatchR GET
/s/#ShrIdent/r/#RpIdent/d RepoDevsR GET POST /s/#ShrIdent/r/#RpIdent/d RepoDevsR GET POST
/s/#ShrIdent/r/#RpIdent/d/!new RepoDevNewR GET /s/#ShrIdent/r/#RpIdent/d/!new RepoDevNewR GET
/s/#ShrIdent/r/#RpIdent/d/#ShrIdent RepoDevR GET DELETE POST /s/#ShrIdent/r/#RpIdent/d/#ShrIdent RepoDevR GET DELETE POST

View file

@ -25,6 +25,7 @@ module Vervis.Handler.Repo
, getRepoSourceR , getRepoSourceR
, getRepoHeadChangesR , getRepoHeadChangesR
, getRepoChangesR , getRepoChangesR
, getRepoPatchR
, getRepoDevsR , getRepoDevsR
, postRepoDevsR , postRepoDevsR
, getRepoDevNewR , getRepoDevNewR
@ -258,6 +259,13 @@ getRepoChangesR shar repo ref = do
VCSDarcs -> getDarcsRepoChanges shar repo ref VCSDarcs -> getDarcsRepoChanges shar repo ref
VCSGit -> getGitRepoChanges shar repo ref VCSGit -> getGitRepoChanges shar repo ref
getRepoPatchR :: ShrIdent -> RpIdent -> Text -> Handler Html
getRepoPatchR shr rp ref = do
repository <- runDB $ selectRepo shr rp
case repoVcs repository of
VCSDarcs -> undefined -- getDarcsPatch shr rp ref
VCSGit -> undefined -- getGitRepoPatch shr rp ref
getRepoDevsR :: ShrIdent -> RpIdent -> Handler Html getRepoDevsR :: ShrIdent -> RpIdent -> Handler Html
getRepoDevsR shr rp = do getRepoDevsR shr rp = do
devs <- runDB $ do devs <- runDB $ do

View file

@ -86,7 +86,7 @@ getDarcsRepoHeadChanges shar repo = do
case mv of case mv of
Nothing -> notFound Nothing -> notFound
Just v -> return v Just v -> return v
let changes = changesW entries let changes = changesW shar repo entries
pageNav = navWidget navModel pageNav = navWidget navModel
feed = changeFeed shar repo Nothing VCSDarcs entries feed = changeFeed shar repo Nothing VCSDarcs entries
selectRep $ do selectRep $ do

View file

@ -100,7 +100,7 @@ getGitRepoChanges shar repo ref = do
(entries, navModel) <- getPageAndNav $ (entries, navModel) <- getPageAndNav $
\ o l -> liftIO $ G.readChangesView path ref o l \ o l -> liftIO $ G.readChangesView path ref o l
let refSelect = refSelectW shar repo branches tags let refSelect = refSelectW shar repo branches tags
changes = changesW entries changes = changesW shar repo entries
pageNav = navWidget navModel pageNav = navWidget navModel
feed = changeFeed shar repo (Just ref) VCSGit entries feed = changeFeed shar repo (Just ref) VCSGit entries
selectRep $ do selectRep $ do

View file

@ -34,5 +34,5 @@ import Vervis.Settings (widgetFile)
refSelectW :: ShrIdent -> RpIdent -> Set Text -> Set Text -> Widget refSelectW :: ShrIdent -> RpIdent -> Set Text -> Set Text -> Widget
refSelectW shar repo branches tags = $(widgetFile "repo/widget/ref-select") refSelectW shar repo branches tags = $(widgetFile "repo/widget/ref-select")
changesW :: Foldable f => f LogEntry -> Widget changesW :: Foldable f => ShrIdent -> RpIdent -> f LogEntry -> Widget
changesW entries = $(widgetFile "repo/widget/changes") changesW shr rp entries = $(widgetFile "repo/widget/changes")

View file

@ -21,6 +21,8 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
$forall LogEntry author hash message (_, time) <- entries $forall LogEntry author hash message (_, time) <- entries
<tr> <tr>
<td>#{author} <td>#{author}
<td .hash>#{T.take 10 hash} <td .hash>
<a href=@{RepoPatchR shr rp hash}>
#{T.take 10 hash}
<td>#{message} <td>#{message}
<td>#{time} <td>#{time}