More aggressively normalise fileTitles
This commit is contained in:
parent
0d01ac95ab
commit
957f0fe9da
@ -242,8 +242,11 @@ submissionHelper tid csh shn (SubmissionMode mcid) = do
|
|||||||
let colonnadeFiles :: _ -> Colonnade Sortable _ (DBCell (WidgetT UniWorX IO) ())
|
let colonnadeFiles :: _ -> Colonnade Sortable _ (DBCell (WidgetT UniWorX IO) ())
|
||||||
colonnadeFiles cid = mconcat
|
colonnadeFiles cid = mconcat
|
||||||
-- [ sortable (Just "type") "Typ" $ \(_,_, E.Value ftype) -> textCell $ toPathPiece ftype
|
-- [ sortable (Just "type") "Typ" $ \(_,_, E.Value ftype) -> textCell $ toPathPiece ftype
|
||||||
[ sortable (Just "path") "Dateiname" $ anchorCell (\(Entity _ SubmissionFile{..}, Entity _ File{..}) -> CSubmissionR tid csh shn cid $ SubDownloadR (isUpdateSubmissionFileType submissionFileIsUpdate) fileTitle)
|
[ sortable (Just "path") "Dateiname" $ \input@(_, Entity _ File{..}) -> case isNothing fileContent of
|
||||||
(\(_, Entity _ File{..}) -> str2widget fileTitle)
|
False -> anchorCell (\(Entity _ SubmissionFile{..}, Entity _ File{..}) -> CSubmissionR tid csh shn cid $ SubDownloadR (isUpdateSubmissionFileType submissionFileIsUpdate) fileTitle)
|
||||||
|
(\(_, Entity _ File{..}) -> str2widget fileTitle)
|
||||||
|
input
|
||||||
|
True -> textCell $ addTrailingPathSeparator fileTitle
|
||||||
, sortable (Just "time") "Modifikation" $ \(_, Entity _ File{..}) -> stringCell $ formatTimeGerWDT fileModified
|
, sortable (Just "time") "Modifikation" $ \(_, Entity _ File{..}) -> stringCell $ formatTimeGerWDT fileModified
|
||||||
]
|
]
|
||||||
smid2ArchiveTable (smid,cid) = DBTable
|
smid2ArchiveTable (smid,cid) = DBTable
|
||||||
|
|||||||
@ -56,7 +56,7 @@ consumeZip = unZipStream `fuseUpstream` consumeZip'
|
|||||||
Just (Left ZipEntry{..}) -> do
|
Just (Left ZipEntry{..}) -> do
|
||||||
contentChunks <- toConsumer accContents
|
contentChunks <- toConsumer accContents
|
||||||
let
|
let
|
||||||
fileTitle = normalise $ makeValid zipEntryName
|
fileTitle = dropWhile isPathSeparator . dropTrailingPathSeparator . normalise $ makeValid zipEntryName
|
||||||
fileModified = localTimeToUTC utc zipEntryTime
|
fileModified = localTimeToUTC utc zipEntryTime
|
||||||
fileContent
|
fileContent
|
||||||
| hasTrailingPathSeparator zipEntryName = Nothing
|
| hasTrailingPathSeparator zipEntryName = Nothing
|
||||||
|
|||||||
Reference in New Issue
Block a user