Commit 39711d9e authored by Ibnu Daru Aji's avatar Ibnu Daru Aji

modified templates.

parent 8986abd4
......@@ -2,7 +2,7 @@
--
-- see: https://github.com/sol/hpack
--
-- hash: 182b2eee735aff45f4d879dc8c683cf136a2a4a06e7bf266979d7a09220b6f88
-- hash: 79d1f04a49c5644f4f9793d1ced51e6072187e4c6a949b5859fc10a4915fa81a
name: Cirkeltrek
version: 0.0.0
......@@ -28,6 +28,7 @@ library
Flux.Topic
Flux.User
Foundation
Handler.Adm
Handler.Adm.Ban
Handler.Adm.Category
Handler.Adm.Forum
......
......@@ -27,6 +27,7 @@ import Settings (ApplicationSettings (..),
import Handler.Home
import Handler.User
import Handler.Adm
import Handler.Adm.Category
import Handler.Adm.Forum
import Handler.Adm.Ban
......
......@@ -39,6 +39,7 @@ mkYesodData
/register RegisterR GET POST
/profile ProfileR GET
/user/#Int64 UserR GET
/admin AdmR GET
/admin/category AdmCategoryR GET POST
/admin/forum AdmForumR GET POST
/admin/ban AdmBanR GET POST
......@@ -77,7 +78,7 @@ instance Yesod App where
genFilename lbs = "autogen-" ++ base64md5 lbs
defaultLayout widget = do
master <- getYesod
maut <- maybeAuth
muidnamegroup <- getUserAndGrouping
mmessage <- getMessage
pagecontent <- widgetToPageContent $ do
addStylesheet $ StaticR css_main_css
......
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
module Handler.Adm where
import Import
getAdmR :: Handler Html
getAdmR = do
(uid, name, group) <- allowedToMod
defaultLayout $(widgetFile "adm")
<p>
<a href=@{AdmBanR}> Ban
$case group
$of Administrator
<p>
<a href=@{AdmCategoryR}> Category
<p>
<a href=@{AdmForumR}> Forum
$of Moderator
$of Member
$of Banned
......@@ -3,9 +3,19 @@
<ul .navigation-list.float-left>
<li .navigation-item>
<a .navigation-link href=@{HomeR}> Home
$maybe (uid, name, group) <- muidnamegroup
$case group
$of Administrator
<li .navigation-item>
<a .navigation-link href=@{AdmR}> Administration
$of Administrator
<li .navigation-item>
<a .navigation-link href=@{AdmR}> Administration
$of Member
$of Banned
<ul .navigation-list.float-right>
$maybe aut <- maut
$maybe aut <- muidnamegroup
<li .navigation-item>
<a .navigation-link href=@{ProfileR}> Profile
<li .navigation-item>
......@@ -16,4 +26,7 @@
<li .navigation-item>
<a .navigation-link href=@{SigninR LoginR}> Login
<section .container>
$maybe message <- mmessage
#{message}
$nothing
^{widget}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment