Permalink
Browse files

clean Echo

  • Loading branch information...
1 parent c40d463 commit 1ef8bff7a11e8eb4e17d7cf34ef546e6881bc04b @yogsototh committed Apr 11, 2012
Showing with 36 additions and 0 deletions.
  1. +1 −0 Application.hs
  2. +1 −0 Foundation.hs
  3. +8 −0 Handler/Echo.hs
  4. +1 −0 config/routes
  5. +23 −0 templates/default-layout.lucius
  6. +1 −0 templates/echo.hamlet
  7. +1 −0 yosog.cabal
View
1 Application.hs
@@ -23,6 +23,7 @@ import Network.HTTP.Conduit (newManager, def)
-- Import all relevant handler modules here.
import Handler.Home
+import Handler.Echo
-- This line actually creates our YesodSite instance. It is the second half
-- of the call to mkYesodData which occurs in Foundation.hs. Please see
View
1 Foundation.hs
@@ -31,6 +31,7 @@ import Model
import Text.Jasmine (minifym)
import Web.ClientSession (getKey)
import Text.Hamlet (hamletFile)
+import Data.Text
-- | The site argument for your application. This can be a good place to
-- keep settings and values requiring initialization before your application
View
8 Handler/Echo.hs
@@ -0,0 +1,8 @@
+module Handler.Echo where
+
+import Import
+
+getEchoR :: Text -> Handler RepHtml
+getEchoR theText = do
+ defaultLayout $ do
+ $(widgetFile "echo")
View
1 config/routes
@@ -5,3 +5,4 @@
/robots.txt RobotsR GET
/ HomeR GET POST
+/echo/#Text EchoR GET
View
23 templates/default-layout.lucius
@@ -0,0 +1,23 @@
+body {
+ font-family: Helvetica, sans-serif;
+ font-size: 18px; }
+#main {
+ padding: 1em;
+ border: #CCC solid 2px;
+ border-radius: 5px;
+ margin: 1em;
+ width: 37em;
+ margin: 1em auto;
+ background: #F2F2F2;
+ line-height: 1.5em;
+ color: #333; }
+.required { margin: 1em 0; }
+.optional { margin: 1em 0; }
+label { width: 8em; display: inline-block; }
+input, textarea { background: #FAFAFA}
+textarea { width: 27em; height: 9em;}
+ul { list-style: square; }
+a { color: #A56; }
+a:hover { color: #C58; }
+a:active { color: #C58; }
+a:visited { color: #943; }
View
1 templates/echo.hamlet
@@ -0,0 +1 @@
+<h1> #{theText}
View
1 yosog.cabal
@@ -33,6 +33,7 @@ library
Settings
Settings.StaticFiles
Handler.Home
+ Handler.Echo
ghc-options: -Wall -threaded -O0
cpp-options: -DDEVELOPMENT

0 comments on commit 1ef8bff

Please sign in to comment.