Scaffold updates

This commit is contained in:
Michael Snoyman 2015-03-22 14:05:24 +02:00
parent 3171e2f243
commit c7d41f2395
8 changed files with 288 additions and 73 deletions

View File

@ -7,7 +7,22 @@
{-# START_FILE .ghci #-}
:set -i.:config:dist/build/autogen
:set -DDEVELOPMENT
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable
:set -XCPP
:set -XDeriveDataTypeable
:set -XEmptyDataDecls
:set -XFlexibleContexts
:set -XGADTs
:set -XGeneralizedNewtypeDeriving
:set -XMultiParamTypeClasses
:set -XNoImplicitPrelude
:set -XNoMonomorphismRestriction
:set -XOverloadedStrings
:set -XQuasiQuotes
:set -XRecordWildCards
:set -XTemplateHaskell
:set -XTupleSections
:set -XTypeFamilies
:set -XViewPatterns
{-# START_FILE .gitignore #-}
dist*

View File

@ -7,7 +7,22 @@
{-# START_FILE .ghci #-}
:set -i.:config:dist/build/autogen
:set -DDEVELOPMENT
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable
:set -XCPP
:set -XDeriveDataTypeable
:set -XEmptyDataDecls
:set -XFlexibleContexts
:set -XGADTs
:set -XGeneralizedNewtypeDeriving
:set -XMultiParamTypeClasses
:set -XNoImplicitPrelude
:set -XNoMonomorphismRestriction
:set -XOverloadedStrings
:set -XQuasiQuotes
:set -XRecordWildCards
:set -XTemplateHaskell
:set -XTupleSections
:set -XTypeFamilies
:set -XViewPatterns
{-# START_FILE .gitignore #-}
dist*
@ -231,7 +246,7 @@ instance Yesod App where
-- Store session data on the client in encrypted cookies,
-- default session idle timeout is 120 minutes
makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
makeSessionBackend _ = Just <$> defaultClientSessionBackend
120 -- timeout in minutes
"config/client_session_key.aes"
@ -312,11 +327,10 @@ instance YesodAuth App where
x <- getBy $ UniqueUser $ credsIdent creds
case x of
Just (Entity uid _) -> return $ Just uid
Nothing -> do
fmap Just $ insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
Nothing -> Just <$> insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
-- You can add other plugins like BrowserID, email or OAuth here
authPlugins _ = [authBrowserId def]
@ -504,7 +518,7 @@ library
, template-haskell
, shakespeare >= 2.0 && < 2.1
, hjsmin >= 0.1 && < 0.2
, monad-control >= 0.3 && < 0.4
, monad-control >= 0.3 && < 1.1
, wai-extra >= 3.0 && < 3.1
, yaml >= 0.8 && < 0.9
, http-conduit >= 2.1 && < 2.2
@ -514,7 +528,7 @@ library
, aeson >= 0.6 && < 0.9
, conduit >= 1.0 && < 2.0
, monad-logger >= 0.3 && < 0.4
, fast-logger >= 2.2 && < 2.3
, fast-logger >= 2.2 && < 2.4
, wai-logger >= 2.2 && < 2.3
, file-embed
, safe
@ -564,6 +578,7 @@ test-suite test
, persistent-mongoDB
, resourcet
, monad-logger
, shakespeare
, transformers
, hspec >= 2.0.0
, classy-prelude
@ -8997,6 +9012,7 @@ $maybe msg <- mmsg
<li ##{aDomId}>If you had javascript enabled then you wouldn't be seeing this.
<hr />
<li #form>
This is an example trivial Form. Read the #
\<a href="http://www.yesodweb.com/book/forms">Forms chapter<span class="glyphicon glyphicon-bookmark"></span></a> #
@ -9008,6 +9024,7 @@ $maybe msg <- mmsg
^{formWidget}
<button .btn .btn-primary type="submit">
Send it! <span class="glyphicon glyphicon-upload"></span>
<hr />
<li> And last but not least, Testing. In <em>tests/main.hs</em> you will find a #
test suite that performs tests on this page. #
@ -9018,11 +9035,25 @@ document.getElementById(#{toJSON aDomId}).innerHTML = "This text was added by th
{-# START_FILE templates/homepage.lucius #-}
h1 {
text-align: center
text-align: center;
margin-bottom: 30px
}
h2##{aDomId} {
color: #990
}
li {
line-height: 2em;
font-size: 16px
}
ol {
margin-bottom: 30px
}
footer {
text-align: center
}
.input-sm {
margin-left: 20px
}
{-# START_FILE test/Handler/CommonSpec.hs #-}
module Handler.CommonSpec (spec) where

View File

@ -7,7 +7,22 @@
{-# START_FILE .ghci #-}
:set -i.:config:dist/build/autogen
:set -DDEVELOPMENT
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable
:set -XCPP
:set -XDeriveDataTypeable
:set -XEmptyDataDecls
:set -XFlexibleContexts
:set -XGADTs
:set -XGeneralizedNewtypeDeriving
:set -XMultiParamTypeClasses
:set -XNoImplicitPrelude
:set -XNoMonomorphismRestriction
:set -XOverloadedStrings
:set -XQuasiQuotes
:set -XRecordWildCards
:set -XTemplateHaskell
:set -XTupleSections
:set -XTypeFamilies
:set -XViewPatterns
{-# START_FILE .gitignore #-}
dist*
@ -246,7 +261,7 @@ instance Yesod App where
-- Store session data on the client in encrypted cookies,
-- default session idle timeout is 120 minutes
makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
makeSessionBackend _ = Just <$> defaultClientSessionBackend
120 -- timeout in minutes
"config/client_session_key.aes"
@ -326,11 +341,10 @@ instance YesodAuth App where
x <- getBy $ UniqueUser $ credsIdent creds
case x of
Just (Entity uid _) -> return $ Just uid
Nothing -> do
fmap Just $ insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
Nothing -> Just <$> insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
-- You can add other plugins like BrowserID, email or OAuth here
authPlugins _ = [authBrowserId def]
@ -515,7 +529,7 @@ library
, template-haskell
, shakespeare >= 2.0 && < 2.1
, hjsmin >= 0.1 && < 0.2
, monad-control >= 0.3 && < 0.4
, monad-control >= 0.3 && < 1.1
, wai-extra >= 3.0 && < 3.1
, yaml >= 0.8 && < 0.9
, http-conduit >= 2.1 && < 2.2
@ -525,7 +539,7 @@ library
, aeson >= 0.6 && < 0.9
, conduit >= 1.0 && < 2.0
, monad-logger >= 0.3 && < 0.4
, fast-logger >= 2.2 && < 2.3
, fast-logger >= 2.2 && < 2.4
, wai-logger >= 2.2 && < 2.3
, file-embed
, safe
@ -575,6 +589,7 @@ test-suite test
, persistent-mysql
, resourcet
, monad-logger
, shakespeare
, transformers
, hspec >= 2.0.0
, classy-prelude
@ -9007,6 +9022,7 @@ $maybe msg <- mmsg
<li ##{aDomId}>If you had javascript enabled then you wouldn't be seeing this.
<hr />
<li #form>
This is an example trivial Form. Read the #
\<a href="http://www.yesodweb.com/book/forms">Forms chapter<span class="glyphicon glyphicon-bookmark"></span></a> #
@ -9018,6 +9034,7 @@ $maybe msg <- mmsg
^{formWidget}
<button .btn .btn-primary type="submit">
Send it! <span class="glyphicon glyphicon-upload"></span>
<hr />
<li> And last but not least, Testing. In <em>tests/main.hs</em> you will find a #
test suite that performs tests on this page. #
@ -9028,11 +9045,25 @@ document.getElementById(#{toJSON aDomId}).innerHTML = "This text was added by th
{-# START_FILE templates/homepage.lucius #-}
h1 {
text-align: center
text-align: center;
margin-bottom: 30px
}
h2##{aDomId} {
color: #990
}
li {
line-height: 2em;
font-size: 16px
}
ol {
margin-bottom: 30px
}
footer {
text-align: center
}
.input-sm {
margin-left: 20px
}
{-# START_FILE test/Handler/CommonSpec.hs #-}
module Handler.CommonSpec (spec) where

View File

@ -7,7 +7,22 @@
{-# START_FILE .ghci #-}
:set -i.:config:dist/build/autogen
:set -DDEVELOPMENT
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable
:set -XCPP
:set -XDeriveDataTypeable
:set -XEmptyDataDecls
:set -XFlexibleContexts
:set -XGADTs
:set -XGeneralizedNewtypeDeriving
:set -XMultiParamTypeClasses
:set -XNoImplicitPrelude
:set -XNoMonomorphismRestriction
:set -XOverloadedStrings
:set -XQuasiQuotes
:set -XRecordWildCards
:set -XTemplateHaskell
:set -XTupleSections
:set -XTypeFamilies
:set -XViewPatterns
{-# START_FILE .gitignore #-}
dist*
@ -253,7 +268,7 @@ instance Yesod App where
-- Store session data on the client in encrypted cookies,
-- default session idle timeout is 120 minutes
makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
makeSessionBackend _ = Just <$> defaultClientSessionBackend
120 -- timeout in minutes
"config/client_session_key.aes"
@ -342,11 +357,10 @@ instance YesodAuth App where
x <- getBy $ UniqueUser $ credsIdent creds
case x of
Just (Entity uid _) -> return $ Just uid
Nothing -> do
fmap Just $ insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
Nothing -> Just <$> insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
-- You can add other plugins like BrowserID, email or OAuth here
authPlugins _ = [authBrowserId def]
@ -559,7 +573,7 @@ library
, persistent-template >= 2.0 && < 2.2
, template-haskell
, shakespeare >= 2.0 && < 2.1
, monad-control >= 0.3 && < 0.4
, monad-control >= 0.3 && < 1.1
, wai-extra >= 3.0 && < 3.1
, yaml >= 0.8 && < 0.9
, http-conduit >= 2.1 && < 2.2
@ -569,7 +583,7 @@ library
, aeson >= 0.6 && < 0.9
, conduit >= 1.0 && < 2.0
, monad-logger >= 0.3 && < 0.4
, fast-logger >= 2.2 && < 2.3
, fast-logger >= 2.2 && < 2.4
, wai-logger >= 2.2 && < 2.3
, file-embed
, safe
@ -619,6 +633,7 @@ test-suite test
, persistent-postgresql
, resourcet
, monad-logger
, shakespeare
, transformers
, hspec >= 2.0.0
, classy-prelude
@ -9122,6 +9137,7 @@ $maybe msg <- mmsg
<li ##{aDomId}>If you had javascript enabled then you wouldn't be seeing this.
<hr />
<li #form>
This is an example trivial Form. Read the #
\<a href="http://www.yesodweb.com/book/forms">Forms chapter<span class="glyphicon glyphicon-bookmark"></span></a> #
@ -9133,6 +9149,7 @@ $maybe msg <- mmsg
^{formWidget}
<button .btn .btn-primary type="submit">
Send it! <span class="glyphicon glyphicon-upload"></span>
<hr />
<li> And last but not least, Testing. In <em>tests/main.hs</em> you will find a #
test suite that performs tests on this page. #
@ -9148,11 +9165,25 @@ document.getElementById(#{toJSON aDomId}).innerHTML = "This text was added by th
{-# START_FILE templates/homepage.lucius #-}
h1 {
text-align: center
text-align: center;
margin-bottom: 30px
}
h2##{aDomId} {
color: #990
}
li {
line-height: 2em;
font-size: 16px
}
ol {
margin-bottom: 30px
}
footer {
text-align: center
}
.input-sm {
margin-left: 20px
}
{-# START_FILE test/Handler/CommonSpec.hs #-}
module Handler.CommonSpec (spec) where
@ -9223,6 +9254,7 @@ import Database.Persist.Sql (SqlPersistM, SqlBackend, runSqlPersistMPool, rawEx
import Foundation as X
import Model as X
import Test.Hspec as X
import Text.Shakespeare.Text (st)
import Yesod.Default.Config2 (ignoreEnv, loadAppSettings)
import Yesod.Test as X
@ -9249,16 +9281,21 @@ withApp = before $ do
-- 'withApp' calls it before each test, creating a clean environment for each
-- spec to run in.
wipeDB :: App -> IO ()
wipeDB app = do
runDBWithApp app $ do
tables <- getTables
sqlBackend <- ask
wipeDB app = runDBWithApp app $ do
tables <- getTables
sqlBackend <- ask
let escapedTables = map (connEscapeName sqlBackend . DBName) tables
query = "TRUNCATE TABLE " ++ (intercalate ", " escapedTables)
rawExecute query []
let escapedTables = map (connEscapeName sqlBackend . DBName) tables
query = "TRUNCATE TABLE " ++ intercalate ", " escapedTables
rawExecute query []
getTables :: MonadIO m => ReaderT SqlBackend m [Text]
getTables = do
tables <- rawSql "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';" []
tables <- rawSql [st|
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public';
|] []
return $ map unSingle tables

View File

@ -7,7 +7,22 @@
{-# START_FILE .ghci #-}
:set -i.:config:dist/build/autogen
:set -DDEVELOPMENT
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable
:set -XCPP
:set -XDeriveDataTypeable
:set -XEmptyDataDecls
:set -XFlexibleContexts
:set -XGADTs
:set -XGeneralizedNewtypeDeriving
:set -XMultiParamTypeClasses
:set -XNoImplicitPrelude
:set -XNoMonomorphismRestriction
:set -XOverloadedStrings
:set -XQuasiQuotes
:set -XRecordWildCards
:set -XTemplateHaskell
:set -XTupleSections
:set -XTypeFamilies
:set -XViewPatterns
{-# START_FILE .gitignore #-}
dist*
@ -246,7 +261,7 @@ instance Yesod App where
-- Store session data on the client in encrypted cookies,
-- default session idle timeout is 120 minutes
makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
makeSessionBackend _ = Just <$> defaultClientSessionBackend
120 -- timeout in minutes
"config/client_session_key.aes"
@ -326,11 +341,10 @@ instance YesodAuth App where
x <- getBy $ UniqueUser $ credsIdent creds
case x of
Just (Entity uid _) -> return $ Just uid
Nothing -> do
fmap Just $ insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
Nothing -> Just <$> insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
-- You can add other plugins like BrowserID, email or OAuth here
authPlugins _ = [authBrowserId def]
@ -515,7 +529,7 @@ library
, template-haskell
, shakespeare >= 2.0 && < 2.1
, hjsmin >= 0.1 && < 0.2
, monad-control >= 0.3 && < 0.4
, monad-control >= 0.3 && < 1.1
, wai-extra >= 3.0 && < 3.1
, yaml >= 0.8 && < 0.9
, http-conduit >= 2.1 && < 2.2
@ -525,7 +539,7 @@ library
, aeson >= 0.6 && < 0.9
, conduit >= 1.0 && < 2.0
, monad-logger >= 0.3 && < 0.4
, fast-logger >= 2.2 && < 2.3
, fast-logger >= 2.2 && < 2.4
, wai-logger >= 2.2 && < 2.3
, file-embed
, safe
@ -575,6 +589,7 @@ test-suite test
, persistent-postgresql
, resourcet
, monad-logger
, shakespeare
, transformers
, hspec >= 2.0.0
, classy-prelude
@ -9007,6 +9022,7 @@ $maybe msg <- mmsg
<li ##{aDomId}>If you had javascript enabled then you wouldn't be seeing this.
<hr />
<li #form>
This is an example trivial Form. Read the #
\<a href="http://www.yesodweb.com/book/forms">Forms chapter<span class="glyphicon glyphicon-bookmark"></span></a> #
@ -9018,6 +9034,7 @@ $maybe msg <- mmsg
^{formWidget}
<button .btn .btn-primary type="submit">
Send it! <span class="glyphicon glyphicon-upload"></span>
<hr />
<li> And last but not least, Testing. In <em>tests/main.hs</em> you will find a #
test suite that performs tests on this page. #
@ -9028,11 +9045,25 @@ document.getElementById(#{toJSON aDomId}).innerHTML = "This text was added by th
{-# START_FILE templates/homepage.lucius #-}
h1 {
text-align: center
text-align: center;
margin-bottom: 30px
}
h2##{aDomId} {
color: #990
}
li {
line-height: 2em;
font-size: 16px
}
ol {
margin-bottom: 30px
}
footer {
text-align: center
}
.input-sm {
margin-left: 20px
}
{-# START_FILE test/Handler/CommonSpec.hs #-}
module Handler.CommonSpec (spec) where
@ -9103,6 +9134,7 @@ import Database.Persist.Sql (SqlPersistM, SqlBackend, runSqlPersistMPool, rawEx
import Foundation as X
import Model as X
import Test.Hspec as X
import Text.Shakespeare.Text (st)
import Yesod.Default.Config2 (ignoreEnv, loadAppSettings)
import Yesod.Test as X
@ -9129,16 +9161,21 @@ withApp = before $ do
-- 'withApp' calls it before each test, creating a clean environment for each
-- spec to run in.
wipeDB :: App -> IO ()
wipeDB app = do
runDBWithApp app $ do
tables <- getTables
sqlBackend <- ask
wipeDB app = runDBWithApp app $ do
tables <- getTables
sqlBackend <- ask
let escapedTables = map (connEscapeName sqlBackend . DBName) tables
query = "TRUNCATE TABLE " ++ (intercalate ", " escapedTables)
rawExecute query []
let escapedTables = map (connEscapeName sqlBackend . DBName) tables
query = "TRUNCATE TABLE " ++ intercalate ", " escapedTables
rawExecute query []
getTables :: MonadIO m => ReaderT SqlBackend m [Text]
getTables = do
tables <- rawSql "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';" []
tables <- rawSql [st|
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public';
|] []
return $ map unSingle tables

View File

@ -7,7 +7,22 @@
{-# START_FILE .ghci #-}
:set -i.:config:dist/build/autogen
:set -DDEVELOPMENT
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable
:set -XCPP
:set -XDeriveDataTypeable
:set -XEmptyDataDecls
:set -XFlexibleContexts
:set -XGADTs
:set -XGeneralizedNewtypeDeriving
:set -XMultiParamTypeClasses
:set -XNoImplicitPrelude
:set -XNoMonomorphismRestriction
:set -XOverloadedStrings
:set -XQuasiQuotes
:set -XRecordWildCards
:set -XTemplateHaskell
:set -XTupleSections
:set -XTypeFamilies
:set -XViewPatterns
{-# START_FILE .gitignore #-}
dist*
@ -219,7 +234,7 @@ instance Yesod App where
-- Store session data on the client in encrypted cookies,
-- default session idle timeout is 120 minutes
makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
makeSessionBackend _ = Just <$> defaultClientSessionBackend
120 -- timeout in minutes
"config/client_session_key.aes"
@ -428,7 +443,7 @@ library
, template-haskell
, shakespeare >= 2.0 && < 2.1
, hjsmin >= 0.1 && < 0.2
, monad-control >= 0.3 && < 0.4
, monad-control >= 0.3 && < 1.1
, wai-extra >= 3.0 && < 3.1
, yaml >= 0.8 && < 0.9
, http-conduit >= 2.1 && < 2.2
@ -438,7 +453,7 @@ library
, aeson >= 0.6 && < 0.9
, conduit >= 1.0 && < 2.0
, monad-logger >= 0.3 && < 0.4
, fast-logger >= 2.2 && < 2.3
, fast-logger >= 2.2 && < 2.4
, wai-logger >= 2.2 && < 2.3
, file-embed
, safe
@ -8888,6 +8903,7 @@ $maybe msg <- mmsg
<li ##{aDomId}>If you had javascript enabled then you wouldn't be seeing this.
<hr />
<li #form>
This is an example trivial Form. Read the #
\<a href="http://www.yesodweb.com/book/forms">Forms chapter<span class="glyphicon glyphicon-bookmark"></span></a> #
@ -8899,6 +8915,7 @@ $maybe msg <- mmsg
^{formWidget}
<button .btn .btn-primary type="submit">
Send it! <span class="glyphicon glyphicon-upload"></span>
<hr />
<li> And last but not least, Testing. In <em>tests/main.hs</em> you will find a #
test suite that performs tests on this page. #
@ -8909,11 +8926,25 @@ document.getElementById(#{toJSON aDomId}).innerHTML = "This text was added by th
{-# START_FILE templates/homepage.lucius #-}
h1 {
text-align: center
text-align: center;
margin-bottom: 30px
}
h2##{aDomId} {
color: #990
}
li {
line-height: 2em;
font-size: 16px
}
ol {
margin-bottom: 30px
}
footer {
text-align: center
}
.input-sm {
margin-left: 20px
}
{-# START_FILE test/Handler/CommonSpec.hs #-}
module Handler.CommonSpec (spec) where

View File

@ -7,7 +7,22 @@
{-# START_FILE .ghci #-}
:set -i.:config:dist/build/autogen
:set -DDEVELOPMENT
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable
:set -XCPP
:set -XDeriveDataTypeable
:set -XEmptyDataDecls
:set -XFlexibleContexts
:set -XGADTs
:set -XGeneralizedNewtypeDeriving
:set -XMultiParamTypeClasses
:set -XNoImplicitPrelude
:set -XNoMonomorphismRestriction
:set -XOverloadedStrings
:set -XQuasiQuotes
:set -XRecordWildCards
:set -XTemplateHaskell
:set -XTupleSections
:set -XTypeFamilies
:set -XViewPatterns
{-# START_FILE .gitignore #-}
dist*
@ -246,7 +261,7 @@ instance Yesod App where
-- Store session data on the client in encrypted cookies,
-- default session idle timeout is 120 minutes
makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
makeSessionBackend _ = Just <$> defaultClientSessionBackend
120 -- timeout in minutes
"config/client_session_key.aes"
@ -326,11 +341,10 @@ instance YesodAuth App where
x <- getBy $ UniqueUser $ credsIdent creds
case x of
Just (Entity uid _) -> return $ Just uid
Nothing -> do
fmap Just $ insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
Nothing -> Just <$> insert User
{ userIdent = credsIdent creds
, userPassword = Nothing
}
-- You can add other plugins like BrowserID, email or OAuth here
authPlugins _ = [authBrowserId def]
@ -515,7 +529,7 @@ library
, template-haskell
, shakespeare >= 2.0 && < 2.1
, hjsmin >= 0.1 && < 0.2
, monad-control >= 0.3 && < 0.4
, monad-control >= 0.3 && < 1.1
, wai-extra >= 3.0 && < 3.1
, yaml >= 0.8 && < 0.9
, http-conduit >= 2.1 && < 2.2
@ -525,7 +539,7 @@ library
, aeson >= 0.6 && < 0.9
, conduit >= 1.0 && < 2.0
, monad-logger >= 0.3 && < 0.4
, fast-logger >= 2.2 && < 2.3
, fast-logger >= 2.2 && < 2.4
, wai-logger >= 2.2 && < 2.3
, file-embed
, safe
@ -575,6 +589,7 @@ test-suite test
, persistent-sqlite
, resourcet
, monad-logger
, shakespeare
, transformers
, hspec >= 2.0.0
, classy-prelude
@ -9025,6 +9040,7 @@ $maybe msg <- mmsg
<li ##{aDomId}>If you had javascript enabled then you wouldn't be seeing this.
<hr />
<li #form>
This is an example trivial Form. Read the #
\<a href="http://www.yesodweb.com/book/forms">Forms chapter<span class="glyphicon glyphicon-bookmark"></span></a> #
@ -9036,6 +9052,7 @@ $maybe msg <- mmsg
^{formWidget}
<button .btn .btn-primary type="submit">
Send it! <span class="glyphicon glyphicon-upload"></span>
<hr />
<li> And last but not least, Testing. In <em>tests/main.hs</em> you will find a #
test suite that performs tests on this page. #
@ -9046,11 +9063,25 @@ document.getElementById(#{toJSON aDomId}).innerHTML = "This text was added by th
{-# START_FILE templates/homepage.lucius #-}
h1 {
text-align: center
text-align: center;
margin-bottom: 30px
}
h2##{aDomId} {
color: #990
}
li {
line-height: 2em;
font-size: 16px
}
ol {
margin-bottom: 30px
}
footer {
text-align: center
}
.input-sm {
margin-left: 20px
}
{-# START_FILE test/Handler/CommonSpec.hs #-}
module Handler.CommonSpec (spec) where
@ -9121,6 +9152,7 @@ import Database.Persist.Sql (SqlPersistM, SqlBackend, runSqlPersistMPool, rawEx
import Foundation as X
import Model as X
import Test.Hspec as X
import Text.Shakespeare.Text (st)
import Yesod.Default.Config2 (ignoreEnv, loadAppSettings)
import Yesod.Test as X
@ -9182,3 +9214,4 @@ getTables :: MonadIO m => ReaderT SqlBackend m [Text]
getTables = do
tables <- rawSql "SELECT name FROM sqlite_master WHERE type = 'table';" []
return (fmap unSingle tables)

View File

@ -1,5 +1,5 @@
name: yesod-bin
version: 1.4.5
version: 1.4.5.1
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>