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 let -- whamlet convenience functions
-- avoid nestes hamlet $maybe with duplicated $nothing -- 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) getCorrector (Just uid)
| Just (User{..},loadMap) <- Map.lookup uid correctorMap | Just (User{..},loadMap) <- Map.lookup uid correctorMap
= (nameEmailWidget userEmail userDisplayName userSurname, loadMap) = (nameEmailWidget userEmail userDisplayName userSurname, loadMap, userDisplayName)
-- | Just (User{..} ) <- Map.lookup uid lecturerNames -- | Just (User{..} ) <- Map.lookup uid lecturerNames
-- = (nameEmailWidget userEmail userDisplayName userSurname, mempty) -- lecturers may also correct in rare cases -- = (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 -- avoid nestes hamlet $maybe with duplicated $nothing
getCorrSheetStatus :: Maybe UserId -> SheetName -> Maybe CorrectionInfo getCorrSheetStatus :: Maybe UserId -> SheetName -> Maybe CorrectionInfo
getCorrSheetStatus corr shn getCorrSheetStatus corr shn

View File

@ -1,23 +1,49 @@
<section> <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 Diese interne Seite dient lediglich zum Testen diverser Funktionalitäten
und zur Demonstration der verschiedenen Hilfsfunktionen/Module. 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. 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> <section>
<h2 uw-show-hide>Teilweise funktionierende Abschnitte <h2>Tabelle zu Fuss
<table .table .table--striped>
<ul> <tr .table__row .table__row--head>
<li .list-group-item> <th .table__th colspan=2> Kopf A
<a href=@{UsersR}>Benutzer Verwaltung <th .table__th rowspan=2> Kopf
<tr .table__row .table__row--head>
<li .list-group-item> <th .table__th> B
<a href=@{TermShowR}>Semester Verwaltung <th .table__th> C
<a href=@{TermEditR}>Neues Semester anlegen <tr .table__row title="Ein Beispiel für ein Zeilentooltip">
<td .table__td>1
<li .list-group-item> <td .table__td>2
<a href=@{CourseNewR}>Kurse anlegen <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> <section>
<h2>Funktionen zum Testen <h2>Funktionen zum Testen

View File

@ -70,8 +70,9 @@
<th .table__th>_{MsgNrSubmissionsNotCorrectedShort} <th .table__th>_{MsgNrSubmissionsNotCorrectedShort}
<th .table__th>_{MsgGenericAvg} <th .table__th>_{MsgGenericAvg}
$forall (CorrectionInfo{ciCorrector, ciSubmissions=ciSubmissionsNr, ciCorrected, ciMin, ciTot, ciMax}) <- corrInfos $forall (CorrectionInfo{ciCorrector, ciSubmissions=ciSubmissionsNr, ciCorrected, ciMin, ciTot, ciMax}) <- corrInfos
$with (nameW,loadM) <- getCorrector ciCorrector $with (nameW,loadM, name) <- getCorrector ciCorrector
<tr .table__row> $# 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>^{nameW}
<td .table__td>#{ciSubmissionsNr} <td .table__td>#{ciSubmissionsNr}
$with total <- ciSubmissions corrMapSum $with total <- ciSubmissions corrMapSum