about summary refs log tree commit diff
path: root/src/Blog.hs
diff options
context:
space:
mode:
authorVincent Ambo <v.ambo@me.com>2012-03-13T23·37+0100
committerVincent Ambo <v.ambo@me.com>2012-03-13T23·37+0100
commite6746984f585168229d902096e22177a6e55a6c2 (patch)
tree9f04039b20801d56e0da9bf9c232fb87a4cb05d6 /src/Blog.hs
parentf6446aec725234ea38b5431defa8e4c987e07f20 (diff)
* changed comment structure to sort by UTCTime
* postEntry function done; adminHandler doesn't work?
Diffstat (limited to 'src/Blog.hs')
-rw-r--r--src/Blog.hs27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/Blog.hs b/src/Blog.hs
index da8dd24dc62f..8e4c76b621e1 100644
--- a/src/Blog.hs
+++ b/src/Blog.hs
@@ -155,8 +155,8 @@ showSiteNotice = H.docTypeHtml $ do
 
 {- Administration pages -}
 
-adminTemplate :: Html -> Text -> Html
-adminTemplate body title = H.docTypeHtml $ do
+adminTemplate :: Text -> Html -> Html
+adminTemplate title body = 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"
@@ -165,7 +165,8 @@ adminTemplate body title = H.docTypeHtml $ do
         body
 
 adminLogin :: Html
-adminLogin = H.div ! A.class_ "loginBox" $ do
+adminLogin = adminTemplate "Login" $
+  H.div ! A.class_ "loginBox" $ do
     H.div ! A.class_ "loginBoxTop" $ "TazBlog Admin: Login"
     H.div ! A.class_ "loginBoxMiddle" $ H.form ! A.action "/dologin" ! A.method "post" $ do
         H.p $ "Account ID"
@@ -175,6 +176,26 @@ adminLogin = H.div ! A.class_ "loginBox" $ do
         H.p $ H.input ! A.type_ "password" ! A.style "font-size: 2;" ! A.name "password"
         H.p $ H.input ! A.alt "Anmelden" ! A.type_ "image" ! A.src "/res/signin.gif"
 
+adminIndex :: Text -> Html
+adminIndex sUser = adminTemplate "Index" $
+  H.div ! A.style "float: center;" $
+    H.form ! A.action "/admin/postentry" ! A.method "POST" $ do
+      H.table $ do
+        H.tr $ do H.td $ "Titel:"
+                  H.td $ H.input ! A.type_ "text" ! A.name "title"
+        H.tr $ do H.td $ "Sprache:"
+                  H.td $ H.select ! A.name "lang" $ do
+                    H.option ! A.value "de" $ "Deutsch"
+                    H.option ! A.value "en" $ "Englisch"
+        H.tr $ do H.td ! A.style "vertical-align: top;" $ "Text:"
+                  H.td $ H.textarea ! A.name "btext" ! A.cols "100" ! A.rows "15" $ mempty
+        H.tr $ do H.td ! A.style "vertical-align: top;" $ "Mehr Text:"
+                  H.td $ H.textarea ! A.name "mtext" ! A.cols "100" ! A.rows "15" $ mempty
+      H.input ! A.type_ "hidden" ! A.name "author" ! A.value (toValue sUser)
+      H.input ! A.style "margin-left: 20px" ! A.type_ "submit" ! A.value "Absenden"
+      H.p $ do preEscapedText "<a href=/>Startseite</a> -- Entrylist: <a href=/admin/entrylist/de>DE</a>"
+               preEscapedText " & <a href=/admin/entrylist/en>EN</a> -- <a href=#>Backup</a> (NYI)"
+
 -- Error pages
 showError :: BlogError -> BlogLang -> Html
 showError NotFound l = undefined