forked from filipg/gonito
Refactor showing a specific submission
This commit is contained in:
parent
4ba7ae2212
commit
48119428fe
@ -110,9 +110,10 @@ resultTable (Entity submissionId submission) = do
|
|||||||
|
|
||||||
$(widgetFile "result-table")
|
$(widgetFile "result-table")
|
||||||
|
|
||||||
queryResult :: FullSubmissionInfo -> WidgetFor App ()
|
|
||||||
queryResult submission = do
|
submissionHeader :: FullSubmissionInfo -> WidgetFor App ()
|
||||||
$(widgetFile "query-result")
|
submissionHeader submission =
|
||||||
|
$(widgetFile "submission-header")
|
||||||
where commitSha1AsText = fromSHA1ToText $ submissionCommit $ fsiSubmission submission
|
where commitSha1AsText = fromSHA1ToText $ submissionCommit $ fsiSubmission submission
|
||||||
submitter = formatSubmitter $ fsiUser submission
|
submitter = formatSubmitter $ fsiUser submission
|
||||||
publicSubmissionBranch = getPublicSubmissionBranch $ fsiSubmissionId submission
|
publicSubmissionBranch = getPublicSubmissionBranch $ fsiSubmissionId submission
|
||||||
@ -120,5 +121,9 @@ queryResult submission = do
|
|||||||
browsableUrl = browsableGitRepoBranch (fsiScheme submission) (fsiChallengeRepo submission) (challengeName $ fsiChallenge submission) publicSubmissionBranch
|
browsableUrl = browsableGitRepoBranch (fsiScheme submission) (fsiChallengeRepo submission) (challengeName $ fsiChallenge submission) publicSubmissionBranch
|
||||||
stamp = T.pack $ show $ submissionStamp $ fsiSubmission submission
|
stamp = T.pack $ show $ submissionStamp $ fsiSubmission submission
|
||||||
|
|
||||||
|
queryResult :: FullSubmissionInfo -> WidgetFor App ()
|
||||||
|
queryResult submission = do
|
||||||
|
$(widgetFile "query-result")
|
||||||
|
|
||||||
queryForm :: Form Text
|
queryForm :: Form Text
|
||||||
queryForm = renderBootstrap3 BootstrapBasicForm $ areq textField (fieldSettingsLabel MsgGitCommitSha1) Nothing
|
queryForm = renderBootstrap3 BootstrapBasicForm $ areq textField (fieldSettingsLabel MsgGitCommitSha1) Nothing
|
||||||
|
@ -3,34 +3,7 @@
|
|||||||
<p class="media-object">
|
<p class="media-object">
|
||||||
<span class="glyphicon glyphicon-asterisk" aria-hidden="hidden">
|
<span class="glyphicon glyphicon-asterisk" aria-hidden="hidden">
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
<div class="media-heading">
|
^{submissionHeader submission}
|
||||||
<div .subm-commit>#{commitSha1AsText}
|
|
||||||
|
|
||||||
<div .subm-description>^{fragmentWithTags (submissionDescription $ fsiSubmission submission) (map fst $ fsiTags submission)}
|
|
||||||
<p> </p>
|
|
||||||
<dl class="dl-horizontal">
|
|
||||||
<dt>challenge
|
|
||||||
<dd><a href="@{ShowChallengeR $ challengeName $ fsiChallenge submission}">#{challengeTitle $ fsiChallenge submission}</a>
|
|
||||||
<dt>submitter
|
|
||||||
<dd>#{submitter}
|
|
||||||
<dt>submitted
|
|
||||||
<dd>#{stamp}
|
|
||||||
<dt>original repo
|
|
||||||
<dd><code>#{repoUrl $ fsiRepo submission}</code> / branch <code>#{repoBranch $ fsiRepo submission}</code>
|
|
||||||
$if submissionIsPublic $ fsiSubmission submission
|
|
||||||
<dt>publicly available at
|
|
||||||
<dd><code>#{publicSubmissionRepo}</code> / branch <code>#{publicSubmissionBranch}</code>
|
|
||||||
<dt>browsable at
|
|
||||||
<dd><a href="#{browsableUrl}">#{browsableUrl}</a>
|
|
||||||
<dt>clone by
|
|
||||||
<dd><code>git clone --single-branch #{publicSubmissionRepo} -b #{publicSubmissionBranch}</code>
|
|
||||||
$if not (null (fsiExternalLinks submission))
|
|
||||||
<dt>see also
|
|
||||||
<dd>
|
|
||||||
$forall (Entity _ externalLink) <- fsiExternalLinks submission
|
|
||||||
<a href="#{externalLinkUrl externalLink}">
|
|
||||||
#{fromMaybe (externalLinkUrl externalLink) (externalLinkTitle externalLink)}
|
|
||||||
<br>
|
|
||||||
^{resultTable (Entity (fsiSubmissionId submission) (fsiSubmission submission))}
|
^{resultTable (Entity (fsiSubmissionId submission) (fsiSubmission submission))}
|
||||||
|
|
||||||
$if not (null (fsiSuperSubmissions submission))
|
$if not (null (fsiSuperSubmissions submission))
|
||||||
|
28
templates/submission-header.hamlet
Normal file
28
templates/submission-header.hamlet
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<div class="media-heading">
|
||||||
|
<div .subm-commit>#{commitSha1AsText}
|
||||||
|
|
||||||
|
<div .subm-description>^{fragmentWithTags (submissionDescription $ fsiSubmission submission) (map fst $ fsiTags submission)}
|
||||||
|
<p> </p>
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt>challenge
|
||||||
|
<dd><a href="@{ShowChallengeR $ challengeName $ fsiChallenge submission}">#{challengeTitle $ fsiChallenge submission}</a>
|
||||||
|
<dt>submitter
|
||||||
|
<dd>#{submitter}
|
||||||
|
<dt>submitted
|
||||||
|
<dd>#{stamp}
|
||||||
|
<dt>original repo
|
||||||
|
<dd><code>#{repoUrl $ fsiRepo submission}</code> / branch <code>#{repoBranch $ fsiRepo submission}</code>
|
||||||
|
$if submissionIsPublic $ fsiSubmission submission
|
||||||
|
<dt>publicly available at
|
||||||
|
<dd><code>#{publicSubmissionRepo}</code> / branch <code>#{publicSubmissionBranch}</code>
|
||||||
|
<dt>browsable at
|
||||||
|
<dd><a href="#{browsableUrl}">#{browsableUrl}</a>
|
||||||
|
<dt>clone by
|
||||||
|
<dd><code>git clone --single-branch #{publicSubmissionRepo} -b #{publicSubmissionBranch}</code>
|
||||||
|
$if not (null (fsiExternalLinks submission))
|
||||||
|
<dt>see also
|
||||||
|
<dd>
|
||||||
|
$forall (Entity _ externalLink) <- fsiExternalLinks submission
|
||||||
|
<a href="#{externalLinkUrl externalLink}">
|
||||||
|
#{fromMaybe (externalLinkUrl externalLink) (externalLinkTitle externalLink)}
|
||||||
|
<br>
|
Loading…
Reference in New Issue
Block a user