show repo URL/branch

This commit is contained in:
Filip Gralinski 2015-09-28 17:45:10 +02:00
parent 2b13573881
commit f6dce92d8d
2 changed files with 7 additions and 3 deletions

View File

@ -13,7 +13,8 @@ import Handler.Shared
getShowChallengeR :: Text -> Handler Html
getShowChallengeR name = do
(Entity _ challenge) <- runDB $ getBy404 $ UniqueName name
challengeLayout True challenge (showChallengeWidget challenge)
Just repo <- runDB $ get $ challengePublicRepo challenge
challengeLayout True challenge (showChallengeWidget challenge repo)
getChallengeReadmeR :: Text -> Handler Html
getChallengeReadmeR name = do
@ -24,7 +25,7 @@ getChallengeReadmeR name = do
contents <- readFile readmeFilePath
challengeLayout False challenge $ toWidget $ markdown def $ TL.fromStrict contents
showChallengeWidget challenge = $(widgetFile "show-challenge")
showChallengeWidget challenge repo = $(widgetFile "show-challenge")
getChallengeSubmissionR :: Text -> Handler Html

View File

@ -1 +1,4 @@
<p>Raz dwa trzy
<p>Repo:
<tt> #{repoUrl repo}
\ Branch:
<tt> #{repoBranch repo}