Merge branch 'feat/pageactions'
This commit is contained in:
commit
be5d88b24b
@ -405,6 +405,14 @@ defaultMenuLayout menu widget = do
|
||||
modalId :: Int32
|
||||
modalId = 13
|
||||
$(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
|
||||
addStylesheetRemote "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,800,900"
|
||||
|
||||
@ -64,7 +64,7 @@ getCourseListTermR tidini = do
|
||||
)
|
||||
]
|
||||
let pageLinks =
|
||||
[ NavbarAside $ MenuItem
|
||||
[ PageActionPrime $ MenuItem
|
||||
{ menuItemLabel = "Neuer Kurs"
|
||||
, menuItemIcon = Just "book"
|
||||
, menuItemRoute = CourseNewR
|
||||
|
||||
@ -76,7 +76,7 @@ getTermShowR = do
|
||||
, dbtIdent = "terms" :: Text
|
||||
}
|
||||
let pageActions =
|
||||
[ NavbarAside $ MenuItem
|
||||
[ PageActionPrime $ MenuItem
|
||||
{ menuItemLabel = "Neues Semester"
|
||||
, menuItemIcon = Nothing
|
||||
, menuItemRoute = TermEditR
|
||||
|
||||
@ -15,5 +15,8 @@
|
||||
$with status2 <- bool status "info" (status == "")
|
||||
<div class="alert alert-#{status2}">#{msg}
|
||||
|
||||
<!-- prime page actions -->
|
||||
^{pageactionprime}
|
||||
|
||||
<!-- actual content -->
|
||||
^{widget}
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
--lighterbase: #5F98C2;
|
||||
--whitebase: #FCFFFA;
|
||||
--greybase: #B1B5C0;
|
||||
--lightgreybase: #D9DEDB;
|
||||
--blackbase: #1A2A36;
|
||||
--fontbase: #34303a;
|
||||
--fontsec: #5b5861;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
$newline never
|
||||
<aside .main__aside>
|
||||
<div .asidenav>
|
||||
<div .asidenav__box--dont-hide>
|
||||
@ -10,12 +11,6 @@
|
||||
$if isJust mIcon
|
||||
<div .glyphicon.glyphicon--#{fromMaybe "" mIcon}>
|
||||
<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 _
|
||||
|
||||
<div .asidenav__box--dont-hide>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
$newline never
|
||||
<div .navbar-container>
|
||||
<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);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user