From 18b3fe0e5dbf50e2329e3f271fd503aaf26b5e0e Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 13 Oct 2018 00:00:44 +0200 Subject: [PATCH 001/204] introduced icon for modals --- src/Handler/Course.hs | 4 ++-- src/Handler/Utils/Table/Cells.hs | 4 ++-- src/Handler/Utils/Templates.hs | 15 +++++++++++++-- templates/standalone/modal.julius | 1 - templates/standalone/modal.lucius | 13 +++++++++++++ 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 044f9b391..300c6d3ff 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -78,8 +78,8 @@ colCShortDescr = sortable (Just "cshort") (i18nCell MsgCourseShort) (Just descr) -> cell [whamlet| $newline never - - ^{modal "Beschreibung" (Right $ toWidget descr)} +
+ ^{modal "Beschreibung anzeigen" (Right $ toWidget descr)} |] ) diff --git a/src/Handler/Utils/Table/Cells.hs b/src/Handler/Utils/Table/Cells.hs index 65bc11452..5c4dad4d7 100644 --- a/src/Handler/Utils/Table/Cells.hs +++ b/src/Handler/Utils/Table/Cells.hs @@ -78,8 +78,8 @@ courseCell (Course {..}) = anchorCell link name `mappend` desc Nothing -> mempty (Just descr) -> cell [whamlet| $newline never - - ^{modal "Beschreibung" (Right $ toWidget descr)} +
+ ^{modal "Beschreibung anzeigen" (Right $ toWidget descr)} |] sheetCell :: IsDBTable m a => CourseLink -> SheetName -> DBCell m a diff --git a/src/Handler/Utils/Templates.hs b/src/Handler/Utils/Templates.hs index 57ab0f1d6..bb89397b1 100644 --- a/src/Handler/Utils/Templates.hs +++ b/src/Handler/Utils/Templates.hs @@ -16,5 +16,16 @@ modal modalTrigger modalContent = do triggerId <- newIdent $(widgetFile "widgets/modal") case modalContent of - Left route -> [whamlet|^{modalTrigger}|] - Right content -> [whamlet|
^{modalTrigger}|] + -- TODO: refactor this. preferably put svg in separte file somewhere in static? + Left route -> [whamlet| +
+ + + ^{modalTrigger} + |] + Right content -> [whamlet| +
+
+ + ^{modalTrigger} + |] diff --git a/templates/standalone/modal.julius b/templates/standalone/modal.julius index 8bac72f12..fa32d2723 100644 --- a/templates/standalone/modal.julius +++ b/templates/standalone/modal.julius @@ -50,7 +50,6 @@ document.addEventListener('modal-open', openOnEvent, false); // if modal has trigger assigned to it open modal on click if (trigger) { - trigger.classList.add('modal__trigger'); trigger.addEventListener('click', open, false); } diff --git a/templates/standalone/modal.lucius b/templates/standalone/modal.lucius index 589083ece..2379714ee 100644 --- a/templates/standalone/modal.lucius +++ b/templates/standalone/modal.lucius @@ -60,6 +60,19 @@ .modal__trigger { cursor: pointer; + display: inline-flex; + flex-direction: row; + align-items: baseline; + margin-top: 5px; +} + +.modal__trigger-icon { + height: 20px; +} + +.modal__trigger-label { + font-size: 14px; + padding-left: 5px; } .modal__closer { From 5332e22c134ee8bcf71c320988cfb0aa8f4ea4b0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 14 Oct 2018 17:24:19 +0200 Subject: [PATCH 002/204] img_modal_svg --- src/Foundation.hs | 1 - src/Handler/Utils/Templates.hs | 15 +++++++-------- static/img/modal.svg | 7 +++++++ 3 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 static/img/modal.svg diff --git a/src/Foundation.hs b/src/Foundation.hs index 105c859ab..558e13e8e 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -75,7 +75,6 @@ import qualified Control.Monad.Catch as C import System.FilePath -import Handler.Utils.Templates import Handler.Utils.StudyFeatures import Control.Lens import Utils diff --git a/src/Handler/Utils/Templates.hs b/src/Handler/Utils/Templates.hs index bb89397b1..d23e6b31e 100644 --- a/src/Handler/Utils/Templates.hs +++ b/src/Handler/Utils/Templates.hs @@ -4,12 +4,9 @@ module Handler.Utils.Templates where import Data.Either (isLeft) -import Import.NoFoundation +import Import -lipsum :: WidgetT site IO () -lipsum = $(widgetFile "widgets/lipsum") - -modal :: WidgetT site IO () -> Either (Route site) (WidgetT site IO ()) -> WidgetT site IO () +modal :: WidgetT UniWorX IO () -> Either (Route UniWorX) (WidgetT UniWorX IO ()) -> WidgetT UniWorX IO () modal modalTrigger modalContent = do let modalDynamic = isLeft modalContent modalId <- newIdent @@ -18,14 +15,16 @@ modal modalTrigger modalContent = do case modalContent of -- TODO: refactor this. preferably put svg in separte file somewhere in static? Left route -> [whamlet| + $newline never
- + ^{modalTrigger} |] - Right content -> [whamlet| + Right _ -> [whamlet| + $newline never
- + ^{modalTrigger} |] diff --git a/static/img/modal.svg b/static/img/modal.svg new file mode 100644 index 000000000..a4a08bb48 --- /dev/null +++ b/static/img/modal.svg @@ -0,0 +1,7 @@ + + + + + + + From 3577e261afba3d7ae5602f1976a014231fb208d9 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 26 Jan 2019 12:05:56 +0100 Subject: [PATCH 003/204] always show pagesize dropdown --- templates/table/layout.hamlet | 8 ++++---- templates/table/layout.lucius | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/table/layout.hamlet b/templates/table/layout.hamlet index bc0fbd289..ed4677c7a 100644 --- a/templates/table/layout.hamlet +++ b/templates/table/layout.hamlet @@ -3,10 +3,10 @@ $if null rows && (dbsEmptyStyle == DBESNoHeading) _{dbsEmptyMessage} $else ^{table} - $if pageCount > 1 -
-
- ^{pagesizeWdgt} +
+ + ^{pagesizeWdgt} + $if pageCount > 1