Show current challenge version
This commit is contained in:
parent
f5c480205e
commit
80020ee404
@ -499,3 +499,8 @@ runSlackHook hook message = do
|
||||
slackLink :: App -> Text -> Text -> Text
|
||||
slackLink app title addr = "<" ++ slink ++ "|" ++ title ++ ">"
|
||||
where slink = (appRoot $ appSettings app) ++ "/" ++ addr
|
||||
|
||||
formatVersion :: (Int, Int, Int) -> Text
|
||||
formatVersion (major, minor, patch) = (T.pack $ show major)
|
||||
<> "." <> (T.pack $ show minor)
|
||||
<> "." <> (T.pack $ show patch)
|
||||
|
@ -749,6 +749,9 @@ challengeLayout :: Bool -> Challenge -> WidgetFor App () -> HandlerFor App Html
|
||||
challengeLayout withHeader challenge widget = do
|
||||
tagsAvailableAsJSON <- runDB $ getAvailableTagsAsJSON
|
||||
version <- runDB $ getBy404 $ UniqueVersionByCommit $ challengeVersion challenge
|
||||
let versionFormatted = formatVersion ((versionMajor $ entityVal version),
|
||||
(versionMinor $ entityVal version),
|
||||
(versionPatch $ entityVal version))
|
||||
maybeUser <- maybeAuth
|
||||
bc <- widgetToPageContent widget
|
||||
defaultLayout $ do
|
||||
|
@ -59,9 +59,6 @@ data TableEntry = TableEntry {
|
||||
tableEntryStamp :: TableEntry -> UTCTime
|
||||
tableEntryStamp = submissionStamp . entityVal . tableEntrySubmission
|
||||
|
||||
formatVersion :: (Int, Int, Int) -> Text
|
||||
formatVersion (major, minor, patch) = (Data.Text.pack $ show major) <> "." <> (Data.Text.pack $ show minor) <> "." <> (Data.Text.pack $ show patch)
|
||||
|
||||
submissionsTable :: Maybe UserId -> Text -> RepoScheme -> Repo -> [Entity Test] -> Table App TableEntry
|
||||
submissionsTable mauthId challengeName repoScheme challengeRepo tests = mempty
|
||||
++ Table.int "#" tableEntryRank
|
||||
|
@ -15,7 +15,7 @@
|
||||
<div class="panel-body">
|
||||
$if withHeader
|
||||
<h1>#{challengeTitle challenge}
|
||||
<p>#{challengeDescription challenge}
|
||||
<p>#{challengeDescription challenge} [ver. #{versionFormatted}]
|
||||
$maybe deadline <- versionDeadline $ entityVal version
|
||||
<p>Deadline: #{show deadline}
|
||||
$nothing
|
||||
|
Loading…
Reference in New Issue
Block a user