yesod 0.9.3 → 0.9.3.1
raw patch · 34 files changed
+620/−558 lines, 34 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Build.hs +1/−1
- Scaffolding/Scaffolder.hs +23/−18
- scaffold/Application.hs.cg +1/−5
- scaffold/Foundation.hs.cg +2/−4
- scaffold/Handler/Root.hs.cg +1/−2
- scaffold/Import.hs.cg +18/−0
- scaffold/Model.hs.cg +1/−1
- scaffold/Settings.hs.cg +2/−4
- scaffold/Settings/StaticFiles.hs.cg +0/−1
- scaffold/config/models.cg +1/−0
- scaffold/config/robots.txt.cg +1/−0
- scaffold/hamlet/boilerplate-layout.hamlet.cg +0/−33
- scaffold/hamlet/default-layout-wrapper.hamlet.cg +0/−8
- scaffold/hamlet/default-layout.hamlet.cg +0/−4
- scaffold/hamlet/homepage.hamlet.cg +0/−2
- scaffold/julius/homepage.julius.cg +0/−2
- scaffold/lucius/default-layout.lucius.cg +0/−4
- scaffold/lucius/homepage.lucius.cg +0/−7
- scaffold/lucius/normalize.lucius.cg +0/−439
- scaffold/main.hs.cg +1/−0
- scaffold/project.cabal.cg +24/−1
- scaffold/templates/boilerplate-wrapper.hamlet.cg +42/−0
- scaffold/templates/default-layout-wrapper.hamlet.cg +8/−0
- scaffold/templates/default-layout.hamlet.cg +4/−0
- scaffold/templates/default-layout.lucius.cg +4/−0
- scaffold/templates/homepage.hamlet.cg +2/−0
- scaffold/templates/homepage.julius.cg +2/−0
- scaffold/templates/homepage.lucius.cg +7/−0
- scaffold/templates/normalize.lucius.cg +439/−0
- scaffold/tiny/Application.hs.cg +1/−5
- scaffold/tiny/Foundation.hs.cg +2/−3
- scaffold/tiny/Settings.hs.cg +2/−4
- scaffold/tiny/project.cabal.cg +20/−1
- yesod.cabal +11/−9
Build.hs view
@@ -125,7 +125,7 @@ A.Fail{} -> return [] A.Done _ r -> mapM go r >>= filterM doesFileExist . concat where- go (Just (Hamlet, f)) = return [f, "hamlet/" ++ f ++ ".hamlet"]+ go (Just (Hamlet, f)) = return [f, "templates/" ++ f ++ ".hamlet"] go (Just (Verbatim, f)) = return [f] go (Just (Messages f, _)) = return [f] go (Just (StaticFiles fp, _)) = getFolderContents fp
Scaffolding/Scaffolder.hs view
@@ -95,7 +95,7 @@ case backend of MongoDB -> "mongoDB" Sqlite -> "sqlite"- Postgresql -> "postgres"+ Postgresql -> "postgresql" Tiny -> error "Accessing dbConfigFile for Tiny" let configPersist =@@ -128,10 +128,7 @@ mkDir fp = createDirectoryIfMissing True $ dir ++ '/' : fp mkDir "Handler"- mkDir "hamlet"- mkDir "cassius"- mkDir "lucius"- mkDir "julius"+ mkDir "templates" mkDir "static" mkDir "static/css" mkDir "static/js"@@ -158,25 +155,29 @@ writeFile' ".ghci" $(codegen ".ghci") writeFile' "LICENSE" $(codegen "LICENSE") writeFile' ("Foundation.hs") $ ifTiny $(codegen "tiny/Foundation.hs") $(codegen "Foundation.hs")+ writeFile' "Import.hs" $(codegen "Import.hs") writeFile' "Application.hs" $ ifTiny $(codegen "tiny/Application.hs") $(codegen "Application.hs") writeFile' "Handler/Root.hs" $(codegen "Handler/Root.hs") unless isTiny $ writeFile' "Model.hs" $(codegen "Model.hs") writeFile' "Settings.hs" $ ifTiny $(codegen "tiny/Settings.hs") $(codegen "Settings.hs") writeFile' "Settings/StaticFiles.hs" $(codegen "Settings/StaticFiles.hs")- writeFile' "lucius/default-layout.lucius"- $(codegen "lucius/default-layout.lucius")- writeFile' "hamlet/default-layout.hamlet"- $(codegen "hamlet/default-layout.hamlet")- writeFile' "hamlet/default-layout-wrapper.hamlet"- $(codegen "hamlet/default-layout-wrapper.hamlet")- writeFile' "hamlet/boilerplate-layout.hamlet"- $(codegen "hamlet/boilerplate-layout.hamlet")- writeFile' "lucius/normalize.lucius"- $(codegen "lucius/normalize.lucius")- writeFile' "hamlet/homepage.hamlet" $(codegen "hamlet/homepage.hamlet")+ writeFile' "templates/default-layout.lucius"+ $(codegen "templates/default-layout.lucius")+ writeFile' "templates/default-layout.hamlet"+ $(codegen "templates/default-layout.hamlet")+ writeFile' "templates/default-layout-wrapper.hamlet"+ $(codegen "templates/default-layout-wrapper.hamlet")+ writeFile' "templates/boilerplate-wrapper.hamlet"+ $(codegen "templates/boilerplate-wrapper.hamlet")+ writeFile' "templates/normalize.lucius"+ $(codegen "templates/normalize.lucius")+ writeFile' "templates/homepage.hamlet"+ $(codegen "templates/homepage.hamlet") writeFile' "config/routes" $ ifTiny $(codegen "tiny/config/routes") $(codegen "config/routes")- writeFile' "lucius/homepage.lucius" $(codegen "lucius/homepage.lucius")- writeFile' "julius/homepage.julius" $(codegen "julius/homepage.julius")+ writeFile' "templates/homepage.lucius"+ $(codegen "templates/homepage.lucius")+ writeFile' "templates/homepage.julius"+ $(codegen "templates/homepage.julius") unless isTiny $ writeFile' "config/models" $(codegen "config/models") writeFile' "messages/en.msg" $(codegen "messages/en.msg") @@ -188,5 +189,9 @@ $(runIO (S.readFile "scaffold/config/favicon.ico.cg") >>= \bs -> do pack <- [|S.pack|] return $ pack `AppE` LitE (StringL $ S.unpack bs))++ S.writeFile (dir ++ "/config/robots.txt")+ $(runIO (S.readFile "scaffold/config/robots.txt.cg") >>= \bs -> do+ [|S.pack $(return $ LitE $ StringL $ S.unpack bs)|]) puts $(codegenDir "input" "done")
scaffold/Application.hs.cg view
@@ -1,13 +1,10 @@-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( with~sitearg~ , withDevelAppPort ) where -import Foundation+import Import import Settings import Yesod.Static import Yesod.Auth@@ -15,7 +12,6 @@ import Yesod.Default.Main import Yesod.Default.Handlers import Yesod.Logger (Logger)-import Data.ByteString (ByteString) import Data.Dynamic (Dynamic, toDyn) import qualified Database.Persist.Base~importMigration~
scaffold/Foundation.hs.cg view
@@ -1,6 +1,3 @@-{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-}-{-# LANGUAGE OverloadedStrings, MultiParamTypeClasses #-}-{-# LANGUAGE CPP #-} module Foundation ( ~sitearg~ (..) , ~sitearg~Route (..)@@ -17,6 +14,7 @@ , AuthRoute (..) ) where +import Prelude import Yesod import Yesod.Static (Static, base64md5, StaticRoute(..)) import Settings.StaticFiles@@ -95,7 +93,7 @@ pc <- widgetToPageContent $ do $(widgetFile "normalize") $(widgetFile "default-layout")- hamletToRepHtml $(hamletFile "hamlet/default-layout-wrapper.hamlet")+ hamletToRepHtml $(hamletFile "templates/default-layout-wrapper.hamlet") -- This is done to provide an optimization for serving static files from -- a separate domain. Please see the staticRoot setting in Settings.hs
scaffold/Handler/Root.hs.cg view
@@ -1,7 +1,6 @@-{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-} module Handler.Root where -import Foundation+import Import -- This is a handler function for the GET request method on the RootR -- resource pattern. All of your resource patterns are defined in
+ scaffold/Import.hs.cg view
@@ -0,0 +1,18 @@+module Import+ ( module Prelude+ , module Foundation+ , (<>)+ , Text+ , module Data.Monoid+ , module Control.Applicative+ ) where++import Prelude hiding (writeFile, readFile)+import Foundation+import Data.Monoid (Monoid (mappend, mempty, mconcat))+import Control.Applicative ((<$>), (<*>), pure)+import Data.Text (Text)++infixr 5 <>+(<>) :: Monoid m => m -> m -> m+(<>) = mappend
scaffold/Model.hs.cg view
@@ -1,6 +1,6 @@-{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving, TemplateHaskell, GADTs #-} module Model where +import Prelude import Yesod import Data.Text (Text) ~modelImports~
scaffold/Settings.hs.cg view
@@ -1,6 +1,3 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}-{-# LANGUAGE OverloadedStrings #-} -- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod@@ -13,6 +10,7 @@ , staticDir ) where +import Prelude (FilePath, String) import Text.Shakespeare.Text (st) import Language.Haskell.TH.Syntax import Database.Persist.~importPersist~ (~configPersist~)@@ -44,7 +42,7 @@ -- -- To see how this value is used, see urlRenderOverride in Foundation.hs staticRoot :: AppConfig DefaultEnv -> Text-staticRoot conf = [st|#{appRoot conf}/static|]+staticRoot conf = [~qq~st|#{appRoot conf}/static|] -- The rest of this file contains settings which rarely need changing by a
scaffold/Settings/StaticFiles.hs.cg view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP, QuasiQuotes, TemplateHaskell, TypeFamilies #-} module Settings.StaticFiles where import Yesod.Static (staticFiles, StaticRoute (StaticRoute))
scaffold/config/models.cg view
@@ -8,3 +8,4 @@ verkey Text Maybe UniqueEmail email + -- By default this file is used in Model.hs (which is imported by Foundation.hs)
+ scaffold/config/robots.txt.cg view
@@ -0,0 +1,1 @@+User-agent: *
− scaffold/hamlet/boilerplate-layout.hamlet.cg
@@ -1,33 +0,0 @@-\<!doctype html> -\<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> -\<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> -\<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> -\<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> -\<!--[if (gt IE 9)|!(IE)]><!-->-<html lang="en" class="no-js"><!--<![endif]--> - <head>- <meta charset="UTF-8">- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">- <meta name="viewport" content="width=device-width, initial-scale=1.0">- - <meta name="description" content="">- <meta name="author" content="">-- <title>#{pageTitle pc}-- ^{pageHead pc}- - <!--[if lt IE 9]>- <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>- <![endif]--> -- <script>- document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/,'js');- <body>- <div id="container">- <header>- <div id="main" role="main">- $maybe msg <- mmsg- <div #message>#{msg}- ^{pageBody pc}- <footer>
− scaffold/hamlet/default-layout-wrapper.hamlet.cg
@@ -1,8 +0,0 @@-!!!-<html>- <head- <title>#{pageTitle pc}- ^{pageHead pc}- <body- ^{pageBody pc}-
− scaffold/hamlet/default-layout.hamlet.cg
@@ -1,4 +0,0 @@-$maybe msg <- mmsg- <div #message>#{msg}-^{widget}-
− scaffold/hamlet/homepage.hamlet.cg
@@ -1,2 +0,0 @@-<h1>_{MsgHello}-<h2 ##{h2id}>You do not have Javascript enabled.
− scaffold/julius/homepage.julius.cg
@@ -1,2 +0,0 @@-document.getElementById("#{h2id}").innerHTML = "<i>Added from JavaScript.</i>";-
− scaffold/lucius/default-layout.lucius.cg
@@ -1,4 +0,0 @@-body {- font-family: sans-serif;-}-
− scaffold/lucius/homepage.lucius.cg
@@ -1,7 +0,0 @@-h1 {- text-align: center-}-h2##{h2id} {- color: #990-}-
− scaffold/lucius/normalize.lucius.cg
@@ -1,439 +0,0 @@-/*! normalize.css 2011-08-12T17:28 UTC · http://github.com/necolas/normalize.css */--/* =============================================================================- HTML5 display definitions- ========================================================================== */--/*- * Corrects block display not defined in IE6/7/8/9 & FF3- */--article,-aside,-details,-figcaption,-figure,-footer,-header,-hgroup,-nav,-section {- display: block;-}--/*- * Corrects inline-block display not defined in IE6/7/8/9 & FF3- */--audio,-canvas,-video {- display: inline-block;- *display: inline;- *zoom: 1;-}--/*- * Prevents modern browsers from displaying 'audio' without controls- */--audio:not([controls]) {- display: none;-}--/*- * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4- * Known issue: no IE6 support- */--[hidden] {- display: none;-}---/* =============================================================================- Base- ========================================================================== */--/*- * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units- * http://clagnut.com/blog/348/#c790- * 2. Keeps page centred in all browsers regardless of content height- * 3. Prevents iOS text size adjust after orientation change, without disabling user zoom- * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/- */--html {- font-size: 100%; /* 1 */- overflow-y: scroll; /* 2 */- -webkit-text-size-adjust: 100%; /* 3 */- -ms-text-size-adjust: 100%; /* 3 */-}--/*- * Addresses margins handled incorrectly in IE6/7- */--body {- margin: 0;-}--/* - * Addresses font-family inconsistency between 'textarea' and other form elements.- */--body,-button,-input,-select,-textarea {- font-family: sans-serif;-}---/* =============================================================================- Links- ========================================================================== */--a {- color: #00e;-}--a:visited {- color: #551a8b;-}--/*- * Addresses outline displayed oddly in Chrome- */--a:focus {- outline: thin dotted;-}--/*- * Improves readability when focused and also mouse hovered in all browsers- * people.opera.com/patrickl/experiments/keyboard/test- */--a:hover,-a:active {- outline: 0;-}---/* =============================================================================- Typography- ========================================================================== */--/*- * Addresses styling not present in IE7/8/9, S5, Chrome- */--abbr[title] {- border-bottom: 1px dotted;-}--/*- * Addresses style set to 'bolder' in FF3/4, S4/5, Chrome-*/--b, -strong { - font-weight: bold; -}--blockquote {- margin: 1em 40px;-}--/*- * Addresses styling not present in S5, Chrome- */--dfn {- font-style: italic;-}--/*- * Addresses styling not present in IE6/7/8/9- */--mark {- background: #ff0;- color: #000;-}--/*- * Corrects font family set oddly in IE6, S4/5, Chrome- * en.wikipedia.org/wiki/User:Davidgothberg/Test59- */--pre,-code,-kbd,-samp {- font-family: monospace, serif;- _font-family: 'courier new', monospace;- font-size: 1em;-}--/*- * Improves readability of pre-formatted text in all browsers- */--pre {- white-space: pre;- white-space: pre-wrap;- word-wrap: break-word;-}--/*- * 1. Addresses CSS quotes not supported in IE6/7- * 2. Addresses quote property not supported in S4- */--/* 1 */--q {- quotes: none;-}--/* 2 */--q:before,-q:after {- content: '';- content: none;-}--small {- font-size: 75%;-}--/*- * Prevents sub and sup affecting line-height in all browsers- * gist.github.com/413930- */--sub,-sup {- font-size: 75%;- line-height: 0;- position: relative;- vertical-align: baseline;-}--sup {- top: -0.5em;-}--sub {- bottom: -0.25em;-}---/* =============================================================================- Lists- ========================================================================== */--ul,-ol {- margin: 1em 0;- padding: 0 0 0 40px;-}--dd {- margin: 0 0 0 40px;-}--nav ul,-nav ol {- list-style: none;- list-style-image: none;-}---/* =============================================================================- Embedded content- ========================================================================== */--/*- * 1. Removes border when inside 'a' element in IE6/7/8/9- * 2. Improves image quality when scaled in IE7- * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/- */--img {- border: 0; /* 1 */- -ms-interpolation-mode: bicubic; /* 2 */-}--/*- * Corrects overflow displayed oddly in IE9 - */--svg:not(:root) {- overflow: hidden;-}---/* =============================================================================- Figures- ========================================================================== */--/*- * Addresses margin not present in IE6/7/8/9, S5, O11- */--figure {- margin: 0;-}---/* =============================================================================- Forms- ========================================================================== */--/*- * Corrects margin displayed oddly in IE6/7- */--form {- margin: 0;-}--/*- * Define consistent margin and padding- */--fieldset {- margin: 0 2px;- padding: 0.35em 0.625em 0.75em;-}--/*- * 1. Corrects color not being inherited in IE6/7/8/9- * 2. Corrects alignment displayed oddly in IE6/7- */--legend {- border: 0; /* 1 */- *margin-left: -7px; /* 2 */-}--/*- * 1. Corrects font size not being inherited in all browsers- * 2. Addresses margins set differently in IE6/7, F3/4, S5, Chrome- * 3. Improves appearance and consistency in all browsers- */--button,-input,-select,-textarea {- font-size: 100%; /* 1 */- margin: 0; /* 2 */- vertical-align: baseline; /* 3 */- *vertical-align: middle; /* 3 */-}--/*- * 1. Addresses FF3/4 setting line-height using !important in the UA stylesheet- * 2. Corrects inner spacing displayed oddly in IE6/7- */--button,-input {- line-height: normal; /* 1 */- *overflow: visible; /* 2 */-}--/*- * Corrects overlap and whitespace issue for buttons and inputs in IE6/7- * Known issue: reintroduces inner spacing- */--table button,-table input {- *overflow: auto;-}--/*- * 1. Improves usability and consistency of cursor style between image-type 'input' and others- * 2. Corrects inability to style clickable 'input' types in iOS- */--button,-html input[type="button"], -input[type="reset"], -input[type="submit"] {- cursor: pointer; /* 1 */- -webkit-appearance: button; /* 2 */-}--/*- * 1. Addresses box sizing set to content-box in IE8/9- * 2. Addresses excess padding in IE8/9- */--input[type="checkbox"],-input[type="radio"] {- box-sizing: border-box; /* 1 */- padding: 0; /* 2 */-}--/*- * 1. Addresses appearance set to searchfield in S5, Chrome- * 2. Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof)- */--input[type="search"] {- -webkit-appearance: textfield; /* 1 */- -moz-box-sizing: content-box;- -webkit-box-sizing: content-box; /* 2 */- box-sizing: content-box;-}--/*- * Corrects inner padding displayed oddly in S5, Chrome on OSX- */--input[type="search"]::-webkit-search-decoration {- -webkit-appearance: none;-}--/*- * Corrects inner padding and border displayed oddly in FF3/4- * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/- */--button::-moz-focus-inner,-input::-moz-focus-inner {- border: 0;- padding: 0;-}--/*- * 1. Removes default vertical scrollbar in IE6/7/8/9- * 2. Improves readability and alignment in all browsers- */--textarea {- overflow: auto; /* 1 */- vertical-align: top; /* 2 */-}---/* =============================================================================- Tables- ========================================================================== */--/* - * Remove most spacing between table cells- */--table {- border-collapse: collapse;- border-spacing: 0;-}
scaffold/main.hs.cg view
@@ -1,6 +1,7 @@ import Yesod.Default.Config (fromArgs) import Yesod.Default.Main (defaultMain) import Application (with~sitearg~)+import Prelude (IO) main :: IO () main = defaultMain fromArgs with~sitearg~
scaffold/project.cabal.cg view
@@ -28,6 +28,7 @@ exposed-modules: Application other-modules: Foundation+ Import Model Settings Settings.StaticFiles@@ -35,6 +36,17 @@ ghc-options: -Wall -threaded -O0 + extensions: TemplateHaskell+ QuasiQuotes+ OverloadedStrings+ NoImplicitPrelude+ CPP+ OverloadedStrings+ MultiParamTypeClasses+ TypeFamilies+ GADTs+ GeneralizedNewtypeDeriving+ executable ~project~ if flag(devel) Buildable: False@@ -47,12 +59,23 @@ main-is: main.hs + extensions: TemplateHaskell+ QuasiQuotes+ OverloadedStrings+ NoImplicitPrelude+ CPP+ OverloadedStrings+ MultiParamTypeClasses+ TypeFamilies+ GADTs+ GeneralizedNewtypeDeriving+ build-depends: base >= 4 && < 5 , yesod >= 0.9 && < 0.10 , yesod-core >= 0.9.3 && < 0.10 , yesod-auth >= 0.7.3 && < 0.8 , yesod-static >= 0.3.1 && < 0.4- , yesod-default >= 0.3.1 && < 0.4+ , yesod-default >= 0.4 && < 0.5 , yesod-form >= 0.3.3 && < 0.4 , mime-mail >= 0.3.0.3 && < 0.4 , clientsession >= 0.7.3 && < 0.8
+ scaffold/templates/boilerplate-wrapper.hamlet.cg view
@@ -0,0 +1,42 @@+\<!doctype html>+\<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->+\<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->+\<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->+\<!--[if gt IE 8]><!-->+<html class="no-js" lang="en"> <!--<![endif]-->+ <head>+ <meta charset="UTF-8">++ <title>#{pageTitle pc}+ <meta name="description" content="">+ <meta name="author" content="">++ <meta name="viewport" content="width=device-width,initial-scale=1">++ ^{pageHead pc}++ \<!--[if lt IE 9]>+ \<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>+ \<![endif]-->++ <script>+ document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/,'js');+ <body>+ <div id="container">+ <header>+ <div id="main" role="main">+ ^{pageBody pc}+ <footer>++ \<!-- Change UA-XXXXX-X to be your site's ID -->+ <script>+ window._gaq = [['_setAccount','UAXXXXXXXX1'],['_trackPageview'],['_trackPageLoadTime']];+ YepNope.load({+ \ load: ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js'+ });+ \<!-- Prompt IE 6 users to install Chrome Frame. Remove this if you want to support IE 6. chromium.org/developers/how-tos/chrome-frame-getting-started -->+ \<!--[if lt IE 7 ]>+ <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js">+ <script>+ window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})+ \<![endif]-->
+ scaffold/templates/default-layout-wrapper.hamlet.cg view
@@ -0,0 +1,8 @@+!!!+<html>+ <head+ <title>#{pageTitle pc}+ ^{pageHead pc}+ <body+ ^{pageBody pc}+
+ scaffold/templates/default-layout.hamlet.cg view
@@ -0,0 +1,4 @@+$maybe msg <- mmsg+ <div #message>#{msg}+^{widget}+
+ scaffold/templates/default-layout.lucius.cg view
@@ -0,0 +1,4 @@+body {+ font-family: sans-serif;+}+
+ scaffold/templates/homepage.hamlet.cg view
@@ -0,0 +1,2 @@+<h1>_{MsgHello}+<h2 ##{h2id}>You do not have Javascript enabled.
+ scaffold/templates/homepage.julius.cg view
@@ -0,0 +1,2 @@+document.getElementById("#{h2id}").innerHTML = "<i>Added from JavaScript.</i>";+
+ scaffold/templates/homepage.lucius.cg view
@@ -0,0 +1,7 @@+h1 {+ text-align: center+}+h2##{h2id} {+ color: #990+}+
+ scaffold/templates/normalize.lucius.cg view
@@ -0,0 +1,439 @@+/*! normalize.css 2011-08-12T17:28 UTC · http://github.com/necolas/normalize.css */++/* =============================================================================+ HTML5 display definitions+ ========================================================================== */++/*+ * Corrects block display not defined in IE6/7/8/9 & FF3+ */++article,+aside,+details,+figcaption,+figure,+footer,+header,+hgroup,+nav,+section {+ display: block;+}++/*+ * Corrects inline-block display not defined in IE6/7/8/9 & FF3+ */++audio,+canvas,+video {+ display: inline-block;+ *display: inline;+ *zoom: 1;+}++/*+ * Prevents modern browsers from displaying 'audio' without controls+ */++audio:not([controls]) {+ display: none;+}++/*+ * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4+ * Known issue: no IE6 support+ */++[hidden] {+ display: none;+}+++/* =============================================================================+ Base+ ========================================================================== */++/*+ * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units+ * http://clagnut.com/blog/348/#c790+ * 2. Keeps page centred in all browsers regardless of content height+ * 3. Prevents iOS text size adjust after orientation change, without disabling user zoom+ * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/+ */++html {+ font-size: 100%; /* 1 */+ overflow-y: scroll; /* 2 */+ -webkit-text-size-adjust: 100%; /* 3 */+ -ms-text-size-adjust: 100%; /* 3 */+}++/*+ * Addresses margins handled incorrectly in IE6/7+ */++body {+ margin: 0;+}++/* + * Addresses font-family inconsistency between 'textarea' and other form elements.+ */++body,+button,+input,+select,+textarea {+ font-family: sans-serif;+}+++/* =============================================================================+ Links+ ========================================================================== */++a {+ color: #00e;+}++a:visited {+ color: #551a8b;+}++/*+ * Addresses outline displayed oddly in Chrome+ */++a:focus {+ outline: thin dotted;+}++/*+ * Improves readability when focused and also mouse hovered in all browsers+ * people.opera.com/patrickl/experiments/keyboard/test+ */++a:hover,+a:active {+ outline: 0;+}+++/* =============================================================================+ Typography+ ========================================================================== */++/*+ * Addresses styling not present in IE7/8/9, S5, Chrome+ */++abbr[title] {+ border-bottom: 1px dotted;+}++/*+ * Addresses style set to 'bolder' in FF3/4, S4/5, Chrome+*/++b, +strong { + font-weight: bold; +}++blockquote {+ margin: 1em 40px;+}++/*+ * Addresses styling not present in S5, Chrome+ */++dfn {+ font-style: italic;+}++/*+ * Addresses styling not present in IE6/7/8/9+ */++mark {+ background: #ff0;+ color: #000;+}++/*+ * Corrects font family set oddly in IE6, S4/5, Chrome+ * en.wikipedia.org/wiki/User:Davidgothberg/Test59+ */++pre,+code,+kbd,+samp {+ font-family: monospace, serif;+ _font-family: 'courier new', monospace;+ font-size: 1em;+}++/*+ * Improves readability of pre-formatted text in all browsers+ */++pre {+ white-space: pre;+ white-space: pre-wrap;+ word-wrap: break-word;+}++/*+ * 1. Addresses CSS quotes not supported in IE6/7+ * 2. Addresses quote property not supported in S4+ */++/* 1 */++q {+ quotes: none;+}++/* 2 */++q:before,+q:after {+ content: '';+ content: none;+}++small {+ font-size: 75%;+}++/*+ * Prevents sub and sup affecting line-height in all browsers+ * gist.github.com/413930+ */++sub,+sup {+ font-size: 75%;+ line-height: 0;+ position: relative;+ vertical-align: baseline;+}++sup {+ top: -0.5em;+}++sub {+ bottom: -0.25em;+}+++/* =============================================================================+ Lists+ ========================================================================== */++ul,+ol {+ margin: 1em 0;+ padding: 0 0 0 40px;+}++dd {+ margin: 0 0 0 40px;+}++nav ul,+nav ol {+ list-style: none;+ list-style-image: none;+}+++/* =============================================================================+ Embedded content+ ========================================================================== */++/*+ * 1. Removes border when inside 'a' element in IE6/7/8/9+ * 2. Improves image quality when scaled in IE7+ * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/+ */++img {+ border: 0; /* 1 */+ -ms-interpolation-mode: bicubic; /* 2 */+}++/*+ * Corrects overflow displayed oddly in IE9 + */++svg:not(:root) {+ overflow: hidden;+}+++/* =============================================================================+ Figures+ ========================================================================== */++/*+ * Addresses margin not present in IE6/7/8/9, S5, O11+ */++figure {+ margin: 0;+}+++/* =============================================================================+ Forms+ ========================================================================== */++/*+ * Corrects margin displayed oddly in IE6/7+ */++form {+ margin: 0;+}++/*+ * Define consistent margin and padding+ */++fieldset {+ margin: 0 2px;+ padding: 0.35em 0.625em 0.75em;+}++/*+ * 1. Corrects color not being inherited in IE6/7/8/9+ * 2. Corrects alignment displayed oddly in IE6/7+ */++legend {+ border: 0; /* 1 */+ *margin-left: -7px; /* 2 */+}++/*+ * 1. Corrects font size not being inherited in all browsers+ * 2. Addresses margins set differently in IE6/7, F3/4, S5, Chrome+ * 3. Improves appearance and consistency in all browsers+ */++button,+input,+select,+textarea {+ font-size: 100%; /* 1 */+ margin: 0; /* 2 */+ vertical-align: baseline; /* 3 */+ *vertical-align: middle; /* 3 */+}++/*+ * 1. Addresses FF3/4 setting line-height using !important in the UA stylesheet+ * 2. Corrects inner spacing displayed oddly in IE6/7+ */++button,+input {+ line-height: normal; /* 1 */+ *overflow: visible; /* 2 */+}++/*+ * Corrects overlap and whitespace issue for buttons and inputs in IE6/7+ * Known issue: reintroduces inner spacing+ */++table button,+table input {+ *overflow: auto;+}++/*+ * 1. Improves usability and consistency of cursor style between image-type 'input' and others+ * 2. Corrects inability to style clickable 'input' types in iOS+ */++button,+html input[type="button"], +input[type="reset"], +input[type="submit"] {+ cursor: pointer; /* 1 */+ -webkit-appearance: button; /* 2 */+}++/*+ * 1. Addresses box sizing set to content-box in IE8/9+ * 2. Addresses excess padding in IE8/9+ */++input[type="checkbox"],+input[type="radio"] {+ box-sizing: border-box; /* 1 */+ padding: 0; /* 2 */+}++/*+ * 1. Addresses appearance set to searchfield in S5, Chrome+ * 2. Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof)+ */++input[type="search"] {+ -webkit-appearance: textfield; /* 1 */+ -moz-box-sizing: content-box;+ -webkit-box-sizing: content-box; /* 2 */+ box-sizing: content-box;+}++/*+ * Corrects inner padding displayed oddly in S5, Chrome on OSX+ */++input[type="search"]::-webkit-search-decoration {+ -webkit-appearance: none;+}++/*+ * Corrects inner padding and border displayed oddly in FF3/4+ * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/+ */++button::-moz-focus-inner,+input::-moz-focus-inner {+ border: 0;+ padding: 0;+}++/*+ * 1. Removes default vertical scrollbar in IE6/7/8/9+ * 2. Improves readability and alignment in all browsers+ */++textarea {+ overflow: auto; /* 1 */+ vertical-align: top; /* 2 */+}+++/* =============================================================================+ Tables+ ========================================================================== */++/* + * Remove most spacing between table cells+ */++table {+ border-collapse: collapse;+ border-spacing: 0;+}
scaffold/tiny/Application.hs.cg view
@@ -1,20 +1,16 @@-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( with~sitearg~ , withDevelAppPort ) where -import Foundation+import Import import Settings import Yesod.Static import Yesod.Default.Config import Yesod.Default.Main (defaultDevelApp, defaultRunner) import Yesod.Default.Handlers (getFaviconR, getRobotsR) import Yesod.Logger (Logger)-import Data.ByteString (ByteString) import Network.Wai (Application) import Data.Dynamic (Dynamic, toDyn)
scaffold/tiny/Foundation.hs.cg view
@@ -1,5 +1,3 @@-{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-}-{-# LANGUAGE OverloadedStrings, MultiParamTypeClasses #-} module Foundation ( ~sitearg~ (..) , ~sitearg~Route (..)@@ -14,6 +12,7 @@ , liftIO ) where +import Prelude import Yesod.Core import Yesod.Default.Config import Yesod.Default.Util (addStaticContentExternal)@@ -81,7 +80,7 @@ pc <- widgetToPageContent $ do $(widgetFile "normalize") $(widgetFile "default-layout")- hamletToRepHtml $(hamletFile "hamlet/default-layout-wrapper.hamlet")+ hamletToRepHtml $(hamletFile "templates/default-layout-wrapper.hamlet") -- This is done to provide an optimization for serving static files from -- a separate domain. Please see the staticroot setting in Settings.hs
scaffold/tiny/Settings.hs.cg view
@@ -1,6 +1,3 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}-{-# LANGUAGE OverloadedStrings #-} -- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod@@ -12,6 +9,7 @@ , staticDir ) where +import Prelude (FilePath, String) import Text.Shakespeare.Text (st) import Language.Haskell.TH.Syntax import Yesod.Default.Config@@ -37,7 +35,7 @@ -- -- To see how this value is used, see urlRenderOverride in ~project~.hs staticRoot :: AppConfig DefaultEnv -> Text-staticRoot conf = [st|#{appRoot conf}/static|]+staticRoot conf = [~qq~st|#{appRoot conf}/static|] widgetFile :: String -> Q Exp #if PRODUCTION
scaffold/tiny/project.cabal.cg view
@@ -27,12 +27,22 @@ Buildable: False exposed-modules: Application other-modules: Foundation+ Import Settings Settings.StaticFiles Handler.Root ghc-options: -Wall -threaded -O0 + extensions: TemplateHaskell+ QuasiQuotes+ OverloadedStrings+ NoImplicitPrelude+ CPP+ OverloadedStrings+ MultiParamTypeClasses+ TypeFamilies+ executable ~project~ if flag(devel) Buildable: False@@ -45,10 +55,19 @@ main-is: main.hs + extensions: TemplateHaskell+ QuasiQuotes+ OverloadedStrings+ NoImplicitPrelude+ CPP+ OverloadedStrings+ MultiParamTypeClasses+ TypeFamilies+ build-depends: base >= 4 && < 5 , yesod-core >= 0.9.3 && < 0.10 , yesod-static >= 0.3.1 && < 0.4- , yesod-default >= 0.3.1 && < 0.4+ , yesod-default >= 0.4 && < 0.5 , clientsession >= 0.7.3 && < 0.8 , bytestring >= 0.9 && < 0.10 , text >= 0.11 && < 0.12
yesod.cabal view
@@ -1,5 +1,5 @@ name: yesod-version: 0.9.3+version: 0.9.3.1 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -17,9 +17,10 @@ extra-source-files: input/*.cg- scaffold/lucius/default-layout.lucius.cg- scaffold/lucius/homepage.lucius.cg+ scaffold/templates/default-layout.lucius.cg+ scaffold/templates/homepage.lucius.cg scaffold/Model.hs.cg+ scaffold/Import.hs.cg scaffold/Foundation.hs.cg scaffold/LICENSE.cg scaffold/mongoDBConnPool.cg@@ -28,17 +29,17 @@ scaffold/tiny/Application.hs.cg scaffold/tiny/config/routes.cg scaffold/tiny/Settings.hs.cg- scaffold/lucius/normalize.lucius.cg+ scaffold/templates/normalize.lucius.cg scaffold/postgresqlConnPool.cg scaffold/sqliteConnPool.cg scaffold/.ghci.cg scaffold/project.cabal.cg scaffold/Application.hs.cg- scaffold/julius/homepage.julius.cg- scaffold/hamlet/homepage.hamlet.cg- scaffold/hamlet/default-layout.hamlet.cg- scaffold/hamlet/default-layout-wrapper.hamlet.cg- scaffold/hamlet/boilerplate-layout.hamlet.cg+ scaffold/templates/homepage.julius.cg+ scaffold/templates/homepage.hamlet.cg+ scaffold/templates/default-layout.hamlet.cg+ scaffold/templates/default-layout-wrapper.hamlet.cg+ scaffold/templates/boilerplate-wrapper.hamlet.cg scaffold/deploy/Procfile.cg scaffold/main.hs.cg scaffold/Handler/Root.hs.cg@@ -49,6 +50,7 @@ scaffold/config/postgresql.yml.cg scaffold/config/mongoDB.yml.cg scaffold/config/routes.cg+ scaffold/config/robots.txt.cg scaffold/Settings.hs.cg scaffold/Settings/StaticFiles.hs.cg scaffold/messages/en.msg.cg