Use submission.hamlet, again

Fixes #87
This commit is contained in:
Gregor Kleen 2018-07-02 09:04:31 +02:00
parent 31935c0182
commit d1aca43b2a
2 changed files with 15 additions and 67 deletions

View File

@ -232,8 +232,6 @@ submissionHelper tid csh shn (SubmissionMode mcid) = do
mArCid <- fmap ZIPArchiveName <$> traverse encrypt msmid
let pageTitle = MsgSubmissionEditHead tid csh shn
let formTitle = pageTitle
let formText = Nothing :: Maybe UniWorXMessage
actionUrl <- Data.Maybe.fromJust <$> getCurrentRoute
-- Maybe construct a table to display uploaded archive files
@ -261,19 +259,8 @@ submissionHelper tid csh shn (SubmissionMode mcid) = do
mFileTable <- traverse (dbTable def) . fmap smid2ArchiveTable $ (,) <$> msmid <*> mcid
defaultLayout $ do
setTitleI pageTitle
$(widgetFile "formPageI18n")
[whamlet|
$maybe arCid <- mArCid
<hr>
<h2>
<a href=@{CSheetR tid csh shn (SubmissionDownloadArchiveR arCid)}>Archiv
$forall (name,time) <- lastEdits
<div>last edited by #{name} at #{formatTimeGerDTlong time}
$maybe fileTable <- mFileTable
<h3>Enthaltene Dateien:
^{fileTable}
|]
setTitleI $ MsgSubmissionEditHead tid csh shn
$(widgetFile "submission")
getSubmissionDownloadSingleR :: TermId -> Text -> Text -> CryptoFileNameSubmission -> FilePath -> Handler TypedContent

View File

@ -1,54 +1,15 @@
<pre style="display:none">
#{tshow submissionId}
#{tshow submission}
$maybe arCid <- mArCid
<sec>
<h2>
<a href=@{CSheetR tid csh shn (SubmissionDownloadArchiveR arCid)}>Archiv
$forall (name,time) <- lastEdits
<div>last edited by #{name} at #{formatTimeGerDTlong time}
$maybe fileTable <- mFileTable
<h3>Enthaltene Dateien:
^{fileTable}
<table .table .table-striped>
$maybe ratingTime' <- ratingTime
<tr>
<td>Bewertet
<td>#{tshow ratingTime'}
$maybe points <- ratingPoints
<tr>
<td>Punkte
<td>#{tshow points}
$maybe comment <- ratingComment
<tr>
<td>Kommentar
<td>
<pre style="margin-bottom:0">#{comment}
$nothing
<tr>
<td colspan="2">Noch nicht bewertet
<hr>
<div .container-fluid>
<div .row>
<div .col-md-6>
<div .panel .panel-default>
<div .panel-heading>
Abgabe herunterladen
<div .panel-body .text-center>
$#<a href=@{SubmissionDownloadArchiveR archiveName} download .btn .btn-lg .btn-default>
<span .glyphicon .glyphicon-cloud-download aria-hidden="true"> ZIP-Archive
<div .col-md-6>
<div .panel .panel-default>
<div .panel-heading>
Abgabe ersetzen
<form role=form method=post action=@{SubmissionDemoR cID} enctype=#{uploadEnctype} .panel-body>
^{uploadWidget}
<div .panel .panel-default>
<div .panel-heading>
Abgegebene Dateien
<div .list-group .panel-body>
$forall (Entity _ file, Entity _ sFile) <- files
$if submissionFileIsDeletion sFile
<span .list-group-item>
#{fileTitle file}&nbsp;
<span .label .label-warning>Gelöscht
$else
<a href=@{SubmissionDownloadSingleR cID' $ fileTitle file} download .list-group-item>
#{fileTitle file}
$if submissionFileIsUpdate sFile
&nbsp;
<span .label .label-primary>Korrigiert
<sec>
<form .form-horizontal method=post action=@{actionUrl} enctype=#{formEnctype}>
^{formWidget}