This commit is contained in:
parent
59f36d92f0
commit
13b575b952
@ -1,6 +1,7 @@
|
|||||||
* Version 01.08.2018
|
* Version 01.08.2018
|
||||||
|
|
||||||
Verbesserter Campus-Login
|
Verbesserter Campus-Login
|
||||||
|
(Ersatz einer C-Bibliothek mit undokumentierter Abhängigkeit durch selbst entwickelten Haskell-Code erlaubt nun auch Umlaute.)
|
||||||
|
|
||||||
* Version 31.07.2018
|
* Version 31.07.2018
|
||||||
|
|
||||||
|
|||||||
@ -41,18 +41,37 @@ colCourse = sortable (Just "course") (i18nCell MsgCourse)
|
|||||||
anchorCell (CourseR courseTerm courseShorthand CShowR)
|
anchorCell (CourseR courseTerm courseShorthand CShowR)
|
||||||
[whamlet|#{display courseName}|]
|
[whamlet|#{display courseName}|]
|
||||||
|
|
||||||
|
colCourseDescr :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a)
|
||||||
|
colCourseDescr = sortable (Just "course") (i18nCell MsgCourse)
|
||||||
|
$ \DBRow{ dbrOutput=(Entity cid Course{..}, _, _) } -> mappend
|
||||||
|
( anchorCell (CourseR courseTerm courseShorthand CShowR) [whamlet|#{display courseName}|] )
|
||||||
|
( case courseDescription of
|
||||||
|
Nothing -> mempty
|
||||||
|
(Just descr) -> cell [whamlet| <span style="float:right"> ^{modalStatic descr} |]
|
||||||
|
)
|
||||||
|
|
||||||
colDescription :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a)
|
colDescription :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a)
|
||||||
colDescription = sortable Nothing (i18nCell MsgCourseDescription)
|
colDescription = sortable Nothing (i18nCell MsgCourseDescription)
|
||||||
$ \DBRow{ dbrOutput=(Entity cid Course{..}, _, _) } ->
|
$ \DBRow{ dbrOutput=(Entity cid Course{..}, _, _) } ->
|
||||||
case courseDescription of
|
case courseDescription of
|
||||||
Nothing -> cell mempty
|
Nothing -> mempty
|
||||||
(Just d)-> cell [whamlet|<div .container><p data-tooltip="#{d}">|]
|
(Just descr) -> cell $ modalStatic descr
|
||||||
|
|
||||||
colCShort :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a)
|
colCShort :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a)
|
||||||
colCShort = sortable (Just "cshort") (i18nCell MsgCourseShort)
|
colCShort = sortable (Just "cshort") (i18nCell MsgCourseShort)
|
||||||
$ \DBRow{ dbrOutput=(Entity cid Course{..}, _, _) } ->
|
$ \DBRow{ dbrOutput=(Entity cid Course{..}, _, _) } ->
|
||||||
anchorCell (CourseR courseTerm courseShorthand CShowR) [whamlet|#{display courseShorthand}|]
|
anchorCell (CourseR courseTerm courseShorthand CShowR) [whamlet|#{display courseShorthand}|]
|
||||||
|
|
||||||
|
colCShortDescr :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a)
|
||||||
|
colCShortDescr = sortable (Just "cshort") (i18nCell MsgCourseShort)
|
||||||
|
$ \DBRow{ dbrOutput=(Entity cid Course{..}, _, _) } -> mappend
|
||||||
|
( anchorCell (CourseR courseTerm courseShorthand CShowR) [whamlet|#{display courseShorthand}|] )
|
||||||
|
( case courseDescription of
|
||||||
|
Nothing -> mempty
|
||||||
|
(Just descr) -> cell
|
||||||
|
[whamlet|<span style="float:right"> ^{modalStatic descr} |]
|
||||||
|
)
|
||||||
|
|
||||||
colTerm :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a)
|
colTerm :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a)
|
||||||
colTerm = sortable (Just "term") (i18nCell MsgTerm)
|
colTerm = sortable (Just "term") (i18nCell MsgTerm)
|
||||||
$ \DBRow{ dbrOutput=(Entity cid Course{..}, _, _) } ->
|
$ \DBRow{ dbrOutput=(Entity cid Course{..}, _, _) } ->
|
||||||
@ -144,10 +163,9 @@ getCourseListR :: Handler Html
|
|||||||
getCourseListR = do -- TODO: Suchfunktion für Kurse und Kürzel!!!
|
getCourseListR = do -- TODO: Suchfunktion für Kurse und Kürzel!!!
|
||||||
muid <- maybeAuthId
|
muid <- maybeAuthId
|
||||||
let colonnade = widgetColonnade $ mconcat
|
let colonnade = widgetColonnade $ mconcat
|
||||||
[ colCourse
|
[ colCourseDescr
|
||||||
, colCShort
|
, colCShort
|
||||||
, colTerm
|
, colTerm
|
||||||
-- , colDescription -- does not work as intended issue #80
|
|
||||||
, maybe mempty (const colRegistered) muid
|
, maybe mempty (const colRegistered) muid
|
||||||
]
|
]
|
||||||
whereClause = const $ E.val True
|
whereClause = const $ E.val True
|
||||||
@ -158,6 +176,10 @@ getCourseListR = do -- TODO: Suchfunktion für Kurse und Kürzel!!!
|
|||||||
setTitleI MsgCourseListTitle
|
setTitleI MsgCourseListTitle
|
||||||
[whamlet|TODO: Such-/Filterfunktion hier einbauen|] -- TODO
|
[whamlet|TODO: Such-/Filterfunktion hier einbauen|] -- TODO
|
||||||
$(widgetFile "courses")
|
$(widgetFile "courses")
|
||||||
|
[whamlet|
|
||||||
|
^{modal "#UNIQUE_ID_98765" (Just "Test Inhalt für Modal")}
|
||||||
|
<div .tooltip__handle #UNIQUE_ID_98765>?
|
||||||
|
|]
|
||||||
|
|
||||||
getTermCurrentR :: Handler Html
|
getTermCurrentR :: Handler Html
|
||||||
getTermCurrentR = do
|
getTermCurrentR = do
|
||||||
@ -173,7 +195,7 @@ getTermCourseListR tid = do
|
|||||||
muid <- maybeAuthId
|
muid <- maybeAuthId
|
||||||
let colonnade = widgetColonnade $ mconcat
|
let colonnade = widgetColonnade $ mconcat
|
||||||
[ dbRow
|
[ dbRow
|
||||||
, colCShort
|
, colCShortDescr
|
||||||
, colRegFrom
|
, colRegFrom
|
||||||
, colRegTo
|
, colRegTo
|
||||||
, colParticipants
|
, colParticipants
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{-# LANGUAGE NoImplicitPrelude, TemplateHaskell #-}
|
{-# LANGUAGE NoImplicitPrelude, TemplateHaskell, QuasiQuotes #-}
|
||||||
|
|
||||||
module Handler.Utils.Templates where
|
module Handler.Utils.Templates where
|
||||||
|
|
||||||
@ -7,8 +7,17 @@ import Import.NoFoundation
|
|||||||
lipsum :: WidgetT site IO ()
|
lipsum :: WidgetT site IO ()
|
||||||
lipsum = $(widgetFile "widgets/lipsum")
|
lipsum = $(widgetFile "widgets/lipsum")
|
||||||
|
|
||||||
modal :: [Char] -> Maybe [Char] -> WidgetT site IO ()
|
modalStatic :: Html -> WidgetT site IO ()
|
||||||
modal modalTrigger (Just modalContent) = do
|
modalStatic modalContent = do
|
||||||
|
uniqueId <- newIdent
|
||||||
|
let modalTrigger = cons '#' uniqueId -- SJ: I am confused why this is needed here?
|
||||||
|
modalId :: Int32
|
||||||
|
modalId = 13
|
||||||
|
$(widgetFile "widgets/modalStatic")
|
||||||
|
[whamlet|<div .tooltip__handle ##{uniqueId}>?|] -- SJ: confused why ## is needed here either?
|
||||||
|
|
||||||
|
modal :: Text -> Maybe [Char] -> WidgetT site IO ()
|
||||||
|
modal modalTrigger (Just modalContent) = do -- WARNING: ModalContent should not have length 11. SJ: This is possibly bad. See Template!
|
||||||
let
|
let
|
||||||
modalId :: Int32
|
modalId :: Int32
|
||||||
modalId = 13
|
modalId = 13
|
||||||
|
|||||||
2
templates/widgets/modalStatic.hamlet
Normal file
2
templates/widgets/modalStatic.hamlet
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<div .modal.js-modal #modal-#{modalId} data-trigger=#{modalTrigger} data-closeable=true>
|
||||||
|
#{modalContent}
|
||||||
Reference in New Issue
Block a user