Merge branch 'feat/pageactions'
This commit is contained in:
commit
be5d88b24b
@ -405,6 +405,14 @@ defaultMenuLayout menu widget = do
|
|||||||
modalId :: Int32
|
modalId :: Int32
|
||||||
modalId = 13
|
modalId = 13
|
||||||
$(widgetFile "widgets/modal")
|
$(widgetFile "widgets/modal")
|
||||||
|
pageactionprime :: Widget
|
||||||
|
pageactionprime = $(widgetFile "widgets/pageactionprime")
|
||||||
|
-- functions to determine if there are page-actions
|
||||||
|
isPageActionPrime :: MenuTypes -> Bool
|
||||||
|
isPageActionPrime (PageActionPrime _) = True
|
||||||
|
isPageActionPrime _ = False
|
||||||
|
hasPageActions :: Bool
|
||||||
|
hasPageActions = any isPageActionPrime menuTypes
|
||||||
|
|
||||||
pc <- widgetToPageContent $ do
|
pc <- widgetToPageContent $ do
|
||||||
addStylesheetRemote "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,800,900"
|
addStylesheetRemote "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,800,900"
|
||||||
|
|||||||
@ -64,7 +64,7 @@ getCourseListTermR tidini = do
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
let pageLinks =
|
let pageLinks =
|
||||||
[ NavbarAside $ MenuItem
|
[ PageActionPrime $ MenuItem
|
||||||
{ menuItemLabel = "Neuer Kurs"
|
{ menuItemLabel = "Neuer Kurs"
|
||||||
, menuItemIcon = Just "book"
|
, menuItemIcon = Just "book"
|
||||||
, menuItemRoute = CourseNewR
|
, menuItemRoute = CourseNewR
|
||||||
|
|||||||
@ -76,7 +76,7 @@ getTermShowR = do
|
|||||||
, dbtIdent = "terms" :: Text
|
, dbtIdent = "terms" :: Text
|
||||||
}
|
}
|
||||||
let pageActions =
|
let pageActions =
|
||||||
[ NavbarAside $ MenuItem
|
[ PageActionPrime $ MenuItem
|
||||||
{ menuItemLabel = "Neues Semester"
|
{ menuItemLabel = "Neues Semester"
|
||||||
, menuItemIcon = Nothing
|
, menuItemIcon = Nothing
|
||||||
, menuItemRoute = TermEditR
|
, menuItemRoute = TermEditR
|
||||||
|
|||||||
@ -15,5 +15,8 @@
|
|||||||
$with status2 <- bool status "info" (status == "")
|
$with status2 <- bool status "info" (status == "")
|
||||||
<div class="alert alert-#{status2}">#{msg}
|
<div class="alert alert-#{status2}">#{msg}
|
||||||
|
|
||||||
|
<!-- prime page actions -->
|
||||||
|
^{pageactionprime}
|
||||||
|
|
||||||
<!-- actual content -->
|
<!-- actual content -->
|
||||||
^{widget}
|
^{widget}
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
--lighterbase: #5F98C2;
|
--lighterbase: #5F98C2;
|
||||||
--whitebase: #FCFFFA;
|
--whitebase: #FCFFFA;
|
||||||
--greybase: #B1B5C0;
|
--greybase: #B1B5C0;
|
||||||
|
--lightgreybase: #D9DEDB;
|
||||||
--blackbase: #1A2A36;
|
--blackbase: #1A2A36;
|
||||||
--fontbase: #34303a;
|
--fontbase: #34303a;
|
||||||
--fontsec: #5b5861;
|
--fontsec: #5b5861;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
$newline never
|
||||||
<aside .main__aside>
|
<aside .main__aside>
|
||||||
<div .asidenav>
|
<div .asidenav>
|
||||||
<div .asidenav__box--dont-hide>
|
<div .asidenav__box--dont-hide>
|
||||||
@ -10,12 +11,6 @@
|
|||||||
$if isJust mIcon
|
$if isJust mIcon
|
||||||
<div .glyphicon.glyphicon--#{fromMaybe "" mIcon}>
|
<div .glyphicon.glyphicon--#{fromMaybe "" mIcon}>
|
||||||
<div .asidenav__link-label>#{label}
|
<div .asidenav__link-label>#{label}
|
||||||
$of PageActionPrime (MenuItem label mIcon route _)
|
|
||||||
<li .asidenav__list-item :Just route == mcurrentRoute:.asidenav__list-item--active>
|
|
||||||
<a .asidenav__link-wrapper href=@{route}>
|
|
||||||
$if isJust mIcon
|
|
||||||
<div .glyphicon.glyphicon--#{fromMaybe "" mIcon}>
|
|
||||||
<div .asidenav__link-label>#{label}
|
|
||||||
$of _
|
$of _
|
||||||
|
|
||||||
<div .asidenav__box--dont-hide>
|
<div .asidenav__box--dont-hide>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
$newline never
|
||||||
<div .navbar-container>
|
<div .navbar-container>
|
||||||
<nav .navbar.js-sticky-navbar>
|
<nav .navbar.js-sticky-navbar>
|
||||||
|
|
||||||
|
|||||||
11
templates/widgets/pageactionprime.hamlet
Normal file
11
templates/widgets/pageactionprime.hamlet
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
$newline never
|
||||||
|
$if hasPageActions
|
||||||
|
<div .page-nav-prime>
|
||||||
|
<h3>Aktionen:
|
||||||
|
<ul .pagenav__list>
|
||||||
|
$forall menuType <- menuTypes
|
||||||
|
$case menuType
|
||||||
|
$of PageActionPrime (MenuItem label mIcon route _)
|
||||||
|
<li .pagenav__list-item>
|
||||||
|
<a .pagenav__link-wrapper href=@{route}>#{label}
|
||||||
|
$of _
|
||||||
21
templates/widgets/pageactionprime.lucius
Normal file
21
templates/widgets/pageactionprime.lucius
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
.page-nav-prime {
|
||||||
|
background-color: var(--lightgreybase);
|
||||||
|
box-shadow: -20px -20px 0 20px var(--lightgreybase),
|
||||||
|
20px -20px 0 20px var(--lightgreybase);
|
||||||
|
padding: 13px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-nav-prime .pagenav__list {
|
||||||
|
margin: 7px 0 0;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.page-nav-prime .pagenav__list-item {
|
||||||
|
display: inline-block;
|
||||||
|
border-bottom: 2px solid var(--lightbase);
|
||||||
|
margin-right: 7px;
|
||||||
|
transition: border-bottom-color .2s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-bottom-color: var(--lighterbase);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user