mirror of
https://code.naskya.net/repos/ndqEd
synced 2025-03-20 15:14:54 +09:00
Breadcrumbs widget in default layout
This commit is contained in:
parent
e8befc41ee
commit
13d814034c
6 changed files with 84 additions and 3 deletions
src/Vervis
|
@ -17,7 +17,6 @@ module Vervis.Foundation where
|
|||
|
||||
import Prelude (init, last)
|
||||
|
||||
import Vervis.Import.NoFoundation hiding (last)
|
||||
import Database.Persist.Sql (ConnectionPool, runSqlPool)
|
||||
import Text.Hamlet (hamletFile)
|
||||
import Text.Jasmine (minifym)
|
||||
|
@ -31,6 +30,9 @@ import qualified Yesod.Core.Unsafe as Unsafe
|
|||
import Data.Text as T (pack)
|
||||
--import qualified Data.Text.Encoding as TE
|
||||
|
||||
import Vervis.Import.NoFoundation hiding (last)
|
||||
import Vervis.Widget (breadcrumbBar)
|
||||
|
||||
-- | The foundation datatype for your application. This can be a good place to
|
||||
-- keep settings and values requiring initialization before your application
|
||||
-- starts running, such as database connections. Every handler will have
|
||||
|
|
33
src/Vervis/Widget.hs
Normal file
33
src/Vervis/Widget.hs
Normal file
|
@ -0,0 +1,33 @@
|
|||
{- This file is part of Vervis.
|
||||
-
|
||||
- Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
|
||||
-
|
||||
- ♡ Copying is an act of love. Please copy, reuse and share.
|
||||
-
|
||||
- The author(s) have dedicated all copyright and related and neighboring
|
||||
- rights to this software to the public domain worldwide. This software is
|
||||
- distributed without any warranty.
|
||||
-
|
||||
- You should have received a copy of the CC0 Public Domain Dedication along
|
||||
- with this software. If not, see
|
||||
- <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
-}
|
||||
|
||||
-- | Various custom widgets.
|
||||
module Vervis.Widget
|
||||
( breadcrumbBar
|
||||
)
|
||||
where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Yesod.Core (YesodBreadcrumbs, breadcrumbs)
|
||||
import Yesod.Core.Widget
|
||||
|
||||
import Vervis.Settings (widgetFile)
|
||||
import Vervis.Style
|
||||
|
||||
breadcrumbBar :: YesodBreadcrumbs site => WidgetT site IO ()
|
||||
breadcrumbBar = do
|
||||
(current, bcs) <- handlerToWidget breadcrumbs
|
||||
$(widgetFile "breadcrumbs")
|
Loading…
Add table
Add a link
Reference in a new issue