about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--res/admin.css5
-rw-r--r--src/Blog.hs25
-rw-r--r--src/Main.hs3
3 files changed, 25 insertions, 8 deletions
diff --git a/res/admin.css b/res/admin.css
index 7a4d418975ca..5225fe1033bc 100644
--- a/res/admin.css
+++ b/res/admin.css
@@ -40,10 +40,11 @@ body {
     border:1px solid #D2D2D2;
     border-bottom-left-radius: 12px;
     border-bottom-right-radius: 12px;
-	;
+	text-align: center;
     font-size:12px;
     height:auto;
+    padding-left: 10px;
+    padding-right: 10px;
     min-height:200px;
-    padding-left:20px;
     width:378px;
 }
\ No newline at end of file
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"
          ]