+ + +
Diese interne Seite dient lediglich zum Testen diverser Funktionalitäten und zur Demonstration der verschiedenen Hilfsfunktionen/Module. Der Handler sollte jeweils aktuelle Beispiele für alle möglichen Funktionalitäten enthalten, so dass man immer weiß, wo man nachschlagen kann. +
+
+
+ Kaufen Sie Tooltip-White für hellere Tooltips!
+ Den Tooltip-Handle sollte man immer setzen, damit es auch auf Mobilgeräten und ohne Javascript funktioniert.
+
_{MsgAssignSubmissionsRandomWarning}
\ No newline at end of file
diff --git a/templates/exam-users.hamlet b/templates/exam-users.hamlet
new file mode 100644
index 000000000..dea20c2a7
--- /dev/null
+++ b/templates/exam-users.hamlet
@@ -0,0 +1,2 @@
+$newline never
+^{examUsersTable}
diff --git a/templates/home/upcomingExams.hamlet b/templates/home/upcomingExams.hamlet
new file mode 100644
index 000000000..1bb40bb09
--- /dev/null
+++ b/templates/home/upcomingExams.hamlet
@@ -0,0 +1,7 @@
+$newline never
+Teilweise funktionierende Abschnitte
-
-
-
Tabelle zu Fuss
+
+
+ Kopf A
+ Kopf
+
+ B
+ C
+
+ 1
+ 2
+ 3
+
+
+
+ Kaufen Sie Tooltip-White für hellere Tooltips! (GEHT NICHT)
+ 4
+ 5
+
+ Kaufen Sie Tooltip-Black für dunklere Tooltips! (GEHT NICHT)
+ 6
+
+ 7
+ 8
+ 9
Funktionen zum Testen
diff --git a/templates/corrections-overview.hamlet b/templates/corrections-overview.hamlet
index 1636a1b9d..152ba73e5 100644
--- a/templates/corrections-overview.hamlet
+++ b/templates/corrections-overview.hamlet
@@ -17,30 +17,31 @@
_{MsgGenericMin}
_{MsgGenericAvg}
_{MsgGenericMax}
- $# Always iterate over sheetList for consistent sorting! Newest first, except in this table
- $forall (sheetName, CorrectionInfo{ciSubmittors, ciSubmissions, ciAssigned, ciCorrected, ciMin, ciTot, ciMax}) <- reverse sheetList
-
- ^{simpleLink (toWidget sheetName) (CSheetR tid ssh csh sheetName SSubsR)}
- $if groupsPossible
- #{ciSubmittors}
- #{ciSubmissions}
- $maybe ((splus,sfailed),_,_) <- Map.lookup sheetName assignment
- $if 0 < Set.size sfailed
- #{ciSubmissions - ciAssigned}
- (-#{show (Set.size splus)}, failed: #{show (Set.size sfailed)})
- $elseif 0 < Set.size splus
- #{ciSubmissions - ciAssigned}
- (-#{show (Set.size splus)})
- $else
+ $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table
+ $forall sheetName <- reverse orderedSheetNames
+ $maybe CorrectionInfo{ciSubmittors, ciSubmissions, ciAssigned, ciCorrected, ciMin, ciTot, ciMax} <- Map.lookup sheetName sheetMap
+
+ ^{simpleLink (toWidget sheetName) (CSheetR tid ssh csh sheetName SSubsR)}
+ $if groupsPossible
+ #{ciSubmittors}
+ #{ciSubmissions}
+ $maybe ((splus,sfailed),_,_) <- Map.lookup sheetName assignment
+ $if 0 < Set.size sfailed
+ #{ciSubmissions - ciAssigned}
+ (-#{show (Set.size splus)}, failed: #{show (Set.size sfailed)})
+ $elseif 0 < Set.size splus
+ #{ciSubmissions - ciAssigned}
+ (-#{show (Set.size splus)})
+ $else
+ #{ciSubmissions - ciAssigned}
+
+ $nothing
#{ciSubmissions - ciAssigned}
- $nothing
- #{ciSubmissions - ciAssigned}
-
- #{ciSubmissions - ciCorrected}
- #{showDiffDays ciMin}
- #{showAvgsDays ciTot ciCorrected}
- #{showDiffDays ciMax}
+ #{ciSubmissions - ciCorrected}
+ #{showDiffDays ciMin}
+ #{showAvgsDays ciTot ciCorrected}
+ #{showDiffDays ciMax}
_{MsgGenericAll}
_{MsgCorDeficitProportion}
_{MsgCorrectionTime}
- $# Always iterate over sheetList for consistent sorting! Newest first, except in this table
- $forall (shn,_) <- sheetList
+
+ $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table
+ $forall shn <- orderedSheetNames
#{shn}
$# ^{simpleLinkI (SomeMessage MsgMenuCorrectors) (CSheetR tid ssh csh shn SCorrR)}
@@ -62,16 +64,17 @@
_{MsgGenericMin}
_{MsgGenericAvg}
_{MsgGenericMax}
- $# Always iterate over sheetList for consistent sorting! Newest first, except in this table
- $forall _shn <- sheetList
+ $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table
+ $forall _shn <- orderedSheetNames
_{MsgCorProportion}
_{MsgNrSubmissionsTotalShort}
_{MsgGenericNumChange}
_{MsgNrSubmissionsNotCorrectedShort}
_{MsgGenericAvg}
$forall (CorrectionInfo{ciCorrector, ciSubmissions=ciSubmissionsNr, ciCorrected, ciMin, ciTot, ciMax}) <- corrInfos
- $with (nameW,loadM) <- getCorrector ciCorrector
-
+ $with (nameW,loadM, name) <- getCorrector ciCorrector
+ $# TODO: User proper Tooltips instead of title attribute here, once Tooltips work with tables
+
^{nameW}
#{ciSubmissionsNr}
$with total <- ciSubmissions corrMapSum
@@ -84,32 +87,33 @@
#{showDiffDays ciMin}
#{showAvgsDays ciTot ciCorrected}
#{showDiffDays ciMax}
- $# Always iterate over sheetList for consistent sorting! Newest first, except in this table
- $forall (shn, CorrectionInfo{ciSubmissions=sheetSubmissionsNr}) <- sheetList
-
- $maybe SheetCorrector{sheetCorrectorLoad, sheetCorrectorState} <- Map.lookup shn loadM
- #{showCompactCorrectorLoad sheetCorrectorLoad sheetCorrectorState}
- $if sheetCorrectorState == CorrectorNormal
- $maybe Load{byProportion=total} <- Map.lookup shn sheetLoad
- $if total > 0
- \ (#{textPercent' True 0 (byProportion sheetCorrectorLoad) total})
- $maybe CorrectionInfo{ciSubmissions,ciCorrected,ciTot} <- getCorrSheetStatus ciCorrector shn
- #{ciSubmissions}
- $if sheetSubmissionsNr > 0
- \ (#{textPercent' True 0 ciSubmissions sheetSubmissionsNr})
- $maybe nrNew <- getCorrNewAssignment ciCorrector shn
- $# #{ciAssigned} `ciSubmissions` is here always identical to `ciAssigned` and also works for `ciCorrector == Nothing`. ciAssigned only useful in aggregate maps like `sheetMap`
- (+#{nrNew})
+ $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table
+ $forall shn <- orderedSheetNames
+ $maybe CorrectionInfo{ciSubmissions=sheetSubmissionsNr} <- Map.lookup shn sheetMap
+
+ $maybe SheetCorrector{sheetCorrectorLoad, sheetCorrectorState} <- Map.lookup shn loadM
+ #{showCompactCorrectorLoad sheetCorrectorLoad sheetCorrectorState}
+ $if sheetCorrectorState == CorrectorNormal
+ $maybe Load{byProportion=total} <- Map.lookup shn sheetLoad
+ $if total > 0
+ \ (#{textPercent' True 0 (byProportion sheetCorrectorLoad) total})
+ $maybe CorrectionInfo{ciSubmissions,ciCorrected,ciTot} <- getCorrSheetStatus ciCorrector shn
+ #{ciSubmissions}
+ $if sheetSubmissionsNr > 0
+ \ (#{textPercent' True 0 ciSubmissions sheetSubmissionsNr})
+ $maybe nrNew <- getCorrNewAssignment ciCorrector shn
+ $# #{ciAssigned} `ciSubmissions` is here always identical to `ciAssigned` and also works for `ciCorrector == Nothing`. ciAssigned only useful in aggregate maps like `sheetMap`
+ (+#{nrNew})
+ $nothing
+
+ #{ciSubmissions - ciCorrected}
+ #{showAvgsDays ciTot ciCorrected}
$nothing
- #{ciSubmissions - ciCorrected}
- #{showAvgsDays ciTot ciCorrected}
- $nothing
-
-
-
-
- $if not (null sheetList)
+
+
+
+ $if not (null orderedSheetNames)
Σ
$with ciSubmissionsNr <- ciSubmissions corrMapSum
@@ -120,11 +124,12 @@
#{showDiffDays (ciMin corrMapSum)}
#{showAvgsDays (ciTot corrMapSum) (ciCorrected corrMapSum)}
#{showDiffDays (ciMax corrMapSum)}
- $# Always iterate over sheetList for consistent sorting! Newest first, except in this table
- $forall (shn, CorrectionInfo{ciSubmissions}) <- sheetList
- #{getLoadSum shn}
- #{ciSubmissions}
- ^{simpleLinkI (SomeMessage MsgMenuCorrectorsChange) (CSheetR tid ssh csh shn SCorrR)}
+ $# Always iterate over orderedSheetNames for consistent sorting! Newest first, except in this table
+ $forall shn <- orderedSheetNames
+ $maybe CorrectionInfo{ciSubmissions} <- Map.lookup shn sheetMap
+ #{getLoadSum shn}
+ #{ciSubmissions}
+ ^{simpleLinkI (SomeMessage MsgMenuCorrectorsChange) (CSheetR tid ssh csh shn SCorrR)}
^{btnWdgt}
_{MsgHomeUpcomingExams}
+ $if hasExams
+ ^{examTable}
+ $else
+ _{MsgNoUpcomingExams}
diff --git a/templates/widgets/massinput/list/layout.hamlet b/templates/widgets/massinput/list/layout.hamlet
index 0af005b4e..63d64a53a 100644
--- a/templates/widgets/massinput/list/layout.hamlet
+++ b/templates/widgets/massinput/list/layout.hamlet
@@ -1,8 +1,8 @@
$newline never
-
- $forall coord <- review liveCoords lLength
+ $forall coord <- review liveCoords lLength
+
^{cellWdgts ! coord}
diff --git a/test.sh b/test.sh
index 1125cf325..16840a25e 100755
--- a/test.sh
+++ b/test.sh
@@ -11,4 +11,4 @@ if [[ -d .stack-work-test ]]; then
trap move-back EXIT
fi
-exec -- stack build --test --coverage --fast --flag uniworx:dev --flag uniworx:library-only ${@}
+stack build --test --coverage --fast --flag uniworx:dev --flag uniworx:library-only ${@}
diff --git a/test/Model/TypesSpec.hs b/test/Model/TypesSpec.hs
index da1f578d0..33a438411 100644
--- a/test/Model/TypesSpec.hs
+++ b/test/Model/TypesSpec.hs
@@ -23,6 +23,8 @@ import qualified Data.Set as Set
import Time.Types (WeekDay(..))
+import qualified Net.IP as IP
+
instance (Arbitrary a, MonoFoldable a) => Arbitrary (NonNull a) where
arbitrary = arbitrary `suchThatMap` fromNullable
@@ -184,6 +186,12 @@ instance Arbitrary LecturerType where
arbitrary = genericArbitrary
shrink = genericShrink
+instance Arbitrary IP where
+ arbitrary = oneof
+ [ IP.ipv4 <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
+ , IP.ipv6 <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
+ ]
+
instance {-# OVERLAPPABLE #-} ToBackendKey SqlBackend record => Arbitrary (Key record) where
arbitrary = toSqlKey <$> arbitrary
shrink = map toSqlKey . shrink . fromSqlKey
@@ -269,6 +277,8 @@ spec = do
[ eqLaws, ordLaws, showReadLaws, jsonLaws, persistFieldLaws ]
lawsCheckHspec (Proxy @LecturerType)
[ eqLaws, ordLaws, showReadLaws, boundedEnumLaws, finiteLaws, jsonLaws, pathPieceLaws, persistFieldLaws ]
+ lawsCheckHspec (Proxy @IP)
+ [ eqLaws, ordLaws, showReadLaws, jsonLaws ]
describe "TermIdentifier" $ do
it "has compatible encoding/decoding to/from Text" . property $
diff --git a/test/TestImport.hs b/test/TestImport.hs
index 4fb09576b..9164c3144 100644
--- a/test/TestImport.hs
+++ b/test/TestImport.hs
@@ -36,6 +36,8 @@ import Numeric.Natural as X
import Control.Lens as X hiding ((<.), elements)
+import Net.IP as X (IP)
+
import Database (truncateDb)
import Database as X (fillDb)