From 18b3fe0e5dbf50e2329e3f271fd503aaf26b5e0e Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 13 Oct 2018 00:00:44 +0200 Subject: [PATCH] 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 {