minor: table row tooltips, also see #407

This commit is contained in:
Steffen Jost 2019-07-01 17:52:52 +02:00
parent c5a6d730dc
commit ba280fe44a
3 changed files with 45 additions and 18 deletions

View File

@ -1214,13 +1214,13 @@ assignHandler tid ssh csh cid assignSids = do
let -- whamlet convenience functions
-- avoid nestes hamlet $maybe with duplicated $nothing
getCorrector :: Maybe UserId -> (Widget,Map SheetName SheetCorrector)
getCorrector :: Maybe UserId -> (Widget,Map SheetName SheetCorrector, Text)
getCorrector (Just uid)
| Just (User{..},loadMap) <- Map.lookup uid correctorMap
= (nameEmailWidget userEmail userDisplayName userSurname, loadMap)
= (nameEmailWidget userEmail userDisplayName userSurname, loadMap, userDisplayName)
-- | Just (User{..} ) <- Map.lookup uid lecturerNames
-- = (nameEmailWidget userEmail userDisplayName userSurname, mempty) -- lecturers may also correct in rare cases
getCorrector _ = ([whamlet|_{MsgNoCorrectorAssigned}|], mempty)
getCorrector _ = ([whamlet|_{MsgNoCorrectorAssigned}|], mempty, mempty)
-- avoid nestes hamlet $maybe with duplicated $nothing
getCorrSheetStatus :: Maybe UserId -> SheetName -> Maybe CorrectionInfo
getCorrSheetStatus corr shn

View File

@ -1,23 +1,49 @@
<section>
<p data-tooltip="Solch ein Tooltip kann mit dem <em>data-tooltip</em> Attribut erzeugt werden. Funktioniert aber nur in Block-Elementen die einen sinnvollen Wrapper haben.">
<p>
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.
<p>
<div .tooltip>
<div .tooltip__handle>
<div .tooltip__content>Hier könnte Ihr Tooltip stehen!
Hier ist ein Text mit einem eingebetteten Tooltip.
<p>
<span .tooltip>
<span .tooltip__content>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.
<section>
<h2 uw-show-hide>Teilweise funktionierende Abschnitte
<ul>
<li .list-group-item>
<a href=@{UsersR}>Benutzer Verwaltung
<li .list-group-item>
<a href=@{TermShowR}>Semester Verwaltung
<a href=@{TermEditR}>Neues Semester anlegen
<li .list-group-item>
<a href=@{CourseNewR}>Kurse anlegen
<h2>Tabelle zu Fuss
<table .table .table--striped>
<tr .table__row .table__row--head>
<th .table__th colspan=2> Kopf A
<th .table__th rowspan=2> Kopf
<tr .table__row .table__row--head>
<th .table__th> B
<th .table__th> C
<tr .table__row title="Ein Beispiel für ein Zeilentooltip">
<td .table__td>1
<td .table__td>2
<td .table__td>3
<tr .table__row>
<td .table__td>
<span .tooltip>
<span .tooltip__content>Kaufen Sie Tooltip-White für hellere Tooltips! (GEHT NICHT)
4
<td .table__td>5
<span .tooltip>
<span .tooltip__content>Kaufen Sie Tooltip-Black für dunklere Tooltips! (GEHT NICHT)
<td .table__td>6
<tr .table__row>
<td .table__td>7
<td .table__td>8
<td .table__td>9
<section>
<h2>Funktionen zum Testen

View File

@ -70,8 +70,9 @@
<th .table__th>_{MsgNrSubmissionsNotCorrectedShort}
<th .table__th>_{MsgGenericAvg}
$forall (CorrectionInfo{ciCorrector, ciSubmissions=ciSubmissionsNr, ciCorrected, ciMin, ciTot, ciMax}) <- corrInfos
$with (nameW,loadM) <- getCorrector ciCorrector
<tr .table__row>
$with (nameW,loadM, name) <- getCorrector ciCorrector
$# TODO: User proper Tooltips instead of title attribute here, once Tooltips work with tables
<tr .table__row title="#{name}">
<td .table__td>^{nameW}
<td .table__td>#{ciSubmissionsNr}
$with total <- ciSubmissions corrMapSum