Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alsonkemp committed Nov 15, 2008
0 parents commit daaafff
Show file tree
Hide file tree
Showing 424 changed files with 61,494 additions and 0 deletions.
6 changes: 6 additions & 0 deletions App/Controllers/About.hs
@@ -0,0 +1,6 @@
module About (index) where

index :: Controller ()
index = return ()


6 changes: 6 additions & 0 deletions App/Controllers/Develop.hs
@@ -0,0 +1,6 @@
module Develop (index) where

index :: Controller ()
index = return ()


6 changes: 6 additions & 0 deletions App/Controllers/Download.hs
@@ -0,0 +1,6 @@
module Download (index) where

index :: Controller ()
index = return ()


6 changes: 6 additions & 0 deletions App/Controllers/Home.hs
@@ -0,0 +1,6 @@
module Home (index) where

index :: Controller ()
index = return () :: Controller ()


6 changes: 6 additions & 0 deletions App/Layouts/Default.hs
@@ -0,0 +1,6 @@
module Default (page) where

-- This is for XML, so doesn't do anything but insert the page
page :: View XML
page = insertView

64 changes: 64 additions & 0 deletions App/Layouts/oldDefault.hs
@@ -0,0 +1,64 @@
module Default (page) where
import qualified Network.URI as URI
import qualified Network.HTTP as HTTP

page :: View XML
page = <html>
<head>
<% styleSheet "extjs/css/ext-all" "screen"%>
<% styleSheet "turbinado" "screen"%>

<% javaScript "extjs/adapter/ext/ext-base" %>
<% javaScript "ext-all" %>
<% googleAnalytics "UA-6158816-1" %>

<script type="text/javascript">
Ext.onReady(function(){
var tabs = new Ext.TabPanel({
renderTo: 'content-block',
//width:450,
activeTab: 0,
frame:true,
autoHeight: true,
autoWidth: true,
layout: 'fit',
defaults:{autoHeight: true},
items:[
{autoLoad: '/Home/Index.xml', title: 'Home'}
, {autoLoad: '/Develop/Index.xml', title: 'Develop'}
, {autoLoad: '/Tutorial/Index.xml', title: 'Tutorial'}
, {autoLoad: '/Code/Index.xml', title: 'Code'}
]
});
});
</script>
</head>
<body>
<div class="wrapper">
<div class="title">
<h1 style="display: inline">Turbinado</h1>
<h2 style="display: inline">web sugar</h2>
</div>
<hr />
<div class="container">
<div id="content-block" class="content-block">
</div>
</div>
<hr id="hr-footer" />
<div class="footer">
Footer
</div>
</div>
</body>
</html>

anchorWithImage :: String -> String -> View XML
anchorWithImage l i = <a href=l>
<img src=i height="100" />
</a>

anchorWithText :: String -> String -> View XML
anchorWithText l t = <a href=l>
<% t %>
</a>

21 changes: 21 additions & 0 deletions App/Views/About/Index.hs
@@ -0,0 +1,21 @@
onRender = <div>
<h2>Features</h2>
<p>Turbinado gives you all of the benefits of coding in Haskell and adds:</p>
<ul class="standard-list">
<li> Automagic recompilation of Layouts, Pages and Controls; </li>
<li> A database <% anchorTag "http://en.wikipedia.org/wiki/Object-relational_mapping" "ORM" %> to make database interaction (especially with PostgreSQL) joyful; </li>
<li> A rich set of tags to make designing pages simpler;. </li>
</ul>

<h2>... On The Backs of Giants ... </h2>
<p>Turbinado wouldn't be possible without the original work of the following people:</p>
<ul class="standard-list">
<li> <% anchorTag "http://www.cs.chalmers.se/~d00nibro/" "Niklas Broberg" %> for Haskell Server Pages, the HSP Runtime, Haskell Source Extensions and Haskell Regular Expressions</li>
<li> <% anchorTag "http://www.cse.unsw.edu.au/~dons/hs-plugins/" "Don Stewart" %> for hs-plugins </li>
<li> <% anchorTag "http://www.cs.chalmers.se/~bringert/projects.html" "Bjorn Bringert" %> for HTTP </li>
<li> <% anchorTag "http://software.complete.org/software/projects/show/hdbc" "John Goerzen" %> for Haskell Database Connectivity.</li>
<li> <% anchorTag "http://software.complete.org/software/projects/show/hdbc" "John Goerzen" %> for Haskell Database Connectivity.</li>

</ul>

</div>
43 changes: 43 additions & 0 deletions App/Views/Develop/Index.hs
@@ -0,0 +1,43 @@
module Index (page) where

page :: View XML
page = <div>
<h2>! Windows</h2>
<p>This software doesn't work on Windows. Linux/Unix only at this point.</p>

<h2>Darcs</h2>
<p> The <em>darcs</em> repo is at <% anchorTag "http://darcs.turbinado.org" "darcs.turbinado.org" %>. Send commits to maintainer@turbinado.org</p>

<h2>Dependencies</h2>
<p>You'll need the following:</p>
<ul class="standard-list">
<li><% anchorTag "http://www.haskell.org/ghc" "GHC" %>
<em> (darcs) </em>
</li>

<li><% anchorTag "http://code.haskell.org/HSP/haskell-src-exts/" "haskell-src-exts" %>
<em> (darcs) </em>
</li>

<li><% anchorTag "http://code.haskell.org/HSP/harp/" "harp" %>
<em> (darcs) </em>
</li>

<li><% anchorTag "http://git.complete.org/hslogger" "hslogger" %>
<em> (git) </em>
</li>

<li><% anchorTag "http://code.haskell.org/HSP/hsx/" "hsx" %>
<em> (darcs) </em>
</li>

<li><% anchorTag "http://code.haskell.org/hs-plugins" "hs-plugins" %>
<em> (darcs) </em>
</li>

<li><% anchorTag "http://code.haskell.org/http" "http" %>
<em> (darcs) </em>
</li>

</ul>
</div>
11 changes: 11 additions & 0 deletions App/Views/Download/Index.hs
@@ -0,0 +1,11 @@
module Index (page) where

page :: View XML
page = <div>
<h2>DANGER WILL ROBINSON</h2>
<p>Developers only at this point!</p>
<p>That said, we're looking for help. Interested? Check out the
<% anchorTag "/Develop" "Development" %> section. Grab the code, look it over and tell us
how you would improve it.
</p>
</div>
17 changes: 17 additions & 0 deletions App/Views/Home/Index.hs
@@ -0,0 +1,17 @@
module Index (page) where

import System.Time

page :: View XML
page = <div>
<h2>Turbinado?</h2>
<div style="float:right">
<img src="http://upload.wikimedia.org/wikipedia/en/thumb/0/0e/TurbinadoSugar.jpg/757px-TurbinadoSugar.jpg" width="300" />
</div>
<p> <a href="http://en.wikipedia.org/wiki/Turbinado">Turbinado</a> is that yummy, not-so-refined sugar.
Sounds like Haskell... Sounds like this framework...</p>
<p> Turbinado is also an easy-to-use web application framework for Haskell.</p>

<h2>Why</h2>
<p>Haskell has no easy-to-use web framework. Turbinado is an effort to build one by lazily stealing the best ideas from <% anchorTag "www.rubyonrails.org" "Ruby On Rails" %>, <% anchorTag "www.asp.net" "ASP.NET" %>, etc.</p>
</div>
7 changes: 7 additions & 0 deletions App/Views/Source.hs
@@ -0,0 +1,7 @@
import System.Time

onRender = <div>
<pre>

</pre>
</div>
23 changes: 23 additions & 0 deletions Config/App.hs
@@ -0,0 +1,23 @@
module Config.App where

import System.Log.Logger

----------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------
applicationPath = ""
applicationHost = "localhost:8080"

----------------------------------------------------------------
-- RequestHandler Filter List additions
----------------------------------------------------------------
customPreFilters = []
customPostFilters = []


----------------------------------------------------------------
-- Logging
----------------------------------------------------------------
logLevel = DEBUG -- DEBUG < INFO < NOTICE < WARNING < ERROR < CRITICAL < ALERT < EMERGENCY


41 changes: 41 additions & 0 deletions Config/Master.hs
@@ -0,0 +1,41 @@
module Config.Master (
module Config.Master,
module Config.App,
Turbinado.Server.Handlers.SessionHandlers.Simple.getSessionHandler
) where

import Turbinado.Server.Handlers.SessionHandlers.Simple
import Config.App

----------------------------------------------------------------
-- Arguments to the make system used in the Dynamic Loader
----------------------------------------------------------------

compileArgs =
[ "-fglasgow-exts"
, "-fallow-overlapping-instances"
, "-fallow-undecidable-instances"
, "-F", "-pgmFtrhsx"
, "-fno-warn-overlapping-patterns"
] ++ (map ("-i"++) searchDirs)

mUserPkgConf = [""]

----------------------------------------------------------------
-- Paths
----------------------------------------------------------------

viewDir = "App/Views"
viewStub = "Turbinado/Stubs/View.hs"
layoutDir = "App/Layouts"
layoutStub = "Turbinado/Stubs/Layout.hs"
controllerDir = "App/Controllers"
controllerStub = "Turbinado/Stubs/Controller.hs"

configDir = "Config"
searchDirs = [viewDir, layoutDir, controllerDir, rootDir, configDir, compiledDir]

staticDirs = ["static", "tmp/cache"]
compiledDir = "tmp/compiled"

rootDir = "./"
6 changes: 6 additions & 0 deletions Config/Routes.hs
@@ -0,0 +1,6 @@
module Config.Routes where

routes = [ "/:controller/:action.:format"
, "/:controller/:action"
, "/:controller"
]

0 comments on commit daaafff

Please sign in to comment.