about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author"Vincent Ambo ext:(%22) <tazjin@me.com>2012-03-07T13·51+0100
committer"Vincent Ambo ext:(%22) <tazjin@me.com>2012-03-07T13·51+0100
commitc880a6092c3c2c81095d8ae1a45c06687bc40677 (patch)
treead2246b385a0d378cdee9304356c44b0f5da21b4 /src
parentb2bb90beff55d1aae2026f66840e6331734512d8 (diff)
* login page
Diffstat (limited to 'src')
-rw-r--r--src/Blog.hs25
-rw-r--r--src/Main.hs3
2 files changed, 22 insertions, 6 deletions
diff --git a/src/Blog.hs b/src/Blog.hs
index 0b32b7b30bd6..87397ac821a3 100644
--- a/src/Blog.hs
+++ b/src/Blog.hs
@@ -177,13 +177,26 @@ showSiteNotice = H.docTypeHtml $ do
         toHtml ("50858 Köln" :: Text)
         H.p $ H.a ! A.href "/" ! A.style "color:black" $ "Back"
 
-{-
-<title>Impressum</title>
+{- Administration pages -}
 
-<h2>Impressum und <a alt="Verantwortlich im Sinne des Presserechtes">ViSdP</a></h2>
-
-<i>[German law demands this]</i><p>Vincent Ambo<br>Benfleetstr. 8<br>50858 Köln<br /><br /><a href="/" style="color:black">Back</a>
--}
+adminTemplate :: Html -> Text -> Html
+adminTemplate body title = H.docTypeHtml $ do
+    H.head $ do
+        H.link ! A.rel "stylesheet" ! A.type_ "text/css" ! A.href "/res/admin.css" ! A.media "all"
+        H.meta ! A.httpEquiv "content-type" ! A.content "text/html;charset=UTF-8"
+        H.title $ toHtml $ T.append "TazBlog Admin: " title
+    H.body
+        body
+
+adminLogin :: Html
+adminLogin = H.div ! A.class_ "loginBox" $ do
+    H.div ! A.class_ "loginBoxTop" $ "TazBlog Admin: Login"
+    H.div ! A.class_ "loginBoxMiddle" $ H.form ! A.action "/login" ! A.method "post" $ do
+        H.p $ "Account ID"
+        H.p $ H.input ! A.type_ "text" ! A.style "font-size: 2;" 
+            ! A.name "account" ! A.value "tazjin" ! A.readonly "1"
+        H.p $ "Passwort"
+        H.p $ H.input ! A.type_ "password" ! A.style "font-size: 2;" ! A.name "pass"
 
 -- Error pages
 showError :: BlogError -> BlogLang -> Html
diff --git a/src/Main.hs b/src/Main.hs
index d84e1d5332d0..4a42aae85dd8 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -43,6 +43,9 @@ tazBlog = do
          , path $ \(year :: Int) -> path $ \(month :: Int) -> path $ \(id_ :: String) -> formatOldLink year month id_
          , dir "res" $ serveDirectory DisableBrowsing [] "../res"
          , dir "notice" $ ok $ toResponse showSiteNotice
+         , do adminSession <- lookCookieValue "session"
+              ok $ toResponse ("Eingeloggt" :: String)
+         , dir "admin" $ ok $ toResponse $ adminTemplate adminLogin "Login"
          , serveDirectory DisableBrowsing [] "../res"
          ]