Permalink
Browse files

syncing with website

  • Loading branch information...
1 parent d0e3234 commit db5709558c650cfcf7bae5860af33c811b562046 @alsonkemp committed Jan 19, 2009
Showing with 8 additions and 4 deletions.
  1. +2 −2 Config/Master.hs
  2. +4 −0 Turbinado/Environment/Settings.hs
  3. +2 −2 Turbinado/View.hs
View
@@ -34,9 +34,9 @@ viewDir = "App/Views"
viewStub = "Turbinado/Stubs/View.hs"
controllerDir = "App/Controllers"
controllerStub = "Turbinado/Stubs/Controller.hs"
-componentViewDir = "App/Components/Views"
+componentViewDir = "App/Components"
componentViewStub = "Turbinado/Stubs/ComponentView.hs"
-componentControllerDir = "App/Components/Controllers"
+componentControllerDir = "App/Components"
componentControllerStub = "Turbinado/Stubs/ComponentController.hs"
staticDirs = ["static", "tmp/cache"]
@@ -80,6 +80,10 @@ getController = do c <- getSetting_u "controller"
actionName a)
where actionName s = (toLower $ head s) : (tail s)
+-- | Tells the 'Controller' to use a particular 'Layout' for the 'View'.
+setLayout :: (HasEnvironment m) => String -> m ()
+setLayout l = setSetting "layout" l
+
-- | Tells the 'Controller' not to use a 'Layout' for the 'View'.
clearLayout :: (HasEnvironment m) => m ()
clearLayout = unsetSetting "layout"
View
@@ -84,7 +84,7 @@ insertView c a =
insertComponent :: String -> String -> [(String, String)] -> View XML
insertComponent controller action opts =
do debugM $ " insertComponent: Starting"
- p <- retrieveCode CTComponentController (controller, (toLower $ head action) : (tail action))
+ p <- retrieveCode CTComponentController (joinPath [controller,"Controller"], (toLower $ head action) : (tail action))
case p of
CodeLoadMissing -> return $ cdata $ "insertComponent error: code missing : " ++ controller ++ " - " ++ action
CodeLoadFailure e -> return $ cdata $ "insertComponent error: " ++ e
@@ -100,7 +100,7 @@ insertComponent controller action opts =
insertComponentView :: Environment -> String -> String -> View XML
insertComponentView oldE controller action =
do debugM $ " insertComponentView: Starting"
- v <- retrieveCode CTComponentView (joinPath [controller, action], "markup")
+ v <- retrieveCode CTComponentView (joinPath [controller, "Views", action], "markup")
case v of
CodeLoadMissing -> do setEnvironment oldE
return $ cdata $ "insertComponentView error: code missing : " ++ (joinPath [controller, action]) ++ " - markup"

0 comments on commit db57095

Please sign in to comment.